Syntax Fixes
This commit is contained in:
@@ -65,9 +65,9 @@ python scripts/run_ardupilot.py --pattern square --size 10 --altitude 15
|
||||
The flight controller is in `src/drone_controller.py`:
|
||||
|
||||
```python
|
||||
from src.drone_controller import SimpleDroneController
|
||||
from src.drone_controller import DroneController
|
||||
|
||||
drone = SimpleDroneController()
|
||||
drone = DroneController()
|
||||
drone.connect()
|
||||
drone.set_mode("GUIDED")
|
||||
drone.arm()
|
||||
|
||||
@@ -46,10 +46,10 @@ python scripts/run_ardupilot.py --pattern hover
|
||||
### Basic Usage
|
||||
|
||||
```python
|
||||
from src.drone_controller import SimpleDroneController
|
||||
from src.drone_controller import DroneController
|
||||
|
||||
# Create and connect
|
||||
drone = SimpleDroneController()
|
||||
drone = DroneController()
|
||||
if not drone.connect():
|
||||
print("Connection failed")
|
||||
exit(1)
|
||||
@@ -66,12 +66,12 @@ drone.fly_square(size=5, altitude=5)
|
||||
drone.land()
|
||||
```
|
||||
|
||||
### Class: SimpleDroneController
|
||||
### Class: DroneController
|
||||
|
||||
#### Connection
|
||||
|
||||
```python
|
||||
drone = SimpleDroneController(connection_string="tcp:127.0.0.1:5760")
|
||||
drone = DroneController(connection_string="tcp:127.0.0.1:5760")
|
||||
drone.connect(timeout=30) # Returns True/False
|
||||
```
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ def main():
|
||||
print(f" Size: {args.size}m")
|
||||
print("=" * 50 + "\n")
|
||||
|
||||
drone = SimpleDroneController(args.connection)
|
||||
drone = DroneController(args.connection)
|
||||
|
||||
if not drone.connect():
|
||||
print("\n[ERROR] Could not connect to SITL")
|
||||
|
||||
Reference in New Issue
Block a user