# Revision history [back]

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.

There are some instructions onhttp://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).

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 onhttp://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).

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 onhttp://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).

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 onhttp://wiki.ros.org/costmap_2d/Tutorials/Configuring%20Layered%20Costmaps 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).