Thursday, November 13, 2014

Checking MAVLink Arm/Disarm Status


In HEARTBEAT( Msg id 0) consist of arm/disarm status but it not show directly
arm/disarm these stored in base_mode field describe by MAV_MODE_FLAG

HEARTBEAT Message Structure


MAV_MODE_FLAG

As you can see MAV_MODE_FLAG_SAFETY_ARMED 0b10000000 is arm/disarm bit
so we can write simple code to check arm/disarm status from base_mode like these



base_mode & MOTORS_ARMED) >> 7

output is 1 when armed, 0 when disarm

Ref :
https://pixhawk.ethz.ch/mavlink/

No comments:

Post a Comment