How does move_base publish to cmd_vel?
Hi,
I was wondering if someone out there can give me some clarification on the move_base.launch.
To explain what I am doing, I have a robot car using RPLidar and Hector SLAM with no Odometry. I am able to control my robot using the teleop_twist_keyboard node and have it drive around and create a map. Now I am trying to have it be autonomous and I heard that using move_base is a method to do this.
I have created costmap_common_params.yaml, global_costmap_params.yaml, local_costmap_params.yaml, and base_local_planner_params.yaml and my own move_base.launch file following this tutorial: http://wiki.ros.org/navigation/Tutori...
However, I do not understand how this will publish to the cmd_vel topic. I do not see anywhere on the tutorial where it publishes.
Can anyone give me some clarification?
Thanks in advance!
Did you go over the wiki and the documentation therein, especially http://wiki.ros.org/move_base? There, it is pretty evident, where the publishing happens.
Hi mgruhler!
Thank you for your reply.
Yes, I have seen that documentation but I am still a bit confused. You see, I am new to ROS and I learned from the tutorial (http://wiki.ros.org/ROS/Tutorials/Wri...) that to create a publisher node you need a code something like this:
So I guess why I am confused about is that I do not see this line of code anywhere for move_base. Which makes me wonder how does it publish to cmd_vel?
Well, I guess you didn't look at the source code? The publisher is created here
Note that
move_base
is quite a complex piece of software, so if you are new to ROS and, maybe, not very experienced in programming, this might be hard to step through bit by bit. The tutorial you link in your question only shows how to configure the various pieces that make up a fully working navigation setup...Oh, thank you so much for sending me the source code!
Yes, I do agree that this is a difficult task for a newcomer like me.
I have looked at how other people autonomously navigate their robot and I kept seeing them run 3 things: 1. RPLidar, 2. Hector slam launch file, and 3. move_base launch file. And from there, they would use the 2D Pose Estimate button to identify the initial position of the robot and then use the 2D Nav Goal on Rviz and their robot would start moving. I guess I misunderstood how they did their coding and didn't realize they had another code that is also called move_base that is not the launch file.
Thank you for the clarification!
Well, yes. A launch file is not "code" in itself (well, it is XML, but anyways...). A launch file is used to easily configure and run nodes, whether they have been programmed with C++, Python or any other ROS supported language (in the end, it just launches executables, so you could launch any executable file, like e.g. shell scripts). This should be the main take away here. A launch file can also launch multiple nodes.