PX4 SITL/mavros error using setpoint_attitude topics


I am running the PX4 SITL with Gazebo and am trying to command the
attitude using the setpoint_* topics. I am able to successfully connect
over UDP with mavros however when I publish to the
/mavros/setpoint_raw/attitude topic, the quadcopter in the Gazebo
environment immediately falls to the ground after commanding to OFFBOARD
mode. The “make posix_sitl default gazebo” terminal output then prints
out the warning “uORB::DeviceNode::publish called with invalid handle”
and the terminal output from the mavros node prints out the warning
“CMD: Unexpected command 176, result 0”.

This happens when I publish to both the
/mavros/setpoint_attitude/attitude and /mavros/setpoint_raw/attitude
topics however I am able to command position using the
/mavros/setpoint_position/local topic.

Any help would be appreciated.

Hey - I expect the issue to be somewhere about the flags of the attitude setpoint not set correctly. Can you try to start with instrumenting this code section here (adding warnx("print message: ") ) : https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_receiver.cpp#L881-L906

You can get the output here on the serial console (you will need to connect the hardware serial port and NOT use USB!):