# PX4 SITL/mavros error using setpoint\_attitude topics

**URL:** <https://discuss.px4.io/t/px4-sitl-mavros-error-using-setpoint-attitude-topics/215>\
**Category:** Uncategorized\
**Created:** [February 24, 2016, 12:03am UTC](https://discuss.px4.io/t/px4-sitl-mavros-error-using-setpoint-attitude-topics/215 "2016-02-24T00:03:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtsakaguchi](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/ee59a6/32.png) [@mtsakaguchi](https://discuss.px4.io/u/mtsakaguchi)\
**Post date:** [February 24, 2016, 12:03am UTC](https://discuss.px4.io/t/px4-sitl-mavros-error-using-setpoint-attitude-topics/215/1 "2016-02-24T00:03:19Z")

</div>

Hello,

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.

---

<div class="post-metadata">

**Author:** ![LorenzMeier](https://discuss.px4.io/user_avatar/discuss.px4.io/lorenzmeier/32/17_2.png) [@LorenzMeier](https://discuss.px4.io/u/LorenzMeier)\
**Post date:** [February 25, 2016, 10:11am UTC](https://discuss.px4.io/t/px4-sitl-mavros-error-using-setpoint-attitude-topics/215/2 "2016-02-25T10:11:03Z")

</div>

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](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!):  
[http://dev.px4.io/advanced-system-console.html](http://dev.px4.io/advanced-system-console.html)
