ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To control the speeds of a UAV in rotorS, you need to publish an array of speeds to a particular topic.

For Eg: To set all of the motor speeds of 'firefly' UAV to 100, we run the command

rostopic pub /firefly/command/motor_speed mav_msgs/Actuators '{angular_velocities: [100, 100, 100, 100, 100, 100]}'

right?

So, the equivalent to this command, in MATLAB script uses rospublisher, and is as follows: (This publishes messages to the ROS network.)

rosinit
motor_speeds = rospublisher('/firefly/command/motor_speed','mav_msgs/Actuators');
msg = rosmessage(motor_speeds);
msg.Data = '{angular_velocities: [100, 100, 100, 100, 100, 100]}';
send(motor_speeds, msg);

PS: Try this. Let me know what happens. Coz, I haven't run this. I just followed that above link. So, let me know how it goes.

Peace fellazz!!

To Usually, to control the speeds of a UAV in rotorS, you need to publish an array of speeds to a particular topic.topic, right?

For Eg: To set all of the motor speeds of 'firefly' UAV to 100, we run the command

rostopic pub /firefly/command/motor_speed mav_msgs/Actuators '{angular_velocities: [100, 100, 100, 100, 100, 100]}'

right?

So, Now, the equivalent to this command, in using a MATLAB script uses and rospublisher, and is as follows: (This publishes messages to the ROS network.)

rosinit
motor_speeds = rospublisher('/firefly/command/motor_speed','mav_msgs/Actuators');
msg = rosmessage(motor_speeds);
msg.Data = '{angular_velocities: [100, 100, 100, 100, 100, 100]}';
send(motor_speeds, msg);

PS: Try this. Let me know what happens. Coz, I haven't run this. I just followed that above link. So, let me know how it goes.

Peace fellazz!!

Usually, to control the speeds of a UAV in rotorS, you need to publish an array of speeds to a particular topic, right?

For Eg: To set all of the motor speeds of 'firefly' UAV to 100, we run the command

rostopic pub /firefly/command/motor_speed mav_msgs/Actuators '{angular_velocities: [100, 100, 100, 100, 100, 100]}'

Now, the equivalent to this command, using a MATLAB script and rospublisher, is as follows: (This publishes messages to the ROS network.)

rosinit
motor_speeds = rospublisher('/firefly/command/motor_speed','mav_msgs/Actuators');
msg = rosmessage(motor_speeds);
msg.Data = '{angular_velocities: [100, 100, 100, 100, 100, 100]}';
send(motor_speeds, msg);

PS: Try this. Let me know what happens. Coz, I haven't run this. I just followed that above link. So, let me know how it goes.


UPDATE:

In case the ROS topic already exists, follow this:

rosinit
motor_speeds_topic = '/firefly/command/motor_speed';
msg = rosmessage(motor_speeds);
msg.Data = '{angular_velocities: [100, 100, 100, 100, 100, 100]}';
send(motor_speeds_topic, msg);

Change the value of motor_speeds_topic to that existing topic you want.

Peace fellazz!!