Can I use costmap_2d as a standalone node, without using the navigation stack?
Hello!
I have some point cloud data and would like to construct a costmap for navigation purposes. I couldn't find any tutorial on costmaps specifically, most tutorials are often about using costmap with the navigation stack. Here is my attempt to run the costmap node as a standalone node.
My .yaml
file
global_frame: map
robot_base_frame: zed_camera_center
transform_tolerance: 0.2
robot_radius: 0.6
update_frequency: 5.0
publish_frequency: 2.0
rolling_window: true
static_map: false
width: 100
height: 100
resolution: 0.05
obstacle_range: 5.5
raytrace_range: 8.0
footprint: [[ 0.6096, 1.1684], [-0.6096, 1.1684], [-0.6096, -1.1684], [ 0.6096, -1.1684]]
footprint_padding: 0.10
observation_sources: point_cloud_sensor
point_cloud_sensor: {sensor_frame: zed_camera_center, data_type: PointCloud2, topic:
/zed/point_cloud/cloud_registered, marking: true, clearing: true}
And here is my launch file.
<node name="costmap_node" pkg="costmap_2d" type="costmap_2d_node" >
<rosparam file="$(find path_planning)/params/costmap_params.yaml" command="load" ns="local_costmap" />
</node>
Here is the terminal output when I run the launch file
neil@neil:~/Workspace/self-driving-golf-cart/ros$ roslaunch path_planning navigation.launch
... logging to /home/neil/.ros/log/2e1eac9e-5744-11e9-8f6a-bcec23c374bf/roslaunch-neil-15292.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://neil:33545/
SUMMARY
========
PARAMETERS
* /costmap_node/local_costmap/footprint: [[0.6096, 1.1684]...
* /costmap_node/local_costmap/footprint_padding: 0.1
* /costmap_node/local_costmap/global_frame: map
* /costmap_node/local_costmap/height: 100
* /costmap_node/local_costmap/observation_sources: point_cloud_sensor
* /costmap_node/local_costmap/obstacle_range: 5.5
* /costmap_node/local_costmap/point_cloud_sensor/clearing: True
* /costmap_node/local_costmap/point_cloud_sensor/data_type: PointCloud2
* /costmap_node/local_costmap/point_cloud_sensor/marking: True
* /costmap_node/local_costmap/point_cloud_sensor/sensor_frame: zed_camera_center
* /costmap_node/local_costmap/point_cloud_sensor/topic: /zed/point_cloud/...
* /costmap_node/local_costmap/publish_frequency: 2.0
* /costmap_node/local_costmap/raytrace_range: 8.0
* /costmap_node/local_costmap/resolution: 0.05
* /costmap_node/local_costmap/robot_base_frame: zed_camera_center
* /costmap_node/local_costmap/robot_radius: 0.6
* /costmap_node/local_costmap/rolling_window: True
* /costmap_node/local_costmap/static_map: False
* /costmap_node/local_costmap/transform_tolerance: 0.2
* /costmap_node/local_costmap/update_frequency: 5.0
* /costmap_node/local_costmap/width: 100
* /rosdistro: melodic
* /rosversion: 1.14.3
NODES
/
costmap_node (costmap_2d/costmap_2d_node)
auto-starting new master
process[master]: started with pid [15303]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 2e1eac9e-5744-11e9-8f6a-bcec23c374bf
process[rosout-1]: started with pid [15317]
started core service [/rosout]
process[costmap_node-2]: started with pid [15324]
When I run rostopic list
, none of the costmap topics shows up. I am wondering what I am doing wrong. Thank you very much! Sorry that I am very new to navigation with ROS.
Cheers,
Neil
"static_map: false"
Also, can you add output from terminal.
I added that line to the yaml file. Unfortunately, it didn't work. Nothing changed. I added the terminal output. ROS didn't throw me any warnings or errors.
What do you mean? You couldn't copy and paste it?
"When I run rostopic list, none of the costmap topics show up". What's the output you get for
rosnode info costmap_node
?This is the output when I ran
rosnode info costmap_node
Hello @NNie2019: Were you able to figure out how to run the
costmap_2d
node standalone? Executing$ rosnode info costmap_node
yields the same for me as for you - i.e., no costmap topics being published.You are not publishing the transform between the
global_frame
androbot_base_frame
.