How do I command Arducopter to enter guided_nogps mode? I am planning to operate in a gps denied environment, and although other posts indicate this is possible with guided-nogps, I cannot see how to set that mode. Using Dronekit (python) vehicle.mode = VehicleMode("Guided_NoGPS") returns an error indicating there is no such mode.
Mavlink also refuses to acknowledge the mode.
My setup is a Pixhawk running Arducopter with a Raspberry Pi companion. Firmware is v3.5 dev, and v3.4 on the DroneKit-SITL (I compiled my own v3.4 binary for this).
Everything else is working great (e.g. controlling via set_attitude_target thanks to this post How to set copters Attitude via DroneKit -- SET_ATTITUDE_TARGET not working ) - I just need to be able to go indoors!
Also - I did notice in this post prior to the release of Arducopter v3.4 Controlling movement without GPS that an optical flow sensor might be required. Did that requirement come to pass?
Thanks again!
All advice welcome.
Thanks Squilter for your help. I created a function to change the flightmode (20):
def set_mode(flightmode):
# create the MAV_CMD_DO_SET_MODE command
msg = vehicle.message_factory.command_long_encode(
0, 0, # target system, target component
mavutil.mavlink.MAV_CMD_DO_SET_MODE, #command
0, #confirmation
flightmode,
0, 0, 0, 0, 0, 0 )
# send command to vehicle
vehicle.send_mavlink(msg)
The message is correctly received but was not successful (result 3 returned). One thing I wasn't sure about was parameter 2, which the spec indicates is platform specific. I put 0 as I wasn't sure what to do with it for Arducopter.
Again, any suggestions welcome and many thanks!