The armed flag in mavros_msgs::Status is not properly written as a boolean true when the vehicle is armed. It is written to 128.
The reason for this is that booleans in ROS messages are really uint8s, so there is no implicit cast to bool in the below line, as was perhaps assumed.
The armed flag in
mavros_msgs::Status
is not properly written as a booleantrue
when the vehicle is armed. It is written to 128.The reason for this is that booleans in ROS messages are really
uint8
s, so there is no implicit cast to bool in the below line, as was perhaps assumed.https://github.com/mavlink/mavros/blob/1b0600f0a6a0606ca70b72eb240f21baf8b8544c/mavros/src/plugins/sys_status.cpp#L657
The problem with this is that the following check does not work:
This is problematic as one would assume that this works since the documentation/the message definition claims that
status.armed
is a boolean.The below works of course:
Changing the above line to the following fixes the issue: