ROS Answers: Open Source Q&A Forum - Latest question feedhttp://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Tue, 16 Dec 2014 14:29:00 -0600Warning: Costmap2DROS transform timeout and Could not get robot pose, cancelling reconfiguration keeps on coming.http://answers.ros.org/question/199631/warning-costmap2dros-transform-timeout-and-could-not-get-robot-pose-cancelling-reconfiguration-keeps-on-coming/Hello, i am trying to navigate a P3AT using navigation stack of ROS. My P3AT robot spawned in USARSim Simulator, when click on "2D Pose Estimate" button in rviz, following warning appears:-
[ WARN] [1418755409.463328718]: Failed to transform initial pose in time (Lookup would require extrapolation into the future. Requested time 1418755409.463123216 but the latest data is at time 1418755409.267793132, when looking up transform from frame [/map] to frame [/base_link])
and then the following Pose Estimatation INFO appears:-
[ INFO] [1418755409.463394700]: Setting pose (1418755409.463378): 0.010 1.002 0.000
and when i assign a goal through rviz, robot roams around instead of reaching to the goal and following warning keeps on coming:-
[ WARN] [1418755475.875007845]: Costmap2DROS transform timeout. Current time: 1418755475.8750, global_pose stamp: 1418755475.5657, tolerance: 0.3000
[ WARN] [1418755476.294750399]: Could not get robot pose, canceling reconfiguration
I tried a lot every where but could not get any solution for this.
1. Here you can see the rqt_graph [Click here](https://www.dropbox.com/s/ypu5mormrjj8bvd/rqt_auto_rviz_goal.png?dl=0)
2. Here you can see the frame results [Click here](https://www.dropbox.com/s/n03079ox1dljtgd/frames.pdf?dl=0)
3. Below you can see the publishing rate of `/odom` `/scan` and `/tf`
/odom-->average rate: 5.002 min: 0.193s max: 0.210s std dev: 0.00788s window: 39
/scan--->average rate: 4.997 min: 0.193s max: 0.210s std dev: 0.00782s window: 39
/tf-------->average rate: 40.086 min: 0.000s max: 0.112s std dev: 0.04128s window: 250
Below is ths result for `rosrun tf tf_monitor`
RESULTS: for all Frames
Frames:
Frame: /base_GndTruth published by /RosSim Average Delay: 0.000308496 Max Delay: 0.00043089
Frame: /base_footprint published by /RosSim Average Delay: 0.000359867 Max Delay: 0.000533135
Frame: /base_link published by /RosSim Average Delay: 0.0988194 Max Delay: 0.208548
Frame: /lms200 published by /RosSim Average Delay: 0.000360125 Max Delay: 0.000442482
Frame: /odom published by /amcl Average Delay: 0.0997808 Max Delay: 0.110182
All Broadcasters:
Node: /RosSim 37.2212 Hz, Average Delay: 0.0425422 Max Delay: 0.208548
Node: /amcl 5.76487 Hz, Average Delay: 0.0997808 Max Delay: 0.110182
Below are my costmap files:-
**1. base_local_planner_params.yaml**
TrajectoryPlannerROS:
# for details see: http://www.ros.org/wiki/base_local_planner
max_vel_x: 0.45
min_vel_x: 0.1
max_rotational_vel: 1.0
min_in_place_rotational_vel: 0.4
acc_lim_th: 3.2
acc_lim_x: 2.5
acc_lim_y: 2.5
holonomic_robot: false
# goal tolerance parameters
yaw_goal_tolerance: 0.1
xy_goal_tolerance: 0.2
latch_xy_goal_tolerance: true
**2. costmap_common_params.yaml**
obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[0.3, 0.3], [0.3, -0.3], [-0.3, -0.3], [-0.3, 0.3]][0.075, -0.178]]
#robot_radius: ir_of_robot
inflation_radius: 0.55
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: lms200, data_type: LaserScan, topic: scan, marking: true, clearing: true}
**3. global_costmap_params.yaml**
global_costmap:
global_frame: /map
robot_base_frame: /base_link
update_frequency: 5.0
static_map: true
**4. local_costmap_params.yaml**
local_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width: 6.0
height: 6.0
resolution: 0.05
**5. move_base.launch**
<launch>
<!-- Run the map server -->
<node name="map_server" pkg="map_server" type="map_server" args="$(find my_robot_name_2dnav)/map/map.yaml" respawn="true"/>
<!--- You can see original move_base.launch -->
<!--- Run AMCL -->
<include file="$(find usarsim_inf)/launch/usarsim.launch"/>
<include file="$(find amcl)/examples/amcl_diff.launch" />
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<rosparam file="$(find my_robot_name_2dnav)/launch/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find my_robot_name_2dnav)/launch/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find my_robot_name_2dnav)/launch/local_costmap_params.yaml" command="load" />
<rosparam file="$(find my_robot_name_2dnav)/launch/global_costmap_params.yaml" command="load" />
<rosparam file="$(find my_robot_name_2dnav)/launch/base_local_planner_params.yaml" command="load" />
</node>
<node pkg="rviz" type="rviz" respawn="false" name="rviz"></node>
</launch>AarifTue, 16 Dec 2014 14:29:00 -0600http://answers.ros.org/question/199631/voxel_grid visualization in rvizhttp://answers.ros.org/question/12975/voxel_grid-visualization-in-rviz/Hi all!
I'm working with the navigation stacks, I made a costmap_2d/VoxelGrid with all my sensor data in it and I use this to navigate through the environment. I can see the laser and all my sensor in rviz but it would be nice to just visualize my costamp (VoxelGrid data type) instead of all the sensor separately. Is it possible to visualize the costamp_2d in rviz?? of is there any plug-in to convert my costmap in a data type that rviz can plot??
Thanks!jrcaprilesFri, 10 Feb 2012 03:48:06 -0600http://answers.ros.org/question/12975/attaching Costmap2DROS object to existing costmaps (i.e. from movebase)http://answers.ros.org/question/191620/attaching-costmap2dros-object-to-existing-costmaps-ie-from-movebase/Hi all. I think i'm finally on the right track to solving my problem. If you would like to see the original problem, I asked about it here http://answers.ros.org/question/190858/how-to-go-about-this-engineering-problem-using-navigation-stack/ -- still no responses though :(
I should be able to set up individual layers using specific sensors similar to what is described here: http://answers.ros.org/question/83471/layered-costmap-problem/
Ultimately, I'm going to set up 2 static layers, and I need to save the map generated by one of these static layer and I will load it next time the navigation stack runs.
I think the way of doing this is by using accessing the Costmap2DROS C++ object detailed here: http://wiki.ros.org/costmap_2d
Looking at the API, it makes sense that I would be able to create a new one of these objects in a .cpp file, but I don't know how I would go about getting the Costmap2DROS objects that move_base creates when it is launched.
Does anyone have any idea as to how to obtain a C++ interface to the global and local costmaps that move_base instantiates when you run similar launch files to what is on the tutorials? Maybe you can create the object with a parameter such as the topic or node name or something.
Thanks if anyone can help.
Also, i'm on indigo so maybe the Costmap2DROS object is not called that anymore.GarrickMon, 01 Sep 2014 04:24:21 -0500http://answers.ros.org/question/191620/laser scan to occupancy grid using costmap_2d [new user]http://answers.ros.org/question/191283/laser-scan-to-occupancy-grid-using-costmap_2d-new-user/Hi all,
Acording to http://wiki.ros.org/costmap_2d it takes in sensor data from the world and builds a 2D occupancy grid of the data. I have a published topic: /scan (sensor_msgs/LaserScan) and I want to use costmap_2d to provide a current occupancy grid. (sensor data --> [2d costmap] --> 2d occupancy grid)
But the same reference (http://wiki.ros.org/costmap_2d) says:
- Subscribed Topics:
1. /footprint (geometry_msgs/Polygon)
- Published Topics:
1. /grid (nav_msgs/OccupancyGrid)
2. /grid_updates (nav_msgs/OccupancyGridUpdate)
3. /voxel_grid (costmap_2d/VoxelGrid)
It seems the costmap_2d doesn't subscribe the (sensor_msgs/LaserScan) that I have it published. The only subscribed topic for costmap_2d is: /footprint (geometry_msgs/Polygon). What should I do to have /scan topic subscribed to costmap_2d node? (I'm trying to use standalone costmap_2d node)
Thanks!AliAsTue, 26 Aug 2014 08:47:34 -0500http://answers.ros.org/question/191283//scan topic subscribed to costmap_2d [new user]http://answers.ros.org/question/191393/scan-topic-subscribed-to-costmap_2d-new-user/Hi all,
I have (sensor_msgs/LaserScan) and I want it subscribed to costmap_2d. Apparantly costmap_2d doesnot explicitly subscribe to sensors [Reference](http://answers.ros.org/question/191283/laser-scan-to-occupancy-grid-using-costmap_2d-new-user/). By checking [API](http://docs.ros.org/indigo/api/costmap_2d/html/annotated.html) it seems Costmap2DROS is a ROS wrapper for a 2D Costmap. Handles subscribing to topics that provide observations about obstacles in either the form of PointCloud or LaserScan messages.
I am new in ROS. I think I have to give /scan topic as an input to Costmap2DROS. I think I should write a Publisher - Subscriber through this Tutorial: (http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber(c%2B%2B) )
to be able to give a laser scan to Costmap2DROS. Am I right?
AliAsWed, 27 Aug 2014 11:08:05 -0500http://answers.ros.org/question/191393/Clearing operation in costmap_2d explanation ?http://answers.ros.org/question/190866/clearing-operation-in-costmap_2d-explanation/Can someone explain the following sentence or with an image maybe ?
A clearing operation, however, consists of raytracing through a grid from the origin of the sensor outwards for each observation reported.
Thank you ! 2ROS0Thu, 21 Aug 2014 13:05:45 -0500http://answers.ros.org/question/190866/DWAPlanner::checkTrajectory always successhttp://answers.ros.org/question/189943/dwaplannerchecktrajectory-always-success/Hello,
I try to use the dwa_local_planner::DWAPlanner::checkTrajectory.
I have edit the dwa_planner_ros.cpp and .h in order to subsrcibe to a path and i want to check if the trajectory is right.
I use the dwa_planner initialize and update by the dwa_planner_ros.cpp
costmap_ros_->getRobotPose(current_pose_); // (costmap_ros_ is the costmap_2d::Costmap2DROS)
//we want to clear the robot footprint from the costmap we're using
costmap_ros_->clearRobotFootprint();
// make sure to update the costmap we'll use for this cycle
costmap_ros_->getCostmapCopy(costmap_);
tf::Stamped<tf::Pose> robot_vel;
odom_helper_.getRobotVel(robot_vel);
tf::Stamped<tf::Pose> drive_cmds;
drive_cmds.frame_id_ = costmap_ros_->getBaseFrameID();
dp_->updatePlanAndLocalCosts(current_pose_,req.path); // dp_ is the dwa_local_planner::DWAPlanner
planner_util_.setPlan(req.path);
dp_->findBestPath(current_pose_, robot_vel, drive_cmds, costmap_ros_->getRobotFootprint());
Eigen::Vector3f pos,vel,vel_samples;
pos[0]=current_pose_.getOrigin().getX();
pos[1]=current_pose_.getOrigin().getY();
pos[2]=current_pose_.getOrigin().getZ();
vel[0]=robot_vel.getOrigin().getX();
vel[1]=robot_vel.getOrigin().getY();
vel[2]=robot_vel.getOrigin().getZ();
vel_samples[0]=3;
vel_samples[1]=10;
vel_samples[2]=20;
if(dp_->checkTrajectory(pos,vel,vel_samples)){ROS_INFO("success");}else{ROS_INFO("fail");}
But even with a wrong plan ( i can visualize that the path go into walls) the checkTrajectory function always return true.
Someone can tell me what is my mistake, what I have forget?
thanksGuillaumeBWed, 13 Aug 2014 01:35:51 -0500http://answers.ros.org/question/189943/obstacle_layer updates areas out of sighthttp://answers.ros.org/question/165726/obstacle_layer-updates-areas-out-of-sight/This question is partly related to an [earlier post](http://answers.ros.org/question/165571/obstacle_layer-does-not-clear-area/) of mine but is worth its own question. So I am getting the problem, that obviously occluded areas are getting updated through the `obstacle_layer`-plugin of the `costmap_2d` package. Since I do not have enough of these precious karma points I cannot post any screen shots but I can try to explain the situation in words.
To my understanding, the `ObstacleLayer::updateBounds` function in the mentioned plugin handles the area to be updated. This area is designed to be rectangular. In my case the laser scan reaches a bit behind the robot but far from an all around view (screen shot would help here). So the extreme points of the laser scan extend this update rectangle so far that the `obstacle_layer` updates areas behind the robot which he has never observed. It updates this area with the values of the prerecorded map but since the situation could have changed since then this behavior is not desirable.
Another strange behavior of this `ObstacleLayer::updateBounds` function is that it does not updates as far as the most far away laser scan recorded. It stops somewhere halfway and does update occluded regions but not the region I expect it to update.
Is there a way of cropping the `ObstacleLayer::updateBounds` to a meaningful frame without messing with the source code of the `obstacle_layer`? Or am I totally misunderstanding the concept of the `obstacle_layer`? Any help is appreciated. Thanks!
----------
**UPDATE**
Now I can provide a screen shot. The rectangular represents the area, which the `obstacle_layer` updates the `layered_costmap_` (aka. master costmap) with. The occluded room to the robot's right should clearly not be updated with either `LETHAL_OBSTACLE` nor `FREE_SPACE` since we simply do not know.
![image description](/upfiles/14005921082568876.png)
If relevant: I use Hydro on an Ubuntu 12.04 LTS.Luke_ROSFri, 16 May 2014 05:30:30 -0500http://answers.ros.org/question/165726/Accessing data of different layers in Costmap2DROShttp://answers.ros.org/question/172670/accessing-data-of-different-layers-in-costmap2dros/I would like to access the data of the internal `master_grid` of the `obstacle_layer`. I am working in another layer and right now I am reading the values out of the `layered_costmap_`, which works fine like that:
costmap_2d::Costmap2D* costmap = layered_costmap_->getCostmap();
Also, if I would be within the `obstacle_layer`, I would access the data of its own `master_grid` like that:
unsigned char* master_array = master_grid.getCharMap();
But how would I access the `master_grid` of the `obstacle_layer` from another layer? Thanks!
----------
UPDATE:
I think I found a working piece of code which answers like 95 % of my question. So the code searches through all the layers of the `COSTMAP` (actually it is a layered costmap of type `costmap_2d::Costmap2DROS`) and operates on the one which matches a predefined string (`layer_sear_string_`). But can somebody help me how to find the name of the layered costmap `global_planner` when running move_base?
std::vector<boost::shared_ptr<costmap_2d::Layer> >* plugins = COSTMAP->getLayeredCostmap()->getPlugins();
for (std::vector<boost::shared_ptr<costmap_2d::Layer> >::iterator pluginp = plugins->begin(); pluginp != plugins->end(); ++pluginp) {
boost::shared_ptr<costmap_2d::Layer> plugin = *pluginp;
if(plugin->getName().find(layer_search_string_)!=std::string::npos) {
boost::shared_ptr<costmap_2d::ObstacleLayer> costmap;
costmap = boost::static_pointer_cast<costmap_2d::ObstacleLayer>(plugin);
unsigned char* grid = costmap->getCharMap();
// do sth with it
}
}
Code found [here](https://github.com/ros-planning/navigation/blob/hydro-devel/clear_costmap_recovery/src/clear_costmap_recovery.cpp).Luke_ROSTue, 03 Jun 2014 08:34:48 -0500http://answers.ros.org/question/172670/costmap_plugins.xml misbehavinghttp://answers.ros.org/question/171396/costmap_pluginsxml-misbehaving/I created a new layer (the `overwrite_layer`) and declared it in the `costmap_plugins.xml`. The code compiles without errors but when I run it, I get the following error message:
[ INFO] [1401350861.147988001, 1397467592.599155280]: Using plugin "overwrite_layer"
terminate called after throwing an instance of 'pluginlib::LibraryLoadException'
what(): According to the loaded plugin descriptions the class scitos_2d_navigation::OverwriteLayer with base class type costmap_2d::Layer does not exist. Declared types are blablabla ...
The puzzeling part to me is, that the plugin loader still looks for a `costmap_2d::Layer` object even though it is clearly defined as a `costmap_2d::CostmapLayer` (see `costmap_plugins.xml`-file below). Acutally I had it first as a `costmap_2d::Layer`, compiled it, then changed it to `costmap_2d::CostmapLayer` and then compiled it again. Can I maybe force the compiler somehow to reread the `costmap_plugins.xml`? Or am I overlooking something obvious? Thanks!
<class_libraries>
<library path="lib/libdynamic_layer">
<class type="scitos_2d_navigation::DynamicLayer" base_class_type="costmap_2d::Layer">
<description>Publishing a static_map and a dynamic_map based on old and current measurments</description>
</class>
</library>
<library path="lib/liboverwrite_layer">
<class type="scitos_2d_navigation::OverwriteLayer" base_class_type="costmap_2d::CostmapLayer">
<description>Overwriting the layered costmap with a user defined map.</description>
</class>
</library>
</class_libraries>
I'm on Hydro, Ubuntu 12.04
Luke_ROSWed, 28 May 2014 22:33:52 -0500http://answers.ros.org/question/171396/CostMap2D no longer showing unknown spacehttp://answers.ros.org/question/141051/costmap2d-no-longer-showing-unknown-space/Hello,
I am running ROS Hydro on Ubuntu 12.04.
I have written an application that runs alongside `gmapping_demo.launch` but has its own Costmap2DROS object keeping track of the global costmap. While developing my app, I have been able to use the `getCostmap()` function to get a copy of the character map. Relevant code is shown:
costmap_2d::Costmap2D* mymap = globalmap_->getCostmap();
boost::unique_lock< boost::shared_mutex > lock(*(mymap->getLock()));
mymap->saveMap("/tmp/map");
I then go through the "mymap" pointer and copy its cost values to a character array.
This used to work perfectly, but today I noticed that the saved map **no longer keeps track of unknown space (cost = 255), instead just saving it as zeros, as though all unknown space was freespace.** To illustrate this, here is the map generated by saveMap():
![image description](/upfiles/13950824145319034.png)
I have searched the file, and 255 does not appear anywhere.
I am quite stumped as to why this is happening. The only thing I can think of is that I **allowed Ubuntu to install updates yesterday**, and the navigation packages were included. Has something changed in the way they work? I am wondering if some bug was introduced.
Saving the map via `rosrun map_server map_saver` still runs the way I expect it to.
If there is any more information I can provide, please let me know. Thanks in advance.
BlitherPantsMon, 17 Mar 2014 08:57:46 -0500http://answers.ros.org/question/141051/How Costmap workshttp://answers.ros.org/question/147846/how-costmap-works/I am trying to understand how Costmaps Works. I have Costmap with params:
----------
**costmap params**
base_scan: {clearing: true, data_type: LaserScan, expected_update_rate: 0.4, marking: true,
max_obstacle_height: 2.4, min_obstacle_height: 0.08, observation_persistence: 5.0}
cost_scaling_factor: 13.0
footprint: '[[-0.375,-0.375],[-0.375,0.375],[0.375,0.375],[0.375,-0.375]]'
footprint_padding: 0.05
global_frame: /odom
height: 6
inflation_radius: 0.5
lethal_cost_threshold: 100
map_topic: map
map_type: voxel
mark_threshold: 0
max_obstacle_height: 2.0
max_obstacle_range: 2.5
observation_sources: base_scan
obstacle_range: 2.5
origin_x: 0.0
origin_y: 0.0
origin_z: 0.0
publish_frequency: 5.0
publish_voxel_map: false
raytrace_range: 3.0
resolution: 0.05
restore_defaults: false
robot_base_frame: /base_link
robot_radius: 0.46
rolling_window: true
static_map: false
track_unknown_space: false
transform_tolerance: 0.3
unknown_cost_value: 0
unknown_threshold: 9
update_frequency: 5.0
width: 6
z_resolution: 0.05
z_voxels: 10
----------
rviz(OcupancyGrid with topic: /test_node/local_costmap/infalted_obstacles:
![rviz(OcupancyGrid with topic: /test_node/local_costmap/infalted_obstacles](http://imageshack.com/a/img46/971/wf7w.png)
----------
How Costmap really looks like(openCV):
![How Costmap really looks like(openCV)](http://imageshack.com/a/img571/8012/n7mm.png)
<strike>(I assume that black is obstacle and white is free because when I put robot in free space I get white costmap with black square(robot footprint)). </strike>
<h6>this assumption was wrong</h6>
<h6><i>This can be not true as @ahendrix mentioned. The Costmap picture is flipped vertically to OccupancyGrid</h6>
----------
and my questions:
1. <strike>Why the costmap is consisted only of 0 or 255 values ( I thought there should be a gradient 0-255)?</strike>
<h6><i>I printed values in console and there are values between 0-255 (but not a lot of them - I suppose it depends on inflation radius). But still I don't get it why costmap looks like this and sends correct OccupancyGrid topics.</i></h6>
2. <strike>Why when obstacle spotted whole "beam" on map is 255 (not for instance part of beam from the point on distance that obstacle was spotted and further)?</strike>
<h6>i was wrong with the values(black is 0-free)</h6>
3. <strike>Why the place of robot (footprint?) is spoted as obstacle</strike>
<h6>i was wrong with the values- footprint is free, but why when i put robot in free space, costmap has only footprint spotted as free?</h6>
Thanks in advance
BPWed, 02 Apr 2014 12:47:09 -0500http://answers.ros.org/question/147846/CostmapPluginROS fails to start with null string errorhttp://answers.ros.org/question/138991/costmappluginros-fails-to-start-with-null-string-error/I am having trouble starting the layered costmaps.
When starting the constructor of Costmap2DROS, execution fails at this `plugin_loader_("costmap_2d", "costmap_2d::CostmapPluginROS")` point.
loader:
`pluginlib::ClassLoader<CostmapPluginROS> plugin_loader_; `
In the valgrind log it says a string is null?
But there is no other string than the ones of the `plugin_loader_`.
I am on ROS Fuerte, 12.04
How can this happen? And how can I debug this?
--59282-- REDIR: 0x7abb610 (realloc) redirected to 0x4c2b730 (realloc)
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
==59282==
==59282== Process terminating with default action of signal 6 (SIGABRT)
==59282== at 0x7A6E425: raise (raise.c:64)
==59282== by 0x7A71B8A: abort (abort.c:91)
==59282== by 0x70C069C: __gnu_cxx::__verbose_terminate_handler() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==59282== by 0x70BE845: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==59282== by 0x70BE872: std::terminate() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==59282== by 0x70BE96D: __cxa_throw (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==59282== by 0x706B786: std::__throw_logic_error(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==59282== by 0x70A9508: char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_
iterator_tag) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==59282== by 0x70A95E2: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<
char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==59282== by 0x52A2007: pluginlib::ClassLoader<costmap_2d::CostmapPluginROS>::determineAvailableClasses() (in /home/ros/navigation/costmap_2d/lib/libcostmap_2d.so)
==59282== by 0x529A689: costmap_2d::Costmap2DROS::Costmap2DROS(std::string, tf::TransformListener&) (in /home/ros/navigation/costmap_2d/lib/libcostmap_2d.so)
==59282== by 0x53706A: move_base::MoveBase::MoveBase(std::string, tf::TransformListener&) (move_base.cpp:129)
madmaxWed, 12 Mar 2014 00:28:11 -0500http://answers.ros.org/question/138991/Does a static_map costmap continually update from map_server?http://answers.ros.org/question/107281/does-a-static_map-costmap-continually-update-from-map_server/Hello,
I have a basic conceptual question regarding Costmap2D. When using a global costmap with the static_map parameter true, I know that it will initialize the map with whatever is stored in map_server.
My question is, does this only happen once, when initializing the costmap, or will the costmap be periodically updated when the map in map_server changes?
Thanks in advance!BlitherPantsThu, 05 Dec 2013 05:04:36 -0600http://answers.ros.org/question/107281/Problem with ros navigationhttp://answers.ros.org/question/135596/problem-with-ros-navigation/I'm trying to run navigation stack on a differential robot without a static map. I just want the robot to move 10 meters forward without colliding into any obstacles. It works well for the first time, when the global frame and the robot frame coincide perfectly, but once the robot has moved, it starts giving the below warnings. It does not do any path planning, instead it just keeps rotating in place.
Request for map failed; trying again...
The origin for the sensor at (0.19, 0.00) is out of map bounds. So, the costmap cannot raytrace for it.
The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?
Given below is my configuration files:<br>
**common_costmap.yaml**<br>
obstacle_range: 1.0<br>
raytrace_range: 3.0<br>
robot_radius: 0.376<br>
inflation_radius: 0.45<br>
max_obstacle_height: 0.9<br>
observation_sources: point_cloud_sensor<br>
point_cloud_sensor: {sensor_frame: camera_link, data_type: PointCloud, topic: /pointcloudoutput, marking: true, clearing: true, max_obstacle_height: 0.85}<br>
**local_costmap.yaml**<br>
local_costmap:<br>
global_frame: /odom<br>
robot_base_frame: /base_link<br>
update_frequency: 5.0<br>
publish_frequency: 2.0<br>
static_map: false<br>
rolling_window: true<br>
width: 6.0<br>
height: 6.0<br>
resolution: 0.05<br>
**global_costmap.yaml**<br>
global_costmap:<br>
global_frame: /odom<br>
robot_base_frame: /base_link<br>
update_frequency: 5.0<br>
static_map: false<br>
rolling_window: true<br>rahulrTue, 04 Mar 2014 09:56:20 -0600http://answers.ros.org/question/135596/Cost Map 2D Setuphttp://answers.ros.org/question/42743/cost-map-2d-setup/Hi all,
I'm still trying to figure out a way to generate a reasonable map using sonar data alone. I've given up on gmapping for now.
Thought I'd look at the navigation stack's cost map 2d - questions I have are:
1) Do I/can I just write a node only creating a cost map 2d like in section 3 in [http://www.ros.org/wiki/costmap_2d](http://www.ros.org/wiki/costmap_2d)
2)Or would I be better off just setting up the navigation stack as per [http://www.ros.org/wiki/navigation/Tutorials/RobotSetup](http://www.ros.org/wiki/navigation/Tutorials/RobotSetup)
Thanks
MarkMarkyMark2012Fri, 31 Aug 2012 05:48:48 -0500http://answers.ros.org/question/42743/how can modify "costmap" for "hecotr_exploration_planner"?http://answers.ros.org/question/65475/how-can-modify-costmap-for-hecotr_exploration_planner/hello, I'm using sonar and laser. I execute hlugv_apps on our robot as well. but I wanna mark some position in costmap (costmap_2d::LETHAL_OBSTACLE && costmap_2d::INSCRIBED_NFLATED_OBSTACLE). how can I do?Mohsen HkTue, 18 Jun 2013 21:55:20 -0500http://answers.ros.org/question/65475/how to edit costmap data manually?http://answers.ros.org/question/64923/how-to-edit-costmap-data-manually/Hello :) i wanna edit costmap data manually. i have x and y location of map data given by hector_mapping. and my costmap_2d_ros_ data is runs ok like this:
costmap_2d_ros_ = new costmap_2d::Costmap2DROS("global_costmap", tfl_);
how can i do?
costmap_2d::Costmap2D costmap_temp;
costmap_2d_ros_->getCostmapCopy(costmap_temp);
int map_width = costmap_temp.getSizeInCellsX();
int map_height = costmap_temp.getSizeInCellsY();
int num_map_cells = map_width * map_height;
const unsigned char* occupancy_grid_array;
occupancy_grid_array = costmap_temp.getCharMap();
geometry_msgs::PoseStamped lethal_obstacle;
point.pose.position.x=0.1;
point.pose.position.y=0.1;
if(??? QUESTION1 ???)
{
??? QUESTION2 ???=costmap_2d::LETHAL_OBSTACLE;
}
??? QUESTION3 ??? now convert costmap_2d::Costmap2D (costmap_temp) to costmap_2d::Costmap2DROS.
Mohsen HkWed, 12 Jun 2013 03:05:31 -0500http://answers.ros.org/question/64923/inscribed and circumscribed radii of the robot used despite footprint being sethttp://answers.ros.org/question/62277/inscribed-and-circumscribed-radii-of-the-robot-used-despite-footprint-being-set/Hi,
I've declared my robot's footprint in my common costmap params:
footprint: [[-0.7,-0.45], [0.70,-0.45],[0.70, 0.45],[-0.70, 0.45]]
and so **I haven't set inscribed or circumscribed radii**, because those can be figured out from my footprint.
Nevertheless, when I run move_base I get this warning:
[ WARN] [1367908257.219539023, 2.000000000]: You have set an inflation radius that is less than the inscribed and circumscribed radii of the robot. This is dangerous and could casue the robot to hit obstacles. Please change your inflation radius setting appropraitely.
Any idea why? Can I safely ignore this warning?
Thanks,
Ernest
ErnestMon, 06 May 2013 20:55:40 -0500http://answers.ros.org/question/62277/Providing odom to move_base through a map->odom tfhttp://answers.ros.org/question/62422/providing-odom-to-move_base-through-a-map-odom-tf/Hi,
I'm providing odometry to move_base through a map->odom tf provided by hector_mapping.
This means that my odom topic is empty, which I think is the cause of a host of warnings, such as:
[ WARN] [1368064440.957099892, 700.300000000]: Costmap2DROS transform timeout. Current time: 700.3000, global_pose stamp: 700.0000, tolerance: 0.3000
[ WARN] [1368064440.957199828, 700.300000000]: Could not get robot pose, cancelling reconfiguration
I have managed to make move_base ignore the lack of odom messages by going to costmap_2d_ros.cpp of the costmap_2d package and doing this (warning: this is a bad hack!):
// check global_pose timeout
if (current_time.toSec() - global_pose.stamp_.toSec() > transform_tolerance_) {
ROS_WARN_THROTTLE(1.0, "Costmap2DROS transform timeout. Current time: %.4f, global_pose stamp: %.4f, tolerance: %.4f",
current_time.toSec() ,global_pose.stamp_.toSec() ,transform_tolerance_);
return true;
// return false;
}
**My question: is this a dangerous workaround? Is there a better way to tell move_base to ignore the odom topic?**
Thank you in advance,
**EDIT**
Sometimes, the two times are **very** different, which leads me to think that they might be in different time epochs:
Costmap2DROS transform timeout. Current time: 1368081077.4015, global_pose stamp: 136.4000, tolerance: 0.3000
When this happens, the quick hack described above doesn't help..ErnestWed, 08 May 2013 16:02:00 -0500http://answers.ros.org/question/62422/Update costmap_2d with user defined no go zoneshttp://answers.ros.org/question/52652/update-costmap_2d-with-user-defined-no-go-zones/I am looking for a way to allow a user to dynamically add no go areas i.e. areas in the world that the robot planner should avoid. My idea is to modify the costmap_2d that move_base is using however there does not appear to be anyway to directly modify the costmap.
I noticed a similar question titled "Custom CostMap Values" (System won't let me paste the link) was asked on these forums and their idea was to either create artificial sensor data or modify move_base. Creating artificial sensor data I don't think would work since the real sensor data would clear out information added by the artificial sensor data. The other option is to modify the costmap_2d code to accept a message from the user and modify the costmap.
Can anyone think of another way to add dynamically created no go zones to a planner?crossThu, 17 Jan 2013 10:23:27 -0600http://answers.ros.org/question/52652/Obstacle clearing problemhttp://answers.ros.org/question/49781/obstacle-clearing-problem/Hallo!
I use kinect on my real robot and encountered with problem that costmap does not clear dynamic obstacles, if there's a lot of free space behind a obstacle (close to laser max_range). Phantom obstacles are smaller then the real one. In the picture there are my phantom steps as I crossed the long corridor four times in front of robot.
![Bug picture](http://farm9.staticflickr.com/8207/8246758407_81b4fd7f5d.jpg)
What I tried is to reset all obstacles in every mapUpdateLoop() step as recommended in [this post](http://answers.ros.org/question/10411/how-to-clear-older-costmap-just-before-updating-the-map/)
I added two strings
costmap_->resetMapOutsideWindow(wx, wy, 0, 0);
costmap_->updateWorld(wx, wy, observations, clearing_observations);
in the end of updateMap() function.
But that did not help much.
I use ROS Electric.
Peter ListovWed, 05 Dec 2012 04:37:08 -0600http://answers.ros.org/question/49781/Is it possible to use the costmap_2d in the robot local frame?http://answers.ros.org/question/48660/is-it-possible-to-use-the-costmap_2d-in-the-robot-local-frame/I'm using the costmap_2d implementation in a custom way (not the navigation stack). The costmap_2d provides the rolling_window parameter, but it not assures "a proper local-obstacle-representation". The rolling_window only assures that the robot will remain in the center of the costmap while the orientation may (and typically does) change.
I tried to set the costmap parameters ("global_frame" and "robot_base_frame") both to "base_link" frame. The execution looked to work more or less but the result was not as good as I expected. Old marked obstacles looks like they were moving and following the robot. They look how they should to have been cleared but they haven't been for some reason.
IMHO the clearing raytraces are too slim to remove old obstacles so they remain marked. Since we are working in the local frame obstacles looks like they were moving while the robot look stopped. My conclusions after the experiments is that the default costmap configuration does not look work so well for moving obstacles.
So I have some related questions:
- Are there any way to clear all the marker obstacles in each sensor reading?
- How can I improve the obstacle clearing when the scan resolution is poor regarding the costmap resolution?
- Using ros costmaps as local obstacle world representation is not typical. So, any additional consideration for not to use the costmap as a local representation of the world obstacles?Pablo Iñigo BlascoTue, 20 Nov 2012 01:19:30 -0600http://answers.ros.org/question/48660/costmap2D from 3Dpointcloudhttp://answers.ros.org/question/27608/costmap2d-from-3dpointcloud/I am trying to follow tutorial [http://www.ros.org/wiki/navigation/Tutorials/RobotSetup](http://www.ros.org/wiki/navigation/Tutorials/RobotSetup). After setting various prerequisites for launch, with move_base launch file, move_base node results in 2D costmap, obstacles, inflated obstacles etc. In rviz visualization, it is observed that obstacles detected are not getting cleared in subsequent published costmaps. Old obstacles becomes part of current costmap as well. Suddenly after sometime, everything is cleared and a correct cost map is displayed.
Am I missing setting up any specific parameter? Current all parameters are as advised in tutorial.
I had set "observation_persistence: 0.0" in costmap_common_params.yaml but it do not help.
Following is a set of screenshots of rviz
Screen 1:<a href="http://www.mediafire.com/imageview.php?thumb=3&quickkey=yp0zqv2sesddvts" target="_blank"><img src="http://www.mediafire.com/imgbnc.php/355cc7d8ef387349b25c013558d2ebeaf64013e1f8a64fc44e0564702db505d23g.jpg" border="0" alt="Unlimited Free Image and File Hosting at MediaFire" /></a>
Screeshot 2:
<a href="http://www.mediafire.com/imageview.php?thumb=3&quickkey=bvffz7nfk4kdt4s" target="_blank"><img src="http://www.mediafire.com/imgbnc.php/550e6ef2aa2492af43361c785674258d32d811a931c6d30d17aa002d93d3bde03g.jpg" border="0" alt="Unlimited Free Image and File Hosting at MediaFire" /></a>
Screeshot 3:
<a href="http://www.mediafire.com/imageview.php?thumb=3&quickkey=rzje8j0k44r45g4" target="_blank"><img src="http://www.mediafire.com/imgbnc.php/02c0a0b35691bccc2acd3f355597074866eebc5f216d34b64dd6e865b9df6eb33g.jpg" border="0" alt="Unlimited Free Image and File Hosting at MediaFire" /></a>
Screeshot 4:<a href="http://www.mediafire.com/imageview.php?thumb=3&quickkey=0qirj44b62pkbn5" target="_blank"><img src="http://www.mediafire.com/imgbnc.php/73572a9c8204431f0d6869bf470cb8c73f150cc1bf87b01ad58bdab2ab97a6e53g.jpg" border="0" alt="Unlimited Free Image and File Hosting at MediaFire" /></a>
Screenshot5:
<a href="http://www.mediafire.com/imageview.php?thumb=3&quickkey=rbdsz81r7k9k9dd" target="_blank"><img src="http://www.mediafire.com/imgbnc.php/4bca3cfa6c350e27b5e05daa9ff25dfd63fb353ea801c7f9f82bd9825ef7b50f3g.jpg" border="0" alt="Unlimited Free Image and File Hosting at MediaFire" /></a>
This is taken after around 12 seconds from screenshot4. Semicircles in front and back of robot are artifacts of costmap. It is plain road.
This is published on topic /move_base/local_costmap/obstacles.princeTue, 14 Feb 2012 05:25:46 -0600http://answers.ros.org/question/27608/costmap2DROS warning: " still waiting on the map" at launch of sbpl navigationhttp://answers.ros.org/question/30204/costmap2dros-warning-still-waiting-on-the-map-at-launch-of-sbpl-navigation/Greetings,
I am working on establishing path planning on Pioneer 3AT using ROS diamondback, Ubuntu 10.04. We had generated a map of floor using gmapping. We are using resultant map as static map for autonomous navigation.
Pioneer can do some path planning using navfn. It can execute the plan after a lot of rotations/oscilations. Stack is functional with Navfn.
We decided to use SBPL lattice planner for better path planning. Keeping all other costmap parameters same, we just changed the planner from Navfn to SBPL (obviously with relevant configrations). But we are facing a problem. On launching the move_base with SBPL planner as global planner, it just keep on waiting on map.
Following is the INFO message from Costmap2dROS
"... still waiting on map "
and This message comes exactly once and no planner is created! Normally I observe this message comes couple of times before a map is received.
On Digging in the code, i found this message is coded in costmap_2d_ros.cpp in following while loop:
113 while(!map_initialized_ && ros::ok()){
114 ros::spinOnce();
115 ROS_INFO("Still waiting on map...\n");
116 r.sleep();
117 }
costmap_2d class subscribes to /map topic for map. but the corresponding callback Costmap2DROS::incomingMap is not getting called. I can visualize the map in rviz. I had unchecked and checked /map topic multiple times. It always gets visualized. So I believe it is getting published correctly by map_server.
I have one more observation which I am not able to understand. On running following command
rostopic hz /map
i do not get anything on console! I expected i will get publishing frequency of map.
The rxgraph generates very different outputs for movebase with Navfn and sbpl planner.
The rxgraph output for move_base with Navfn is here: <a href="http://www.mediafire.com/?pt2ikau56vf171s" target="_blank">http://www.mediafire.com/?pt2ikau56vf171s</a>
The rxgraph output for move_base with sbpl planner is here: [rxgraph_sbpl.dot](http://www.mediafire.com/?d8ivdk7po8ug542)
These files are dot files can be visualized using dotty.
sbpl file shows a lot less published topic since planner is not created in this case. I had tried to keep the configuration parameters correct.
The launch files for similar to available with sbpl_lattice_planner. Following are my launch files:
ROSAria, Sick LMS , AMCL nodes are started with this launch file: <a href="http://www.mediafire.com/?t0r8nkc2xdf2ysv" target="_blank">http://www.mediafire.com/?t0r8nkc2xdf2ysv</a>
**For NavFn planner**, following files executes and try to follow path:
costmap_common_params.yaml, base_local_planner_params.yaml, global_costmap_params.yaml, local_costmap_params.yaml : <a href="http://www.mediafire.com/?4vcnmtyi12mcofk" target="_blank">http://www.mediafire.com/?4vcnmtyi12mcofk</a>
**For SBPL :** , a tar file containing
yaml and launch file are at: <a href="http://www.mediafire.com/?gt3wwdhio25s5sq" target="_blank">http://www.mediafire.com/?gt3wwdhio25s5sq</a>
I am not able to find out when similar configuration works in Navfn, then, why move_base keeps on **waiting on map** in case of sbpl launch configurations?
Any kind of hints or help will definitely help
Thank you
prince
**UPDATE1**
While trying to generate same error in simulation environment, i started changing launch files in sbpl_lattice_planner package. If I comment launch of stageros node, I gets same behavior. costmap2d_ros just waits.
For costmap2d_ros to function, I had published the map using map_server package and Laser data by connecting to sick using sick_toolbox_wrapper. princeWed, 21 Mar 2012 19:50:43 -0500http://answers.ros.org/question/30204/costmap_2d_ros always filled with lethal obstacleshttp://answers.ros.org/question/30082/costmap_2d_ros-always-filled-with-lethal-obstacles/I have made a node that keeps a local costmap_2d_ros object but currently it seems that the costmap is filled with all lethal obstacles (value 254) and I am unable to clear it. I based my code off of the code in the move_base package. I have pasted the relevant code below. In summary, I use the methods getCostmapCopy and getCharMap and print out the values in the char array. All the values are 254 and I then try using resetMapOutsideWindow with the window size being 0,0. The values are still all 254. Any advice would be greatly appreciated and if you need any more information I'd be happy to supply it.
namespace matrix_encoder {
class MatrixEncoder {
public:
MatrixEncoder(std::string name, tf::TransformListener& tf);
//~MatrixEncoder();
private:
tf::TransformListener& tf_;
costmap_2d::Costmap2DROS* encoder_costmap_ros;
costmap_2d::Costmap2D costmap; // The underlying costmap to update
const unsigned char* charArray; // pointer to the underlying unsigned char array used as the costmap
};
};
namespace matrix_encoder {
MatrixEncoder::MatrixEncoder(std::string name, tf::TransformListener& tf) :
tf_(tf), encoder_costmap_ros(NULL), charArray(NULL) {
ros::NodeHandle nh;
encoder_costmap_ros = new costmap_2d::Costmap2DROS("encoder_costmap", tf_);
encoder_costmap_ros->getCostmapCopy(costmap);
charArray = costmap.getCharMap();
int index = 0;
for (int j = 0; j < numXcells; j++) {
for(int i = 0; i < numYcells; i++) {
ROS_INFO("%d", charArray[index++]);
}
}
index = 0;
encoder_costmap_ros->resetMapOutsideWindow(0,0);
encoder_costmap_ros->getCostmapCopy(costmap);
charArray = costmap.getCharMap();
ROS_INFO("About to print cleared map");
for (int j = 0; j < numXcells; j++) {
for(int i = 0; i < numYcells; i++) {
ROS_INFO("%d", charArray[index++]);
}
}
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "encoder");
tf::TransformListener tf(ros::Duration(10));
matrix_encoder::MatrixEncoder matrix_encoder("matrix_encoder", tf);
ros::NodeHandle n;
ros::spin();
return 0;
}
ThomasBTue, 20 Mar 2012 10:54:43 -0500http://answers.ros.org/question/30082/costmap clearinghttp://answers.ros.org/question/28933/costmap-clearing/Hello!
I'm working with the navigation stack and I found some issues in the costmap clearing. I have one laser and some sonars and I use all of them to build the costmap. With the laser all works fine (the marking and clearing is done ok) with my sonars instead some of the obstacles remains in the costmap even if the sonar is publishing max_range. Each sonar is referenced to base link while the laser is refereced to base_laser_link in the costmap_common_params.yaml:
transform_tolerance: 0.2
obstacle_range: 2.0
raytrace_range: 2.5
observation_sources: base_scan sonar_cloud
base_scan: {sensor_frame: base_laser_link, data_type: LaserScan, topic:/base_scan_throttle , expected_update_rate: 0.3,
observation_persistence: 0.0, marking: true, clearing: true, min_obstacle_height: -0.08, max_obstalce_height: 2.0}
sonar_cloud: {sensor_frame: base_link, data_type: PointCloud, topic: /sonar_cloud, expected_update_rate: 0.3,
observation_persistence: 0.4, marking: true, clearing: true, min_obstacle_height: 0.0, max_obstalce_height: 2.0}
jrcaprilesThu, 01 Mar 2012 22:24:25 -0600http://answers.ros.org/question/28933/Best practices: checking a path with Costmap2DROShttp://answers.ros.org/question/28001/best-practices-checking-a-path-with-costmap2dros/Hi,
I have a populated Costmap2DROS object and a vector of poses which make up the robot's path. I need to verify that on every pose, the robot is not in collision.
It should be sufficient to check whether the pose lies within the robot's inscribed radius, although if the computational load is light enough I could check the robot's footprint.
What are the best practices for doing this with a Costmap2DROS? I have found that I can make a copy of the underlying costmap, but this seems inefficient.
Thanks!bkxMon, 20 Feb 2012 11:12:54 -0600http://answers.ros.org/question/28001/Costmap2d inflation radiushttp://answers.ros.org/question/12874/costmap2d-inflation-radius/I've been trying to increase the inflation radius of obstacles in the local_costmap for `move_base`. The problem that I've noticed is that the inflation radius as viewed by `Costmap2dPublisher` never changes. Using `rosparam get`, I verified that the `inflation_radius` parameter was correctly set, but even setting this value as high as 10m has no effect. It seems that the inflation radius of the obstacles is directly linked to the circumscribed radius of the robot footprint.
If I set the robot footprint to a 0.5m x 0.5m box, the inflation radius is 0.25m. If I set the robot footprint to a 0.8m x 0.8m box, the inflation radius is 0.4m. From the documentation on `costmap_2d`, it seemed that I could set my own inflation radius, but I've been unable to do so.
I would like to be able to set two different values for the `footprint` and the `inflation_radius`. How can I go about doing so?DimitriProsserFri, 03 Feb 2012 04:03:22 -0600http://answers.ros.org/question/12874/Navigation Stack does not use a map from Gmapping?http://answers.ros.org/question/12508/navigation-stack-does-not-use-a-map-from-gmapping/In navigation stack, the tutorial is based on a static map and amcl for localization. When using with slam, some people suggested just exclude the static map and amcl and run gmapping.
I already did that and it worked. However, when I looked into rxgraph, why the only topic move_base(Navigation stack) use from Gmapping is /tf and it does not use /map from Gmapping at all?
I've looked into the code and guessed it might create map by itself in costmap2D from laser scan in move_base node.
If this is true, would it be better to use the real map from Gmapping?
Only costmap from laser scan and correct position from Gmapping through /tf is enough correct?ParNurZealMon, 02 Jan 2012 19:28:02 -0600http://answers.ros.org/question/12508/