Controller design with MAVROS and PX4-SITL

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.

1 Like

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?

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)
? 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.

1 Like

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.

I could get the result by appropriately tuning the gain