Robotics StackExchange | Archived questions

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 .

Asked by Anthony Brooks on 2015-03-23 02:34:10 UTC

Comments

Answers

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/Tutorials/Configuring%20Layered%20Costmaps and I have an example in http://answers.ros.org/question/185605/getting-costmap_2d-to-update-with-laserscan-data/ (though set negate to 1 as I eventually figured out).

Asked by lucasw on 2015-03-23 10:43:32 UTC

Comments