I have NAVIO2 with RPI4 and all copter setup done and install. I have calibrated most of the units using QGroundcontrol except Battery (I am using a DC Power supply) Remote control (It is on its way). In the midst of this I am trying to get the DroneKit to work inside raspberry pi. I am using arducopter 3.6 and DroneKit Copter 3.3. I tried running the following script. but ended up
print “Start simulator (SITL)”
import dronekit_sitl
sitl = dronekit_sitl.start_default()
connection_string = sitl.connection_string()
Import DroneKit-Python
from dronekit import connect, VehicleMode
Connect to the Vehicle.
print(“Connecting to vehicle on: %s” % (connection_string,))
vehicle = connect(connection_string, wait_ready=True)
Get some vehicle attributes (state)
print “Get some vehicle attribute values:”
print " GPS: %s" % vehicle.gps_0
print " Battery: %s" % vehicle.battery
print " Last Heartbeat: %s" % vehicle.last_heartbeat
print " Is Armable?: %s" % vehicle.is_armable
print " System status: %s" % vehicle.system_status.state
print " Mode: %s" % vehicle.mode.name # settable
Close vehicle object before exiting script
vehicle.close()
Shut down simulator
sitl.stop()
print(“Completed”)