We are trying to fly indoors so we don’t need the GPS
We are able to arm the drone and get the motors spinning but the mavlink takeoff command always fails. (fail code is 4)
#ARM
self.Arm_mas.mav.command_long_send(
self.Arm_mas.target_system, # target_system
self.Arm_mas.target_component,
mavutil.mavlink.MAV_CMD_COMPONENT_ARM_DISARM, # command
0, # confirmation
1, # param1 (1 to indicate arm)
0, # param2 0 to arm/disarm unless prevented by saftey checks 21196 to force arming/disarming
0, # param3 all other params meaningless)
0, # param4
0, # param5
0, # param6
0) # param7
mesg = self.Arm_mas.recv_match(type='COMMAND_ACK', blocking= True)
print(mesg)
#take off
def TakeOff(self):
master = self.Arm_mas
msg = master.wait_heartbeat()
print(msg)
master.mav.command_long_send(
master.target_system, # target_system
master.target_component,
mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, # command
0, # confirmation
0, # param1 Pitch(deg)
0, # param2 empty
0, # param3 empty
0, # param4 Yaw angle(deg)
0, # param5 Latitude
0, # param6 Longitude
1) # param7 Altitude(m)
mesg = master.recv_match(type='COMMAND_ACK', blocking= True)
print(mesg)