Robotics StackExchange | Archived questions

Confusion when Creating a Robot Configuration Launch File for my specific robot

I am working through the following Navigation Tutorials on ROS.org (link below)

http://wiki.ros.org/navigation/Tutorials/RobotSetup

I am using Ubuntu16.04LTS & ROS Kinetic.

My robot is the Turtlebot3 Waffle Pi that is equipped with a 2D LDS and a raspberry pi camera (link below to waffle pi specs):

https://emanual.robotis.com/docs/en/platform/turtlebot3/specifications/

In section 2.2 on the ROS navigation tutorial I am slightly confused. I have created the myrobotconfiguration.launch file and have pasted in the below text as advised on the tutorial.

   <launch>

       <node pkg="sensor_node_pkg" type="sensor_node_type" name="sensor_node_name" output="screen">

        <param name="sensor_param" value="param_value" />

     </node>

     <node pkg="odom_node_pkg" type="odom_node_type" name="odom_node" output="screen">

        <param name="odom_param" value="param_value" />

     </node>

     <node pkg="transform_configuration_pkg" type="transform_configuration_type" name="transform_configuration_name" output="screen">

        <param name="transform_configuration_param" value="param_value" />

 </node>

</launch> 

I then need to edit the above text to suit my robot and the sensors etc.

So I first need to:

  1. Replace "sensornodepkg" with the name of the package for the ROS driver for my sensor

  2. Replace "sensornodetype" with the type of the driver for my sensor

  3. Replace "sensornodename" with the desired name for my sensor node

  4. And finally replace "sensor_param" with any parameters that my node might take

The 2D LDS that is equipped with my robot is the hlslfcdlds_driver (see link below):

http://wiki.ros.org/hls_lfcd_lds_driver

I had carried out some tutorials for the turtlebot3 on the robotis page so I should have this information in the turtlebot3 launch files?

For points 1 to 4 above I found the Turtlebot3_lidar.launch file and have pasted that text into my new text file as below:

<launch>

   <node pkg="hls_lfcd_lds_driver" type="hlds_laser_publisher" name="turtlebot3_lds" output="screen">
    <param name="port" value="/dev/ttyUSB0" />
<param name="frame_id" value="$(arg set_frame_id)"/>
 </node>

However, I am very confused and unsure where to find similar information for the odometry packages and the transform configuration packages.

Where should this be found?

Sorry if this message is too long, I wanted to be as specific as I could.

Asked by jimc91 on 2020-07-14 11:12:44 UTC

Comments

I don't have a turtlebot but I do have google. Your ODOM is being published by turtlebot3_core so if you launch using the documentation provided with the robot it will taken care of. If you just want to learn, you can use the launch files provided with the robot to get an understanding of how they work.

Asked by billy on 2020-07-16 18:33:03 UTC

@jimC91 Where you able to figure everything out? I'm having struggles with this as well.

Asked by distro on 2021-07-06 15:19:09 UTC

Answers

Hi @jimc91

I am going to answer your question but I am sure there are community members here that do know more than me about this particular topic, but I will try, so here we go:

  1. The sensor_node_typeis refering to all your sensor drivers that you need to produce sensors readings. For your particular set up, a Lidar and a Camera.
  2. The sensor_node_type is refering to the ROS wrappers that use the sensor readings and convert them into ROS usable msgs.
  3. The sensor_node_name is self explanatory and refers to a unique name to identify each used sensor.
  4. An finally the sensor_param refers to all those needed params for your sensor configuration, that you may find in your sensors official repository, or even in already made ROS wrappers for those sensors. Since you have a camera you will also need to determine intrinsic and extrinsic calibration parameters.

Then you have the odom_node_pkg refering to any package or utility able to provide any sort of odometry information. You have multiple approach for this.

  1. You can produce your own odometry estimation from your robot velocity.
  2. You can use probabilistic localization if you have a map with AMCL.
  3. You can use Kalman filters to produce accurate odometry output with robot_lozalization.
  4. There are more ways to produce odometry but I just mentioned the ones that I mos familiarize with. Of course since you have a camera you can also take advantage of Visual Odometry paradigm, but I cannot say too much about this topic.

Finally the transform_configuration_pkg is refering to having a proper tf_tree to relate any robot frame that you may have. If you have any doubts of tfs and frames you can check this. The usual (and standard tf tree) is needed to know the relation between points in space in any robot frame in which you can work. So, as a basic mobile robot you will have something like:

World --> Map --> Odom --> Base_footprint --> Base_link --> wheels, sensors, ...

And this is used to operate properly in the frame in which you are navigating with your robot. For the Base_footprint onward the tfs use to be static, so they can be loaded with the robot_description, however the rest are not static and are usually produced by your odometry/localization nodes. For instance, AMCL is able to produce a transformation between map and odom allowing you to localize in the map frame, the robot_localization can be configured to produce several transformation as well, even your own odometry node can have a transform broadcaster to produce the Base_footprint --> Odom transform.

So to sum up, you will need sensor drivers to produce proper readings, ROS wrappers to use the sensors with ROS utilities, a good source of odometry information and a proper tf tree to be able to localize yourself in the enviroment.

Hope that can help you understanding this things. If anyone is willing to add more information about this I will glad to discuss it here.

Regards.

Asked by Weasfas on 2020-07-15 07:00:00 UTC

Comments

Hi @Weasfas, I don't even know where to go search for in my computer files to search for stuff in the navigation stack. I don't know where to find the Turtlebot3_lidar.launch file. Where do I find such things?

Asked by distro on 2021-07-06 14:37:32 UTC

Hi @distro, the ros navigation stack is provided by the installation of ROS as a binary package ready to be installed with apt. The turtlebot launcher you mentioned can be found here as a file of the turtlebot metapackage that constains all solutions developed by the turtlubot team.

Asked by Weasfas on 2021-07-06 14:50:36 UTC

@Weasfas Im kinda confused, I just type in '''apt-get install''' what exactly? I already have ros installed.

Asked by distro on 2021-07-06 15:18:12 UTC

@Weasfas : Could you please give an example how exactly to edit the launch file? What do I replace "odom_node_pkg" with, or what replace "transform_configuration_pkg". Sorry I am new to ROS.

Asked by distro on 2021-07-06 23:44:28 UTC

@distro as said in my answer the odom_node_pkg is whatever package(s) you have, implemented by you or obtained from any free source code, that provides a sort of Odometry information to tell where is your robot in a known frame (for instance Odom). Here is a good wiki section explaining what is an Odometry msg and how to set up your robot. Here is another resource in the case you do not now what is a tf link text. So, what you want to achieve is a set up for navigation, that comprehend first a good tf tree in which every robot frame is properly set up, allowing you to check every link of your robot (transform_configuration_pkg) and then a good odometry source that tells you where is your robot in your navigation frame (E.g.: Map) (odom_node_pkg) Hope this help. However, you may want to ask a question in this forum instead of commenting and old question.

Asked by Weasfas on 2021-07-07 04:22:32 UTC

@Weasfas I try asking my own questions but people don't respond. I will keep trying though. So for example: "odom_node_pkg=navs_msgs.msg" "odom_node_type=Odometry" "name= the name of the node at the ros_init"? Is this correct? If so I am not sure what to place for "odom_param"

Also for "transform_configuration_pkg", I think the package "move_base" which I am using already takes care of transformation of my frame_id of my lidar sensor and my base link, so do I still need to declare these things? for example transform_configuration_pkg=move_base_msgs.msg"?

Also, if I understand correctly, if I make different executable python codes that have the nodes I am declaring in the launch file, and I roslaunch the launch file, I'm guessing all those executable python codes will run at the same time? Do I need to connect any of those codes in some way? For instance, do I import each code into the other?

Asked by distro on 2021-07-07 12:25:29 UTC

  1. odom_node_pkg is a package that provides you with nav_msgs/Odometry and base_link or base_footprint --> Odom transform.
  2. Move base does only produce cmd_vel commands to move the platform. In fact if you take a look at the wiki diagram, the package tells that it needs your tf tree and your odom msg for localization. Hence you will need to provide a proper tf tree. You can do that with Xacro and URDF or launching the turtlebot description (run rosrun rqt_tf_tree rqt_tf_tree to se yor tf tree with the robot launched).
  3. ROS is a middlewware itprovides a communication standar between modules and basic utilities. If you have implemented two nodes you will need to conect both, commonly done with Publisher-Subscriber paradigm.

Asked by Weasfas on 2021-07-07 15:37:55 UTC

But I feel like you may need to start from the barebones of what is ROS and how to use ROS by learning and reading the wiki and tutorials sections.

Asked by Weasfas on 2021-07-07 15:38:50 UTC

@Weasfas Sorry,I don't think you understood my question about the codes, I already know about publishers and subscribers, that wasn't what was talking about. I probably didn't explain that part well. I use move base and it already takes care of all of my localization problems(move_base_simple/goal along with the static map I have already created through SLAM), I've tested it, my algorithm moves the robot where I want it to go. The critical part of the question I'm asking is the "odom_node_pkg", is this ("odom_node_pkg") the name of an actual package? The tutorial I'm using says to replace it with those relevant to the node I am launching. This is the tutorial I am using from the wiki: http://wiki.ros.org/navigation/Tutorials/RobotSetup

That's why I asked, if you could show me some example. DO I need to replace it with something line nav_msgs.msg(this is a package correct?) please take a look at the link to see what I'm talking about.

Asked by distro on 2021-07-07 20:39:15 UTC

Yes it is the name of an actual package or a combination of several ones that provides odometry information. One possibility is to localize yourself with the wheel odometry in the odom frame, use georeferenciated positioning with a GPS sensor, performing visual SLAM, etc. There are a lot of solutions to accomplish that, choosing one or another depends on you robot, your knowledge and resources or your specific approach to cope with the problem. One good solution is having several odometry souces that you can filter with a Kalmann filter to produce a kind of filtered odometry that is likely more accurate. Hence you will need to replace that with you customn specific odometry package(s) that provides that information in both tf messages and nav msgs. On the other hand, since you have a static map, you can use AMCL package with you laserscans to localize the robot in the map frame producing the Map --> Odom tf.

Asked by Weasfas on 2021-07-08 06:12:22 UTC

I think turtlebot navigation package is a good point to start.

Asked by Weasfas on 2021-07-08 06:12:59 UTC

There are already ready-to-run ros packages for a turtlebot3. Have you looked at wiki page http://wiki.ros.org/turtlebot3_bringup ? In particular, the manual in Section 1.

You should study the content of these files and get some ros experience before you try to customize things. The following apt package will install all needed files into /opt/ros. See the corresponding wiki pages for more info.

ros-kinetic-turtlebot3

This installs:

ros-kinetic-turtlebot3-bringup
ros-kinetic-turtlebot3-description
ros-kinetic-turtlebot3-example
ros-kinetic-turtlebot3-navigation
ros-kinetic-turtlebot3-teleop

So far I have assumed you have a real turtlebot3. If instead you want to simulate a turtlebot3, there are additional apt packages to give support for that.

Asked by Mike Scheutzow on 2021-09-06 13:17:13 UTC

Comments

@Mike Scheutzow For clarification, I have a real turtlebot3 robot and I am also messing around with a simulated turtlebot3 as well. I already have some months experience with ros and I already have the turtlebot3_Navigation package, I know exactly what yaml file I should be changing for what I want. It just doesn't do anything when I edit that specific file. This is my only problem, for some reason changing the inflation radius does absolutely nothing and I just want to know the reasons why something like that could happen.

Again, I have the Turtlebot3_Navigation package in my directory catkin_ws/src. I know I go to "Turtlebot3_navigation/param/costmap_common_params_burger.yaml" I know this is where I will find the inflation radius, when I edit said inflation radius, nothing happens, it doesnt work. I am looking for reasons why it doesnt work and how to fix it. Hope this is clear.

Asked by distro on 2021-09-09 01:58:31 UTC

This question does not appear to be about inflation radius. Please open a new question if you want to switch topics.

Asked by Mike Scheutzow on 2021-09-09 06:33:38 UTC