ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

navigation stack launch file questions

asked 2020-11-25 00:18:27 -0500

Eman.m gravatar image

updated 2020-11-25 19:23:49 -0500

Hi I implemented a new global planner. It works perfectly as a C++ program.

I am using Ubuntu 18.04 and ROS melodic installed in a partition of macBookPro

Now, I want to integrate the planner in ROS Navigation Stack and use pre-build maps. I want to use simulated ROSbot2(I am not going to use the hardware) from Husarion. I followed and tried to integrate the following tutorials:



**My workspace is: ~/ros_workspace

It contains the following packages:**

1- myNewGlobalPlanner
2- rosbot_description
3- rosbot_ekf
4- rplidar_ros

My map and the yaml file are stored in:


The content of yaml file:

image: gridMap8by8.pgm
resolution: 0.1
origin: [0.0, 0.0, 0.0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0

This is my .pgm map

The launch file for the Navigation Stack is stored in:


The content of the this file is as below:

    <arg name="use_rosbot" default="true"/>
    <arg name="use_gazebo" default="false"/>

    <include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/maze_world.launch"/>

    <include if="$(arg use_gazebo)" file="$(find rosbot_gazebo)/launch/rosbot.launch"/>

    <param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>

    <!-- <node if="$(arg use_rosbot)" pkg="rplidar_ros" type="rplidarNode" name="rplidar"> -->
        <!-- <param name="angle_compensate" type="bool" value="true"/> -->
        <!-- <param name="serial_baudrate" type="int" value="115200"/> -->  <!-- model A2 (ROSbot 2.0) -->
        <!-- <param name="serial_baudrate" type="int" value="256000"/> --> <!-- model A3 (ROSbot 2.0 PRO) -->
    <!-- </node> -->

     <!--- rviz -->
    <node pkg="rviz" type="rviz" name="rviz"/>
    <!-- Bring the ROSbot model to rviz -->
    <include file="$(find rosbot_description)/launch/rosbot.launch"/>
    <!-- ROSbot 2.0 ekf -->
    <include if="$(arg use_rosbot)" file="$(find rosbot_ekf)/launch/all.launch"/>
    <!--- tf -->
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0 0 0 3.14 0 0 base_link laser 100" />
     <!--- Run AMCL --> 
    <include file="$(find amcl)/examples/amcl_diff.launch" />
    <!-- Map server -->
    <arg name="map_file" default="$(find rosbot_navigation)/maps/gridMap8by8.yaml"/>
    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
    <!-- Move base -->
    <node pkg="move_base" type="move_base" name="move_base" output="screen">
        <param name="controller_frequency" value="10.0"/>
        <param name="base_global_planner" value="my_new_global_planner/MyNewGlobalPlannerROS"/>


The commands:

$ catkin_make

$ source devel/setup.bash

are ok and do not give errors


$ roslaunch rosbot_navigation move_rosbot_newPlannerAlgorithm.launch

At start, it works normally But then, it gives errors

My Questions are:

*Why this error " Error opening serial: Could not configure port: (5, 'Input/output error') " occurs?

*Can I display or bring ... (more)

edit retag flag offensive close merge delete


Please don't post links to image hosters, especially for terminal output. The image will eventually go away and the Question will not help any other people with similar problems.

Please edit your question with a plain c'n'p of the relevant parts (and format them as code with the preformatted text button with the 010101 on it)

mgruhler gravatar image mgruhler  ( 2020-11-25 01:59:18 -0500 )edit

It also helps to create separate posts for separate questions. So many questions at once can make it difficult to sort through the information and deter people from trying to help.

tryan gravatar image tryan  ( 2020-11-25 07:46:34 -0500 )edit

Thanks mgruhler. I used the button 010101 already, I wonder why it was not working. However, I edited the post above again. What do you mean by "plain c'n'p ". English is not my native language, so excuse me, I don't understand some abbreviations. Regarding the images, yes, you are right, but I don't have enough points to post images here.

Eman.m gravatar image Eman.m  ( 2020-11-25 18:49:36 -0500 )edit

Thanks tryan. All the question are related to the navigation stack launch file. I understand your point. I was afraid that posting the same file might be considered as repetition, then it will be closed.

Eman.m gravatar image Eman.m  ( 2020-11-25 18:52:08 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-11-25 09:07:49 -0500

tryan gravatar image

It is unclear whether you are using the robot hardware or simulation as you state "I want to use simulated ROSbot2," but you set use_gazebo to false and get port errors. In simulation, your port connection problems won't apply when you get things straightened out.

In any case, I recommend you go through all of the Husarion tutorials before trying to do all of this at once. Get the basics working, then build on that. I'll try to briefly answer your questions, though.

*Why this error " Error opening serial: Could not configure port: (5, 'Input/output error') " occurs?

The error indicates that the serial_node had trouble with the specified port (/dev/ttyS1). Again, do you have hardware connected? Are you sure that's the correct port? If so, it will require more in-depth troubleshooting that is more appropriate for a separate post.

*Can I display or bring ROSbot model to rviz?

Yes. As an example, ROSbot has a file called rosbot_rviz.launch here that does just that. Try running

roslaunch rosbot_description rosbot_rviz.launch

*Why Gazebo started while it is set false in the launch file?

It turns out you have nested launch files (see the include tags), where one of the nested files calls Gazebo anyway. I believe the offending line is here:

<!-- Bring the ROSbot model to rviz -->
<include file="$(find rosbot_description)/launch/rosbot.launch"/>

The rosbot.launch file contains this reference to a launch file that starts Gazebo:

<include file="$(find rosbot_description)/launch/rosbot_gazebo.launch"></include>

*Are the launch file correct? Do I missed packages?

As indicated above the launch files are not "correct" in that there are multiple layers of nested files that conflict with each other to produce undesired behavior. I don't see an indication of missing packages, though.

Regarding the map, could you please check it?

I don't know what you want the map to look like, so I can't really comment on the image. The YAML file indicates a resolution of 0.1 m, so your 8x8 map covers an area less than a square meter. I doubt that will be very useful, but that's up to you.

*Do I need rplidar package?

You only need that package for running the lidar hardware. The lidar hardware is necessary if you want to map or navigate with the actual robot. In simulation with Gazebo, the lidar data would be produced by a ray sensor plugin, but that's already taken care of in the ROSbot package.

edit flag offensive delete link more


Many thanks tryan for your help. I will follow your recommendation and start with basics.

I will not use the hardware. So do you mean that I should not have port errors?

The map represents a grid 8*8, white squares(free), black squares(obstacle). The maps that I want to use are grid maps of squares. Resolution 0.1 meter/pixel. My map is 8 pixel * 8 pixel. Each pixel is either white or black.

so, 0.1*8 = 0.8 => the map is 0.8 meter height and 0.8 meter width, Am I right?

Eman.m gravatar image Eman.m  ( 2020-11-25 19:22:04 -0500 )edit

The port errors come from trying to connect with actual hardware. If you are only using simulation, there shouldn't be any nodes connecting to hardware, so such errors shouldn't occur.

You are correct about the map. As long as it reflects the environment you desire, it's fine.

tryan gravatar image tryan  ( 2020-11-29 11:36:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-11-25 00:18:27 -0500

Seen: 200 times

Last updated: Nov 25 '20