Navigation problem: Rosbot2 does not move

Hi

I am doing an experiment in different map size: 8X8, 16X16, 32X32 and 64X64, 128X128, and 256X256. The maps are simply white(free) squares and black (obstacle) squares which are randomly generated. Also, start and goal are randomly chosen. The maps are generated, then used in ROS.

That’s why I am not using other maps. I need simple map(grids) of black and white squares for experimental purposes in order to compare different planners. Moreover, these kind of maps are useful for beginners in robotics and ROS.

I have chosen simulated robot Rosbot2.0 to do this experiment. I wrote the launch file for the navigation stack with all required yaml files. However, the robot does not move.

This is how the map looks like in Rviz. The resolution is 1. The blue circle is the goal pose.
2

Here is my launch file: rosbot_navigation_move_rosbot.launch

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

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

     <!-- Bring the ROSbot model and show it in Gazebo and in Rviz  -->
     <include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>
    <!-- NOTE: rosbot_rviz.launch includes: "$(find rosbot_description)/launch/rosbot.launch" which lanuches Gazebo -->

    <!-- 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)" />

    <!--- tf -->
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="base_link_to_laser" args="0 0 0 3.14 0 0 base_link laser 100" />
    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -x 1.5 -y 3.5 -z 0.0 -model rosbot" />
    
    <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />
    </node>

     <!--- Localization: Run AMCL -->
    <node pkg="amcl" type="amcl" name="amcl" output="screen">
        <remap from="scan" to="/scan"/>
        <param name="odom_frame_id" value="odom"/>
        <!-- <param name="odom_model_type" value="diff-corrected"/> --> 
        <param name="odom_model_type" value="diff"/>
        <param name="base_frame_id" value="base_link"/>
        <param name="update_min_d" value="0.05"/>
        <param name="update_min_a" value="0.1"/>
        <param name="min_particles" value="500"/>
        <param name="max_particles" value="10000"/>
        <param name="initial_pose_x" value="1.5"/>
        <param name="initial_pose_y" value="3.5"/>
    </node>
    
    <!-- Move base -->
    <node pkg="move_base" type="move_base" name="move_base" output="screen">
        <param name="controller_frequency" value="0.5"/>
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/trajectory_planner.yaml" command="load" />
    </node>

</launch>

These are the yaml files:

costmap_common_params.yaml

obstacle_range: 6.0
raytrace_range: 8.5
footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
map_topic: /map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_frame: map 
robot_base_frame: base_link 
always_send_full_costmap: true

global_costmap_params.yaml

global_costmap:
  global_frame: map
  update_frequency: 0.5 
  publish_frequency: 1.5
  transform_tolerance: 1.0 
  width: 8
  height: 8
  origin_x: 0
  origin_y: 0
  static_map: true
  rolling_window: false 
  inflation_radius: 0.0 
  cost_scaling_factor: 10.0 
  resolution: 1

local_costmap_params.yaml

local_costmap:
  global_frame: map 
  update_frequency: 2.5 
  publish_frequency: 2.5 
  transform_tolerance: 1.0 
  static_map: false 
  rolling_window: true
  width: 3 
  height: 3
  origin_x: 0
  origin_y: 0
  resolution: 1
  inflation_radius: 0.0 
  cost_scaling_factor: 10.0

trajectory_planner.yaml

TrajectoryPlannerROS:
 max_vel_x: 0.1
 min_vel_x: 0.05
 max_vel_theta: 2.5
 min_vel_theta: -2.5
 min_in_place_vel_theta: 0.5
 acc_lim_theta: 1.0
 acc_lim_x: 1.5
 acc_lim_Y: 1.5
 holonomic_robot: false

 xy_goal_tolerance: 3.0 
 yaw_goal_tolerance: 8.0 

 vx_samples: 6 
 vtheta_samples: 20
 controller_frequency: 0.5 

 meter_scoring: true 
 occdist_scale:  0.01
 pdist_scale: 0.4
 gdist_scale: 0.2
 

 path_distance_bias: 0.4
 goal_distance_bias: 0.2

# dwa: true

The map pgm and yaml files:
.pgm files are not allowed for upload, so here it is: https://www.mediafire.com/file/iqyjr9go2amkkbv/gridMap8by8.pgm/file

gridMap8by8.yaml

image: gridMap8by8.pgm
resolution: 1
origin: [0,0,0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0
width: 8
height: 8 

In the terminal I run:
rosbot_navigation_move_rosbot.launch
I got:
[ INFO] [1608712815.531061064, 8.520000000]: odom received!

Then in another terminal, I send the goal:
rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped ‘{header: {stamp: now, frame_id: “map”}, pose: {position: {x: 6.5, y: 3.5, z: 0.0}, orientation: {w: 1.0}}}’
I got:
publishing and latching message. Press ctrl-C to terminate
Then, I run:
rostopic list
/cmd_vel is listed
rostopic echo /cmd_vel
I got:
WARNING: no messages received and simulated time is active.
Is /clock being published?

In Rviz:
The robot does not move, and a blue line appears( inside the red ellipse).


I have chosen a goal that is in front of the start pose so I can make sure every thing is correct so I can experiment with other goal pose.

I appreciate your help in making the rosbot move so I can complete my experiment.
Regards,

Hello Eman,

There is a major issue that I can find in the approach. When you include rosbot_rviz.launch file in:

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

The default simulation world has its own obstacles which are different than your map. Trajectory planner takes into account both map and environment observations from laser scanner. When map and obstacles are much different, the planner behavior will be undefined.
Furthermore, the AMCL is determining localization by matching observations of simulated world to provided map, this will also fail when map is greatly different form environment.

There are two solutions you could use:

  1. Create simulation world that resemble your map. This will be most accurate solution, but also will take a lot of time to create world.
  2. Use empty world and skip environment obstacles checks. This solution will be definitely faster, but will not test localization features and will be prone to planner failures as ROSbot will not hit an obstacle even if it drives onto occupied areas.

Could you provide more details on your experiment? I am asking for details to estimate if above solutions fit into your project.

Last thing, the blue line in the last screen is a trajectory proposed by planner. Due to the issues above, most probably this trajectory will be invalid at this moment.

Regards,
Łukasz

Thanks Łukasz.

I implemented a simulator in C++ to simulate the execution of different path planning algorithm: A*, Dijkstra,…etc
the user choose the parameters from drop-down menus:
choose the environment size: 8X8, 16X16,… up to 256X256
then click a button to randomly assign start, goal, and obstacles.
Then click a button (A*), or any other algorithm to execute it.
simulator
Here red square (start), green (goal), black (obsatcles), and blue is the path generated by A*.
I used a script to convert 2d array of 0s(free) and 100s(obstacle) to a .pgm map of balck and white squares.
Then, I used this map in ROS to navigate a robot from start pose to goal pose while avoiding the black squares(obstacles).

I think that you could try approach with skipping the environment obstacles check.

The trajectory planner will determine path based only on map data and will drive avoiding the obstacles defined on map regardless if they exist in environment.

To do this you will need to edit two launch files.
First is rosbot_gazebo/launch/rosbot_world.launch, comment or delete line with turtlebot_playground.world, this will cause Gazebo to load empty world with no obstacles nor any other objects.

<?xml version="1.0" encoding="UTF-8"?>
<launch>

  <arg name="world" default="empty"/>
  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <!-- <arg name="world_name" value="$(find rosbot_gazebo)/worlds/turtlebot_playground.world"/> -->
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="gui" value="$(arg gui)"/>
    <arg name="headless" value="$(arg headless)"/>
    <arg name="debug" value="$(arg debug)"/>
  </include>

</launch>

Second is rosbot_navigation_move_rosbot.launch. Changes include removing AMCL and adding a static tf transform from map to odom:

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

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

     <!-- Bring the ROSbot model and show it in Gazebo and in Rviz  -->
     <include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>
    <!-- NOTE: rosbot_rviz.launch includes: "$(find rosbot_description)/launch/rosbot.launch" which lanuches Gazebo -->

    <!-- 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)" />

    <!--- tf -->
    <node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="base_link_to_laser" args="0 0 0 3.14 0 0 base_link laser 100" />
    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -x 1.5 -y 3.5 -z 0.0 -model rosbot" />
    
    <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
    <param name="publish_frequency" type="double" value="30.0" />
    </node>

    <node unless="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="map_odom_tf" args="0 0 0 0 0 0 map odom 100" />
    
    <!-- Move base -->
    <node pkg="move_base" type="move_base" name="move_base" output="screen">
        <param name="controller_frequency" value="0.5"/>
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/trajectory_planner.yaml" command="load" />
    </node>

</launch>

This will cause ROSbot not to use any localization method and use position directly from Gazebo.

With these changes you will be able to drive ROSbot on your custom defined map.

Regards,
Łukasz

Thanks Lukasz
I made the edits you suggested. This is what I got:

In Terminal:

In Rviz:

Gazebo:

Gazebo world has loaded with obstacles, thus I conclude that rosbot_world.launch has not been edited.
Please double check that you have edited correct file and it loads without any obstacles. In Gazebo window you should see only floor with grid marked on it.

This is the file that I edited. The file name and the path to this file is in the window bar.

Could you then paste here full log? This means all output that gets after you type roslaunch ...

Done checking log file disk usage. Usage is <1GB.

xacro.py is deprecated; please use xacro instead
xacro.py is deprecated; please use xacro instead
started roslaunch server http://eman-MacBookPro:33391/

SUMMARY

PARAMETERS

  • /gazebo/enable_ros_network: True
  • /joint_state_controller/publish_rate: 50
  • /joint_state_controller/type: joint_state_contr…
  • /joint_state_publisher/publish_frequency: 30.0
  • /move_base/TrajectoryPlannerROS/acc_lim_Y: 1.5
  • /move_base/TrajectoryPlannerROS/acc_lim_theta: 1.0
  • /move_base/TrajectoryPlannerROS/acc_lim_x: 1.5
  • /move_base/TrajectoryPlannerROS/controller_frequency: 0.5
  • /move_base/TrajectoryPlannerROS/gdist_scale: 0.2
  • /move_base/TrajectoryPlannerROS/goal_distance_bias: 0.2
  • /move_base/TrajectoryPlannerROS/holonomic_robot: False
  • /move_base/TrajectoryPlannerROS/max_vel_theta: 2.5
  • /move_base/TrajectoryPlannerROS/max_vel_x: 0.1
  • /move_base/TrajectoryPlannerROS/meter_scoring: True
  • /move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.5
  • /move_base/TrajectoryPlannerROS/min_vel_theta: -2.5
  • /move_base/TrajectoryPlannerROS/min_vel_x: 0.05
  • /move_base/TrajectoryPlannerROS/occdist_scale: 0.01
  • /move_base/TrajectoryPlannerROS/path_distance_bias: 0.4
  • /move_base/TrajectoryPlannerROS/pdist_scale: 0.4
  • /move_base/TrajectoryPlannerROS/vtheta_samples: 20
  • /move_base/TrajectoryPlannerROS/vx_samples: 6
  • /move_base/TrajectoryPlannerROS/xy_goal_tolerance: 3.0
  • /move_base/TrajectoryPlannerROS/yaw_goal_tolerance: 8.0
  • /move_base/controller_frequency: 0.5
  • /move_base/global_costmap/always_send_full_costmap: True
  • /move_base/global_costmap/cost_scaling_factor: 10.0
  • /move_base/global_costmap/footprint: [[0.12, 0.14], [0…
  • /move_base/global_costmap/global_frame: map
  • /move_base/global_costmap/height: 8
  • /move_base/global_costmap/inflation_radius: 0.0
  • /move_base/global_costmap/laser_scan_sensor/clearing: True
  • /move_base/global_costmap/laser_scan_sensor/data_type: LaserScan
  • /move_base/global_costmap/laser_scan_sensor/marking: True
  • /move_base/global_costmap/laser_scan_sensor/sensor_frame: laser
  • /move_base/global_costmap/laser_scan_sensor/topic: scan
  • /move_base/global_costmap/map_topic: /map
  • /move_base/global_costmap/observation_sources: laser_scan_sensor
  • /move_base/global_costmap/obstacle_range: 6.0
  • /move_base/global_costmap/origin_x: 0
  • /move_base/global_costmap/origin_y: 0
  • /move_base/global_costmap/publish_frequency: 1.5
  • /move_base/global_costmap/raytrace_range: 8.5
  • /move_base/global_costmap/resolution: 1
  • /move_base/global_costmap/robot_base_frame: base_link
  • /move_base/global_costmap/rolling_window: False
  • /move_base/global_costmap/static_map: True
  • /move_base/global_costmap/subscribe_to_updates: True
  • /move_base/global_costmap/transform_tolerance: 1.0
  • /move_base/global_costmap/update_frequency: 0.5
  • /move_base/global_costmap/width: 8
  • /move_base/local_costmap/always_send_full_costmap: True
  • /move_base/local_costmap/cost_scaling_factor: 10.0
  • /move_base/local_costmap/footprint: [[0.12, 0.14], [0…
  • /move_base/local_costmap/global_frame: map
  • /move_base/local_costmap/height: 3
  • /move_base/local_costmap/inflation_radius: 0.0
  • /move_base/local_costmap/laser_scan_sensor/clearing: True
  • /move_base/local_costmap/laser_scan_sensor/data_type: LaserScan
  • /move_base/local_costmap/laser_scan_sensor/marking: True
  • /move_base/local_costmap/laser_scan_sensor/sensor_frame: laser
  • /move_base/local_costmap/laser_scan_sensor/topic: scan
  • /move_base/local_costmap/map_topic: /map
  • /move_base/local_costmap/observation_sources: laser_scan_sensor
  • /move_base/local_costmap/obstacle_range: 6.0
  • /move_base/local_costmap/origin_x: 0
  • /move_base/local_costmap/origin_y: 0
  • /move_base/local_costmap/publish_frequency: 2.5
  • /move_base/local_costmap/raytrace_range: 8.5
  • /move_base/local_costmap/resolution: 1
  • /move_base/local_costmap/robot_base_frame: base_link
  • /move_base/local_costmap/rolling_window: True
  • /move_base/local_costmap/static_map: False
  • /move_base/local_costmap/subscribe_to_updates: True
  • /move_base/local_costmap/transform_tolerance: 1.0
  • /move_base/local_costmap/update_frequency: 2.5
  • /move_base/local_costmap/width: 3
  • /robot_description: <?xml version="1…
  • /rosdistro: melodic
  • /rosversion: 1.14.10
  • /use_sim_time: True

NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
joint_state_controller_spawner (controller_manager/spawner)
joint_state_publisher (joint_state_publisher/joint_state_publisher)
map_odom_tf (tf/static_transform_publisher)
map_server (map_server/map_server)
move_base (move_base/move_base)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
rviz (rviz/rviz)
spawn_urdf (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [11684]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 3bf86446-45df-11eb-8450-e0f84736498c
process[rosout-1]: started with pid [11695]
started core service [/rosout]
process[joint_state_controller_spawner-2]: started with pid [11698]
process[robot_state_publisher-3]: started with pid [11700]
process[gazebo-4]: started with pid [11701]
process[gazebo_gui-5]: started with pid [11705]
process[rviz-6]: started with pid [11711]
process[map_server-7]: started with pid [11718]
process[spawn_urdf-8]: started with pid [11724]
process[joint_state_publisher-9]: started with pid [11725]
process[map_odom_tf-10]: started with pid [11728]
process[move_base-11]: started with pid [11729]
[ WARN] [1608811068.977524287]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.
[INFO] [1608811069.009650, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[gazebo-4] process has died [pid 11701, exit code 255, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/eman/.ros/log/3bf86446-45df-11eb-8450-e0f84736498c/gazebo-4.log].
log file: /home/eman/.ros/log/3bf86446-45df-11eb-8450-e0f84736498c/gazebo-4*.log
[ INFO] [1608811071.825115164]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1608811071.828675148]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting…
[ INFO] [1608811073.128248602]: rviz version 1.13.14
[ INFO] [1608811073.128470245]: compiled against Qt version 5.9.5
[ INFO] [1608811073.128528522]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1608811073.150511706]: Forcing OpenGl version 0.
[ INFO] [1608811074.408132284]: Stereo is NOT SUPPORTED
[ INFO] [1608811074.408238121]: OpenGl version: 3 (GLSL 1.3).
[WARN] [1608811099.229032, 0.000000]: Controller Spawner couldn’t find the expected controller_manager ROS interface.
[joint_state_controller_spawner-2] process has finished cleanly
log file: /home/eman/.ros/log/3bf86446-45df-11eb-8450-e0f84736498c/joint_state_controller_spawner-2*.log

From the line in your log:

started roslaunch server http://eman-MacBookPro:33391/

I conclude that you are working on OS X.
ROS melodic is officially supported on Ubuntu, Debian or Windows.
Could you describe in details hour hardware configuration and how did you install ROS on your machine?

Regards,
Łukasz

I installed ROS on Ubuntu 18.04.5 LTS, which is installed on a partition on Mac OSX.
The partition size is 45 GB.

Mac details:
MacBook Pro, Processor 2.3 GHz Intel Core i5, Memory 4 GB. Hard disk 320 GB

Hello Eman,

Working on native installation of Ubuntu on separate partition is preferred way.

To check where the problem is, we need to start several launch files to test components.

  1. This should open Gazebo window with empty world. No obstacles, no ROSbot spawned.
roslaunch gazebo_ros empty_world.launch
  1. Same as above, this should open Gazebo window with empty world. No obstacles, no ROSbot spawned.
roslaunch rosbot_gazebo rosbot_world.launch
  1. This should open Gazebo window with world containing ROSbot.
roslaunch rosbot_description rosbot.launch

In new terminal paste:

rostopic pub /cmd_vel geometry_msgs/Twist "linear:
  x: 1.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.0"

This will send velocity command to ROSbot, it should drive forward.

  1. Edit rosbot_navigation_move_rosbot.launch to contain only lines as below:
<launch>
    <arg name="use_rosbot" default="false"/>
    <arg name="use_gazebo" default="true"/>
    <param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>
    <include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>
    <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)" />
    <node unless="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="map_odom_tf" args="0 0 0 0 0 0 map odom 100" />    
</launch>

This should open Gazebo window with world containing ROSbot and Rviz window with ROSbot and map visible.
Again in new terminal send the velocity command, you should see as ROSbot moves both in Gazebo and Rviz.

  1. If above checks have passed, add the contents you want in rosbot_navigation_move_rosbot.launch by appending single line, launching the file and verifying if ROSbot moves as expected.

Instead of driving only forward, you could control ROSbot by keyboard.
Install teleop-twist-keyboard node with

sudo apt install ros-melodic-teleop-twist-keyboard

Then run it with:

rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Regards,
Łukasz

Thanks Lukasz. Sorry for being late on relpying, I was working in my thesis, and now I return to ROSbot to complete the section related to it.

The test 1. and 2. worked fine as expected(empty world. No obstacles, no ROSbot spawned). However, test 3. it gives also (empty world. No obstacles, no ROSbot spawned).

This is what I got in the terminal after running 3.

Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro.py is deprecated; please use xacro instead
started roslaunch server http://eman-MacBookPro:35359/

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /joint_state_controller/publish_rate: 50
 * /joint_state_controller/type: joint_state_contr...
 * /robot_description: <?xml version="1....
 * /rosdistro: melodic
 * /rosversion: 1.14.10
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    joint_state_controller_spawner (controller_manager/spawner)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)

auto-starting new master
process[master]: started with pid [28542]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 674aa2d0-5ce1-11eb-9059-e0f84736498c
process[rosout-1]: started with pid [28553]
started core service [/rosout]
process[joint_state_controller_spawner-2]: started with pid [28560]
process[robot_state_publisher-3]: started with pid [28561]
process[gazebo-4]: started with pid [28562]
process[gazebo_gui-5]: started with pid [28567]
[ WARN] [1611340875.423055334]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[INFO] [1611340875.468024, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[ INFO] [1611340875.496339300]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1611340875.498620923]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1611340875.566384139]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1611340875.568816179]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[ INFO] [1611340876.079519597]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1611340876.124629434, 0.030000000]: Physics dynamic reconfigure ready.
[WARN] [1611340905.691235, 29.446000]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[joint_state_controller_spawner-2] process has finished cleanly
log file: /home/eman/.ros/log/674aa2d0-5ce1-11eb-9059-e0f84736498c/joint_state_controller_spawner-2*.log

I found the file rosbot.launch in the path:
rosbot_description/src/rosbot_description/launch/rosbot.launch
it content is:

<?xml version="1.0" encoding="UTF-8"?>
<launch>

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

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

</launch>

When I opened rosbot_gazebo.launch, I found:

<?xml version="1.0" encoding="UTF-8"?>
<launch>
  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam command="load" file="$(find joint_state_controller)/joint_state_controller.yaml" />

  <!-- load the controllers -->
  <node name="joint_state_controller_spawner" pkg="controller_manager" type="spawner" output="screen" args="joint_state_controller" />

  <param name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
  
  <!--  <node name="rosbot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -param robot_description -model rosbot" />  -->

  <!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

</launch>

The “rosbot_spawn” is commented out. I will try and back here.

Many Thanks. All tests 1. to 5. work perfectly.
How can I edit rosbot_navigation_move_rosbot.launch to specify the start and goal positions for rosbot?

navfn/NavfnROS is the default global planner for rosbot2.0, right? how can I change it in rosbot_navigation_move_rosbot.launch? because I need to compare the performance of differenet global planners navfn, carrot, and others… using RosBot2

I highly appreciate you help and support.

Initial rosbot position is defined in rosbot_gazebo.launch file in line:

<node name="rosbot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="-urdf -param robot_description -x 1.5 -y 3.5 -z 0.0 -model rosbot" />

By default arguments -x, -y and -z are not provided, then they are assumed to be zero.

You can also set ROSbot position during simulation runtime, in new terminal type:

rostopic pub -1 /gazebo/set_model_state gazebo_msgs/ModelState '{model_name: rosbot, pose: { position: { x: 1, y: 2, z: 0 }, orientation: {x: 0, y: 0, z: 0, w: 1 } }, twist: { linear: { x: 0, y: 0, z: 0 }, angular: { x: 0, y: 0, z: 0}  }, reference_frame: world }'

This will move ROSbot model to selected position and orientation.

Goal position can not be set in .launch file, it has to be set during runtime. It can be done either in Rviz with 2D Nav Goal button or by publishing message to move_base_simple/goal topic.

Global planner is defined as a parameter for move_base node, default is navfn/NavfnROS, to change it set appropriate value:

    <node pkg="move_base" type="move_base" name="move_base" output="screen">
        <param name="base_global_planner" value="navfn/NavfnROS"/>
        <param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS"/>
        <param name="controller_frequency" value="0.5"/>
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/trajectory_planner.yaml" command="load" />
    </node>

Regards,
Łukasz

1- I added the node move_base to the .launch file

2- I opened new terminal to set start (1.5,3.5):
rostopic pub -1 /gazebo/set_model_state gazebo_msgs/ModelState '{model_name: rosbot, pose: { position: { x: 1.5, y: 3.5, z: 0 }, orientation: {x: 0, y: 0, z: 0, w: 1 } }, twist: { linear: { x: 0, y: 0, z: 0 }, angular: { x: 0, y: 0, z: 0} }, reference_frame: world }'
The output is:
publishing and latching message for 3.0 seconds
and rosbot move successfully to the desired start

3- I opened new terminal to set the goal(6.5,3.5):
rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped '{header: {stamp: now, frame_id: "map"}, pose: {position: {x: 6.5, y: 3.5, z: 0.0}, orientation: {w: 1.0}}}'
The output is:
publishing and latching message. Press ctrl-C to terminate

The robot supposed to move from start to the goal in a straight line.
However, rosbot does not move in Gazebo and in Rviz
The image below shows the desired goal as blue circle, and a blue line appears ( it is a global path I think).
move rosbot

global path

Are you getting any errors or warnings?
There should be confirmation from move base that new target was set. Can you see that message in the log?

Could you paste here your launch file after all modifications?

Regards,
Łukasz

After running the .launch file in the terminal, this is the output(there are 2 warn):
… logging to /home/eman/.ros/log/24628d98-5f2f-11eb-991e-e0f84736498c/roslaunch-eman-MacBookPro-15160.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro.py is deprecated; please use xacro instead
xacro.py is deprecated; please use xacro instead
started roslaunch server http://eman-MacBookPro:45829/

SUMMARY
========

PARAMETERS
 * /gazebo/enable_ros_network: True
 * /joint_state_controller/publish_rate: 50
 * /joint_state_controller/type: joint_state_contr...
 * /robot_description: <?xml version="1....
 * /rosdistro: melodic
 * /rosversion: 1.14.10
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    joint_state_controller_spawner (controller_manager/spawner)
    map_odom_tf (tf/static_transform_publisher)
    map_server (map_server/map_server)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    rosbot_spawn (gazebo_ros/spawn_model)
    rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [15177]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 24628d98-5f2f-11eb-991e-e0f84736498c
process[rosout-1]: started with pid [15189]
started core service [/rosout]
process[joint_state_controller_spawner-2]: started with pid [15192]
process[rosbot_spawn-3]: started with pid [15194]
process[robot_state_publisher-4]: started with pid [15198]
process[gazebo-5]: started with pid [15201]
process[gazebo_gui-6]: started with pid [15204]
process[rviz-7]: started with pid [15214]
process[map_server-8]: started with pid [15224]
[INFO] [1611594170.275250, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
process[map_odom_tf-9]: started with pid [15232]
[ WARN] [1611594172.803266897]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia.  As a workaround, you can add an extra dummy link to your URDF.
[ INFO] [1611594181.782823928]: rviz version 1.13.14
[ INFO] [1611594181.782977942]: compiled against Qt version 5.9.5
[ INFO] [1611594181.783042363]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1611594181.801307274]: Forcing OpenGl version 0.
[ INFO] [1611594191.077034826]: Stereo is NOT SUPPORTED
[ INFO] [1611594191.077331073]: OpenGl version: 3 (GLSL 1.3).
[ INFO] [1611594193.454446525]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1611594193.463997745]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1611594193.464579692]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1611594193.468771324]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
[INFO] [1611594195.774324, 0.000000]: Loading model XML from ros parameter robot_description
[INFO] [1611594195.803160, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[INFO] [1611594196.413116, 0.000000]: Calling service /gazebo/spawn_urdf_model
[ INFO] [1611594196.427388355]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1611594198.398874399, 0.022000000]: Camera Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1611594198.447722642, 0.022000000]: Camera Plugin (ns = /)  <tf_prefix_>, set to ""
[ INFO] [1611594198.840995373, 0.022000000]: Laser Plugin: Using the 'robotNamespace' param: '/'
[ INFO] [1611594198.841169761, 0.022000000]: Starting GazeboRosLaser Plugin (ns = /)
[ INFO] [1611594198.987767506, 0.022000000]: GPU Laser Plugin (ns = /) <tf_prefix_>, set to ""
[ INFO] [1611594198.989459250, 0.022000000]: LoadThread function completed
[ INFO] [1611594198.999206384, 0.022000000]: <robotNamespace> set to: //
[ INFO] [1611594198.999273109, 0.022000000]: <topicName> set to: //imu
[ INFO] [1611594198.999312864, 0.022000000]: <frameName> set to: imu_link
[ INFO] [1611594198.999373755, 0.022000000]: <updateRateHZ> set to: 10
[ INFO] [1611594198.999423507, 0.022000000]: <gaussianNoise> set to: 0
[ INFO] [1611594198.999478321, 0.022000000]: <xyzOffset> set to: 0 0 0
[ INFO] [1611594198.999563879, 0.022000000]: <rpyOffset> set to: 0 -0 0
[INFO] [1611594199.033577, 0.022000]: Spawn status: SpawnModel: Successfully spawned entity
[ INFO] [1611594199.055368103, 0.022000000]: Physics dynamic reconfigure ready.
[ INFO] [1611594199.820998385, 0.022000000]: Starting GazeboRosSkidSteerDrive Plugin (ns = //)
[rosbot_spawn-3] process has finished cleanly
log file: /home/eman/.ros/log/24628d98-5f2f-11eb-991e-e0f84736498c/rosbot_spawn-3*.log
[ INFO] [1611594200.241414044, 0.022000000]: Loading gazebo_ros_control plugin
[ INFO] [1611594200.241659820, 0.022000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1611594200.242698483, 0.022000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[WARN] [1611594200.542911, 0.022000]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[ INFO] [1611594200.635407277, 0.022000000]: Loaded gazebo_ros_control.
[joint_state_controller_spawner-2] process has finished cleanly
log file: /home/eman/.ros/log/24628d98-5f2f-11eb-991e-e0f84736498c/joint_state_controller_spawner-2*.log

This is my launch file:

<launch>
    <arg name="use_rosbot" default="false"/>
    <arg name="use_gazebo" default="true"/>
    <param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>
    <include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>
    <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)" />
    <node unless="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="map_odom_tf" args="0 0 0 0 0 0 map odom 100" /> 

    <node pkg="move_base" type="move_base" name="move_base" output="screen">
        <param name="base_global_planner" value="navfn/NavfnROS"/>
        <param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS"/>
        <param name="controller_frequency" value="0.5"/>
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find rosbot_navigation)/config/trajectory_planner.yaml" command="load" />
    </node>
</launch>

After setting the goal in the terminal, I got:
publishing and latching message. Press ctrl-C to terminate