# Controller design with MAVROS and PX4-SITL

**URL:** <https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576>\
**Category:** Uncategorized\
**Created:** [February 4, 2025, 5:13pm UTC](https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576 "2025-02-04T17:13:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajin](https://discuss.px4.io/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@ajin](https://discuss.px4.io/u/ajin)\
**Post date:** [February 4, 2025, 5:13pm UTC](https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576/1 "2025-02-04T17:13:52Z")

</div>

I am planning to make controller for quadcopter through SITL for my project. I have seen mavros/actuator\_control topic where i can publish throttle, yaw,pitch and roll.I tried to publish throttle as 0.1 and setting group mix as zero for the IRIS quadcopter which is simulated in gazebo. Also I put the mode ass OFFBOARD. But the copter is not responding and it is not accepting arm command also. What did I expected was to arm the copter since i am providing constant torque. Can you tell me the solution?

Also I have one more question. Is it possible to give custom made controller outputs directly to motor through mavros to control roll, pitch and yaw instead providing reference?  
Thanks  
Ajin A.

---

<div class="post-metadata">

**Author:** ![ajin](https://discuss.px4.io/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@ajin](https://discuss.px4.io/u/ajin)\
**Post date:** [February 6, 2025, 8:25am UTC](https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576/2 "2025-02-06T08:25:26Z")

</div>

I think mavros/actuator\_control is not using in latest version of PX4 firmware evenif it is possible to publish the values through ROS.I have seen vehicle\_thrust\_setpoint and vehicle\_torque\_setpoint in UORB messages. Is it possible to publish to those topics through ROS in any way?

---

<div class="post-metadata">

**Author:** ![mylongword](https://discuss.px4.io/user_avatar/discuss.px4.io/mylongword/32/18357_2.png) [@mylongword](https://discuss.px4.io/u/mylongword)\
**Post date:** [February 6, 2025, 11:43pm UTC](https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576/3 "2025-02-06T23:43:33Z")

</div>

Hello, I totally lack any experience with this, but isn’t this question covered by the documentation at [ROS 2 User Guide (PX4-ROS 2 Bridge) | PX4 User Guide (v1.12)](https://docs.px4.io/v1.12/en/ros/ros2_comm.html)  
? In particular, the warning “You cannot use an agent generated as part of a “normal” PX4 build with ROS 2” seems to imply you need a special build of PX4 as described there in order to achieve what you want.

My own interest in this is a long way into the future.

---

<div class="post-metadata">

**Author:** ![ajin](https://discuss.px4.io/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@ajin](https://discuss.px4.io/u/ajin)\
**Post date:** [February 15, 2025, 3:28pm UTC](https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576/4 "2025-02-15T15:28:01Z")

</div>

I was trying to tackle the problem with ros1 before. I am able to use vehicle\_thrust\_setpoint and vehicle\_torque\_settpoint when I changed to ros2.

I am using vehicle\_attitude\_setpoint for the time being for providing trust and attitude sepoints only. Actually how to provide normalized thrust there for hovering? When I provided a simple PD controller for hovering the drone always hitting ground and taking off.

---

<div class="post-metadata">

**Author:** ![ajin](https://discuss.px4.io/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@ajin](https://discuss.px4.io/u/ajin)\
**Post date:** [March 7, 2025, 7:29am UTC](https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576/5 "2025-03-07T07:29:42Z")

</div>

I could get the result by appropriately tuning the gain

---

<div class="post-metadata">

**Author:** ![mohammedAcheddad](https://discuss.px4.io/user_avatar/discuss.px4.io/mohammedacheddad/32/20267_2.png) [@mohammedAcheddad](https://discuss.px4.io/u/mohammedAcheddad)\
**Post date:** [September 3, 2025, 11:42am UTC](https://discuss.px4.io/t/controller-design-with-mavros-and-px4-sitl/43576/6 "2025-09-03T11:42:31Z")

</div>

@ajin Hey I am having the same issue, were you able to use thrust/torque setpoints at the end or not?
