1.2 KiB
1.2 KiB
PyBullet Simulation Guide
Standalone Mode (1 Terminal)
No ROS 2 required. Works on Windows, macOS, Linux:
source activate.sh
python standalone_simulation.py --pattern circular
ROS 2 Mode (2 Terminals)
Terminal 1 - Simulator:
python simulation_host.py
Terminal 2 - Controllers:
python run_bridge.py --pattern circular
Options
--pattern, -p stationary, linear, circular, square, random
--speed, -s Rover speed in m/s (default: 0.5)
--amplitude, -a Movement radius (default: 2.0)
Remote Setup
Machine 1: python simulation_host.py
Machine 2: python run_bridge.py --host <IP>
Sensors
| Sensor | Description |
|---|---|
| IMU | Orientation, angular velocity |
| Altimeter | Altitude, vertical velocity |
| Velocity | Estimated velocity (x, y, z) |
| Camera | 320x240 downward JPEG |
| Landing Pad | Relative position |
Configuration
Edit config.py:
CONTROLLER = {
"Kp_z": 0.5,
"Kd_z": 0.3,
"Kp_xy": 0.3,
"Kd_xy": 0.2,
}
Troubleshooting
"Cannot connect to X server":
xvfb-run python standalone_simulation.py
Drone flies erratically:
Reduce gains in config.py