Hello,
In a previous version of PX4 (1.10.1dev, fixed-wing), I could just publish to /mavros/actuator_control from the offboard/companion computer, and then switch to offboard mode via the remote control switch.
After updating to a newer/newest version (any above 1.10.1/1.12.3 stable), this is no longer possible.
Could you point me to how to recover the old capability? We are a control research lab and need full/direct actuator access for both fixed-wing/multi-rotor.
Thank you in advance!
Hi @Jaeyoung-Lim,
Thanks for your message. I didn’t find any helpful information in the Pull Request. The mentioned MAVLINK message should be sent from MAVROS here. I don’t see any problem here.
Note that actuator control is no longer mentioned in Offboard Mode | PX4 User Guide (neither in /v1.10/ though - but it worked there as described below).
[Ubuntu 18.04.3, ROS Melodic, Mavros v1.13.0]
Here is what works for the old PX4 version [PX4 v1.10.1, StandardPlane airfame]
- A ROS node at 100Hz publishes to /mavros/actuator_control
- Switch to Offboard mode via a remote control switch
→ PX4 goes to Offboard mode.
With the new version [PX4 v1.12.3, Coaxial Helicopter airframe], it just doesn’t switch to offboard mode. Instead, it degrades to the next lower flight control mode available, in this case altitude control (for copter).
There is no message about the failed trial to switch to offboard mode, neither in QGroundControl, nor in the MAVROS console output.
Thanks for your help.
@jowaibel Have you checked if the PR I have linked is included in the firmware version you are using?
You’re right, it’s not. I wrongly assumed that the stable release was the head of the master branch. So you are suggesting to just pick that commit into the latest stable version and custom-build it. We’ll try, thank you!
I confirm that the custom build cherry-picking the cda7c6c commit works. Thanks for your help!
1 Like
Hi @Jaeyoung-Lim, I’m trying to give direct commands to the motors using ‘mavros_msgs/ActuatorControl’ over the ‘mavros/actuator_control’ topic. For this, I’m running a script which first sets the drone in offboard mode using the ‘mavros/set_mode’ service and after running that script, the drone moves to an altitude of 1m. Next, I run the following script:
#!/usr/bin/env python3
import rospy
from mavros_msgs.msg import ActuatorControl
def talker():
rospy.init_node('actuator_controller', anonymous=True)
pub = rospy.Publisher('/mavros/actuator_control', ActuatorControl, queue_size=10)
rate = rospy.Rate(100)
msg_out = ActuatorControl()
msg_out.group_mix = 2 # Use group 2 (auxilary controls)
msg_out.header.frame_id = 'base_link'
msg_out.controls = [1.0, -1.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0]
while not rospy.is_shutdown():
msg_out.controls = [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
rospy.loginfo("Set servos high")
msg_out.header.stamp = rospy.Time.now()
pub.publish(msg_out)
rate.sleep()
if __name__ == '__main__':
try:
talker()
except rospy.ROSInterruptException:
pass
After running the second script, I stop the first one(which sets the drone in offboard mode) to observe if the motor commands are observable. But it is not working as desired. I’m implementing this using PX4-Autopilot v1.11.2 in gazebo-sitl. Any idea where I’m going wrong?
Hi Jaeyoung-Lim,
Could you please confirm that actuator control is no longer available in PX4 1.14? I am attempting to use mavros/actuator_control for system identification and am unable to enter offboard mode. Please recommend whether I should downgrade to an earlier PX4 version, or if there is another workaround.
1 Like