# PX4 control with move\_base ROS - Is this possible?

**URL:** <https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185>\
**Category:** Uncategorized\
**Created:** [May 2, 2017, 11:01am UTC](https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185 "2017-05-02T11:01:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ealdaz](https://discuss.px4.io/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@ealdaz](https://discuss.px4.io/u/ealdaz)\
**Post date:** [May 2, 2017, 11:01am UTC](https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185/1 "2017-05-02T11:01:17Z")

</div>

Dear all

I would like to use the ROS standard move\_base ROS Node which is a major component of the ROS navigation stack. I am hoping to use it with the (soon to be available) PX4 Rover implementation and practice with some of the ROS SLAM tools in the process.

In the meantime I’m using SITL with multicopters and OFFBOARD control. I have installed the MAVROS package and successfully run the examples on [MAVROS Offboard Example · PX4 Developer Guide](https://dev.px4.io/en/ros/mavros_offboard.html) and the example [https://pixhawk.org/dev/ros/ground\_rover](https://pixhawk.org/dev/ros/ground_rover) (although this required some modifications to the file as some of the message names have changed)

move\_base publishes cmd\_vel topics, and MAVROS provides a couple of topics with cmd\_vel such as:

```auto
$ rostopic info /mavros/setpoint_attitude/cmd_vel 
Type: geometry_msgs/TwistStamped
$ rostopic info /mavros/setpoint_velocity/cmd_vel 
Type: geometry_msgs/TwistStamped

```

However the message type is TwistStamped as opposed to simply Twist which is what move\_base expects.

This mismatch makes me suspect that using move\_base and hence cmd\_vel topic might not be one of the implemented and tested ways of controlling PX4 from ROS?

As I test I did a takeoff, sent cmd\_vel messages and then set OFFBOARD to see what happened, and it sort of worked, the drone increased it’s height but then becomes unstable and crashes… so obviously I’m missing something here…

```auto
 rostopic pub -r 10 /mavros/setpoint_velocity/cmd_vel geometry_msgs/TwistStamped '{stamp: now, frame_id: fcu}' '[[0, 0, 2.0],[0.0, 0.0, 0]]'

```

Am I barking up the wrong tree trying to control PX4 with cmd\_vel topics?

I see from other examples /mavros/setpoint\_position/local is used, can this be used with ROS navigation tools? Can anyone share an example or pointers?

I’m climbing up the learning curve with ROS so any info helpful.

Thanks  
Eduardo

---

<div class="post-metadata">

**Author:** ![khancyr](https://discuss.px4.io/user_avatar/discuss.px4.io/khancyr/32/3513_2.png) [@khancyr](https://discuss.px4.io/u/khancyr)\
**Post date:** [May 2, 2017, 1:27pm UTC](https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185/2 "2017-05-02T13:27:57Z")

</div>

Hello,

If you can compile the lastest mavros you will have a new listener on /mavros/setpoint\_velocity/cmd\_vel\_unstamped that take cmd\_vel as Twist msg !

---

<div class="post-metadata">

**Author:** ![ealdaz](https://discuss.px4.io/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@ealdaz](https://discuss.px4.io/u/ealdaz)\
**Post date:** [May 2, 2017, 2:10pm UTC](https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185/3 "2017-05-02T14:10:51Z")

</div>

Sounds great, I’ll give it a go.

Do you think I can expect to be able to control the multicopter (in simulation) with cmd\_vel then ? Ie will I be able to command a given speed and angular rotation without the MC loosing stability? Have you tried it yourself per chance?

Is there anything I need to do apart from taking off and setting the MC in OFFBOARD mode ?

Thanks!

---

<div class="post-metadata">

**Author:** ![khancyr](https://discuss.px4.io/user_avatar/discuss.px4.io/khancyr/32/3513_2.png) [@khancyr](https://discuss.px4.io/u/khancyr)\
**Post date:** [May 2, 2017, 2:46pm UTC](https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185/4 "2017-05-02T14:46:00Z")

</div>

I am sorry, I don’t use PX4 … On ardupilot side, it works on copter and rover. I assume that PX4 also accept setpoint\_velocity so it should work.

---

<div class="post-metadata">

**Author:** ![ealdaz](https://discuss.px4.io/letter_avatar_proxy/v4/letter/e/9dc877/32.png) [@ealdaz](https://discuss.px4.io/u/ealdaz)\
**Post date:** [May 2, 2017, 3:08pm UTC](https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185/5 "2017-05-02T15:08:05Z")

</div>

Ah, I see.  
Well I have an Ardupilot rover myself, so maybe I could try that, at least it will help me clarify some concepts.

So when you use /mavros/setpoint\_velocity/cmd\_vel are you successfully controlling both the linear and angular velocities then?

And cmd\_vel topics referenced to the map or to the rover body itself?  
ie is x East or Straight ahead ?

If you used the Stamped message, what do you specify as frame\_id ?

Thanks

---

<div class="post-metadata">

**Author:** ![kumar12](https://discuss.px4.io/letter_avatar_proxy/v4/letter/k/8dc957/32.png) [@kumar12](https://discuss.px4.io/u/kumar12)\
**Post date:** [October 29, 2017, 6:48am UTC](https://discuss.px4.io/t/px4-control-with-move-base-ros-is-this-possible/3185/6 "2017-10-29T06:48:21Z")

</div>

Hey Eduardo,

I am trying to implement something similar to yours, did you manage to link the cmd\_vel from ROS to setpoint\_velocity/cmd\_vel? If so can you teach me how to do the same?

I am having some difficulties/doubts in making it work as I am new to ROS, so I could use some help while I am still getting the hang of it.

Thanks
