Sending velocity commands over Mavros


I am building a fixed wing drone and I am trying to send velocity commands to the flight controller (a Pixhawk) from an onbord computer (Nvidia Jetson TX2) running ROS. 

the code I am using to send the commands looks like this:

ros::Publisher cmd_vel_pub = nh.advertise<geometry_msgs::TwistStamped>("mavros/setpoint_velocity/cmd_vel", 10);

geometry_msgs::TwistStamped cmd_vel;

while (ros::ok()) {

cmd_vel.header.stamp = ros::Time();

cmd_vel.twist.linear.x = 10;

cmd_vel.twist.angular.z = 10;



I am trying this with Ardupilot's SITL simulator and I have managed to send other commands over Mavros such as arm, takeoff and a set of waypoints that the drone in the simulation can reach. But when I send velocity commands nothing happens. 

Has anyone tried to do something similar, or found some documentation on weather the arduplane code supports velocity commands? 

Thankful for any help I can get! 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


This reply was deleted.