# how to mark a special thing in a occupy map?

Hello everyone:

I am making a 'DIY' robot , now I want to mark some special mark (red dot......)in the occupy map (made by SLAM) when I found some special things from the usb_cam. Could anybody give me some advise ,thanks a lot .

edit retag close merge delete

Sort by » oldest newest most voted

You could create a special 'fake' LaserScan publisher to inject obstacles into the costmap. Put the LaserScan into the same frame as the usb_cam (or possibly rotated 90 degrees if the depth convention of cameras vs. lasers is different, I forget). When you detect something in the camera, publish a synthesized laser scan.

sensor_msgs/Range would make more sense but last I looked that isn't supported by the costmap node (it would also be great to have a direct message to set a certain x,y location to lethal obstacle or clear it).

You have to set the LaserScan to generate 2 or 3 points in a tight beam even if you only really wanted one- I encountered what might be a bug where a single point LaserScan did not get processed properly. As long as the points are close to each other they should be fine. You could also generate a point cloud.

Don't generate obstacles inside the robot footprint, if I remember correctly they get automatically cleared.

There are some instructions on http://wiki.ros.org/costmap_2d/Tutori... and I have an example in http://answers.ros.org/question/18560... (though set negate to 1 as I eventually figured out).

more