Exam: gobal/local costmaps not visible in rviz

Hello together,
I am currently working on task 3 of the navigation exam. Unfortunately neither the local nor the global costmap is visible in rviz, although there is no error message. The following output when starting path_planning.launch:

SUMMARY

PARAMETERS

  • /amcl/gui_publish_rate: 10.0
  • /amcl/kld_err: 0.05
  • /amcl/laser_max_beams: 60
  • /amcl/laser_max_range: 12.0
  • /amcl/laser_z_hit: 0.5
  • /amcl/laser_z_max: 0.05
  • /amcl/laser_z_rand: 0.5
  • /amcl/laser_z_short: 0.05
  • /amcl/max_particles: 2000
  • /amcl/min_particles: 500
  • /amcl/odom_frame_id: odom
  • /amcl/odom_model_type: diff
  • /amcl/resample_interval: 1
  • /amcl/transform_tolerance: 1.0
  • /amcl/update_min_a: 0.2
  • /amcl/update_min_d: 0.25
  • /amcl/use_map_topic: True
  • /move_base/DWAPlannerROS/acc_lim_th: 3.2
  • /move_base/DWAPlannerROS/acc_lim_x: 2.5
  • /move_base/DWAPlannerROS/acc_lim_y: 0.0
  • /move_base/DWAPlannerROS/latch_xy_goal_tolerance: False
  • /move_base/DWAPlannerROS/max_vel_theta: 1.0
  • /move_base/DWAPlannerROS/max_vel_trans: 0.55
  • /move_base/DWAPlannerROS/max_vel_x: 0.55
  • /move_base/DWAPlannerROS/max_vel_y: 0
  • /move_base/DWAPlannerROS/min_vel_theta: 0.2
  • /move_base/DWAPlannerROS/min_vel_trans: 0.1
  • /move_base/DWAPlannerROS/min_vel_x: 0.0
  • /move_base/DWAPlannerROS/min_vel_y: 0
  • /move_base/DWAPlannerROS/sim_granularity: 0.017
  • /move_base/DWAPlannerROS/sim_time: 2.0
  • /move_base/DWAPlannerROS/vtheta_samples: 20
  • /move_base/DWAPlannerROS/vx_samples: 6
  • /move_base/DWAPlannerROS/xy_goal_tolerance: 0.1
  • /move_base/DWAPlannerROS/yaw_goal_tolerance: 0.05
  • /move_base/NavfnROS/allow_unknown: True
  • /move_base/NavfnROS/default_tolerance: 0.1
  • /move_base/clearing_rotation_allowed: True
  • /move_base/conservative_reset_dist: 3.0
  • /move_base/controller_frequency: 10.0
  • /move_base/controller_patience: 15.0
  • /move_base/global_costmap/footprint: [[-0.35, -0.3], […
  • /move_base/global_costmap/inflation/inflation_radius: 2.0
  • /move_base/global_costmap/obstacle_range: 2.5
  • /move_base/global_costmap/obstacles_laser/laser/clearing: True
  • /move_base/global_costmap/obstacles_laser/laser/data_type: LaserScan
  • /move_base/global_costmap/obstacles_laser/laser/inf_is_valid: True
  • /move_base/global_costmap/obstacles_laser/laser/marking: True
  • /move_base/global_costmap/obstacles_laser/laser/topic: scan
  • /move_base/global_costmap/obstacles_laser/observation_sources: laser
  • /move_base/global_costmap/publish_frequency: 1.0
  • /move_base/global_costmap/raytrace_range: 3.0
  • /move_base/global_costmap/resolution: 0.5
  • /move_base/global_costmap/robot_base_frame: base_link
  • /move_base/global_costmap/static/map_topic: map
  • /move_base/global_costmap/static/subscribe_to_updates: True
  • /move_base/global_costmap/transform_tolerance: 0.5
  • /move_base/global_costmap/update_frequency: 4.0
  • /move_base/global_frame: map
  • /move_base/local_costmap/footprint: [[-0.35, -0.3], […
  • /move_base/local_costmap/height: 10.0
  • /move_base/local_costmap/inflation/inflation_radius: 2.0
  • /move_base/local_costmap/obstacle_range: 2.5
  • /move_base/local_costmap/obstacles_laser/laser/clearing: True
  • /move_base/local_costmap/obstacles_laser/laser/data_type: LaserScan
  • /move_base/local_costmap/obstacles_laser/laser/inf_is_valid: True
  • /move_base/local_costmap/obstacles_laser/laser/marking: True
  • /move_base/local_costmap/obstacles_laser/laser/topic: scan
  • /move_base/local_costmap/obstacles_laser/observation_sources: laser
  • /move_base/local_costmap/publish_frequency: 1.0
  • /move_base/local_costmap/raytrace_range: 3.0
  • /move_base/local_costmap/resolution: 0.5
  • /move_base/local_costmap/robot_base_frame: base_link
  • /move_base/local_costmap/static/map_topic: map
  • /move_base/local_costmap/static/subscribe_to_updates: True
  • /move_base/local_costmap/transform_tolerance: 0.5
  • /move_base/local_costmap/update_frequency: 4.0
  • /move_base/local_costmap/width: 10.0
  • /move_base/oscillation_distance: 0.5
  • /move_base/oscillation_timeout: 0.0
  • /move_base/planner_frequency: 0.2
  • /move_base/planner_patience: 5.0
  • /move_base/plugins: [{‘name’: 'static…
  • /move_base/recovery_behavior_enabled: True
  • /move_base/rolling_window: False
  • /move_base/shutdown_costmaps: False
  • /move_base/track_unknown_space: True
  • /rosdistro: noetic
  • /rosversion: 1.15.9

NODES
/
amcl (amcl/amcl)
map_server (map_server/map_server)
move_base (move_base/move_base)

ROS_MASTER_URI=http://1_simulation:11311

process[map_server-1]: started with pid [10136]
process[amcl-2]: started with pid [10137]
process[move_base-3]: started with pid [10142]
[ WARN] [1641501880.872421758, 6035.960000000]: Timed out waiting for transform from base_link to map to become available before running costmap, tf error: canTransform: target_frame map does not exist… canTransform returned after 6035.96 timeout was 0.1.
Warning: Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6037.100000 according to authority unknown_publisherTF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6037.100000 according to authority unknown_publisher

     at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
     at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp

Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6037.260000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6037.260000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
[ INFO] [1641501882.354466858, 6037.420000000]: global_costmap: Using plugin “obstacle_layer”
[ INFO] [1641501882.363198413, 6037.430000000]: Subscribed to Topics:
[ INFO] [1641501882.376021722, 6037.440000000]: global_costmap: Using plugin “inflation_layer”
[ INFO] [1641501882.433116872, 6037.500000000]: local_costmap: Using plugin “obstacle_layer”
[ INFO] [1641501882.439683472, 6037.500000000]: Subscribed to Topics:
[ INFO] [1641501882.451010050, 6037.520000000]: local_costmap: Using plugin “inflation_layer”
[ INFO] [1641501882.508900268, 6037.570000000]: Created local_planner dwa_local_planner/DWAPlannerROS
[ INFO] [1641501882.512592956, 6037.580000000]: Sim period is set to 0.10
[ INFO] [1641501882.754879516, 6037.820000000]: Recovery behavior will clear layer ‘obstacles’
[ INFO] [1641501882.763081313, 6037.830000000]: Recovery behavior will clear layer ‘obstacles’
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6039.240000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6039.240000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6039.720000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6039.720000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6040.680000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame base_link at time 6040.680000 according to authority unknown_publisher
at line 278 in /tmp/binarydeb/ros-noetic-tf2-0.7.5/src/buffer_core.cpp

Please do not wonder about some settings, I have now played around with almost every parameter, but without success, always the same problem. By entering roswtf I get the following error message:

================================================================================
Static checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING ROS_IP may be incorrect: ROS_IP does not appear to be an IP address of a local network interface (one of [‘127.0.0.1’, ‘172.18.0.7’]).

================================================================================
Beginning tests of your ROS graph. These may take a while…
analyzing graph…
… done analyzing graph
running graph rules…
… done running graph rules
Traceback (most recent call last):
File “/opt/ros/noetic/lib/python3/dist-packages/roswtf/init.py”, line 224, in _roswtf_main
p(ctx)
File “/opt/ros/noetic/lib/python3/dist-packages/openni2_launch/wtf_plugin.py”, line 114, in roswtf_plugin_online
error_rule(r, r0, ctx)
File “/opt/ros/noetic/lib/python3/dist-packages/openni2_launch/wtf_plugin.py”, line 85, in sensor_notfound
devices = _device_notfound_subproc(
File “/opt/ros/noetic/lib/python3/dist-packages/openni2_launch/wtf_plugin.py”, line 56, in _device_notfound_subproc
df = subprocess.check_output(“lsusb”)
File “/usr/lib/python3.8/subprocess.py”, line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/usr/lib/python3.8/subprocess.py”, line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘lsusb’ returned non-zero exit status 1.
Command ‘lsusb’ returned non-zero exit status 1.

Aborting checks, partial results summary:

Found 2 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:

  • /twist_marker_server:
    • /twist_marker_server/feedback
  • /twist_mux:
    • /joy_teleop/cmd_vel
    • /platform_control/cmd_vel
    • /e_stop
  • /ekf_localization:
    • /set_pose
  • /gazebo:
    • /gazebo/set_link_state
    • /gazebo/set_model_state
  • /rviz_1641497272639802580:
    • /map_updates
  • /move_base:
    • /odom
    • /move_base/cancel

WARNING These nodes have died:

  • spawn_husky_model-9

Found 1 error(s).

ERROR The following nodes should be connected but aren’t:

  • /move_base->/move_base (/move_base/local_costmap/footprint)
  • /move_base->/move_base (/move_base/global_costmap/footprint)

And in rviz it looks like this:

I would be very grateful for any assistance.

Best regards
Sebastian

Hello Sebastian, could you please share the parameter files of the costmaps? (local, global and common)

Hi Alberto Ezquerro,
thank you for the answer. Unfortunately, I have not yet found a solution to my problem.
I have already tried different parameters here, but nothing changes. Here are the cosmap configurations:

cosmap_common.yaml
footprint: [[-0.5, -0.33], [-0.5, 0.33], [0.5, 0.33], [0.5, -0.33]]
footprint_padding: 0.01

robot_base_frame: base_link
update_frequency: 4.0
publish_frequency: 1.0
transform_tolerance: 0.5

resolution: 0.5

obstacle_range: 2.5
raytrace_range: 3.0

#layer definitions
static:
map_topic: /map
subscribe_to_updates: true
obstacles_laser:
observation_sources: laser
laser: {data_type: LaserScan, clearing: true, marking: true, topic: scan, inf_is_valid: true}
inflation:
inflation_radius: 1.0

costmap_global.yaml
global_frame: map
rolling_window: false
track_unknown_space: true

plugins:

  • {name: static, type: “costmap_2d::StaticLayer”}
  • {name: inflation, type: “costmap_2d::InflationLayer”}

costmap_local.yaml
global_frame: odom
rolling_window: true
update_frequency: 1.0

plugins:

  • {name: obstacles_laser, type: “costmap_2d::ObstacleLayer”}
  • {name: inflation, type: “costmap_2d::InflationLayer”}

Hello @Sebastian77 ,

I think the problem is that you are not setting the namespaces for the global/local costmaps. You can easily change this in the launch file like so:

<rosparam file="$(find navigation_exam)/params/costmap_local.yaml" command="load" ns="local_costmap" />

<rosparam file="$(find navigation_exam)/params/costmap_global.yaml" command="load" ns="global_costmap" />

Substitute these lines in your launch file and it should work properly.

Best,

Hi @albertoezquerro ,
thank you very much for your help! Indeed, that was the error. Could you please explain me when I have to define the namespaces. In the solutions of the nav_project it says:

<rosparam file="$(find my_turtlebot_path_planning)/config/move_base_params.yaml" command="load" />
<rosparam file="$(find my_turtlebot_path_planning)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find my_turtlebot_path_planning)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find my_turtlebot_path_planning)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find my_turtlebot_path_planning)/config/global_costmap_params.yaml" command="load" />

Here only for “costmap common” the ns is defined once for global and once for local. I’m confused, why?

I have finished the exam successfully (10/10), but the local costmap was not shown correctly in rviz. I also had the feeling that the local planner was not working properly. Is it possible to get the sample solution of this exam? I dont see any option for viewing it like in the “ROS Basic in 5 Days”-course.

Best regards
Sebastian

Hello @Sebastian77 ,

  • They always need to be defined. If they are not specified in the launch file (like in the example you show), then they will be specified directly in the yaml file. You will see that the yaml file starts with the namespace, like this:
local_costmap:

#rest of parameters
  • The common costmap parameters are loaded for both namespaces because they are used in both global and local costmaps, hence they are “common” parameters.