0
$\begingroup$

Rosanswers logo

Hi all,

I am new in ROS and I am going to do a subtraction between a current laser measurement map at time t and time t-1 for moving object detection. the procedure is as follow:

  1. Convert laser measurement at time t to 2d grid form that contain free and occupied cells (I call it laser measurement map).
  2. Limit this (2d grid) laser measurement map in a rectangle with edge size of lets say 5 meters. So the robot can see 2.5 meters ahead, back, left and right.
  3. Next, I am going to do a subtraction between a current laser map at time t and laser map provided at time t-1. (each laser map associated with odometry data, so the laser measurement map provided at time t-1 will be projected on laser measurement map at time t, and subtraction is done in the joint area).

Could you please guide me how to do it with already available packages in ROS? I found two related packages: costmap_2d and Gmapping. I don't know if there is better packages available to use? Based on your experience which one has a potential to use for this purpose? What steps should I take to do it?

Thanks.


Originally posted by AliAs on ROS Answers with karma: 63 on 2014-08-22

Post score: 3


Original comments

Comment by bvbdort on 2014-08-24:
You need good localisation to get good results from subsraction.

Comment by AliAs on 2014-08-25:
Yes, I am going to use Xsens IMU. Next, I will prune the result (remove small false detected regions) and just keep significant parts that I hope provides moving objects.

Comment by pravi on 2020-11-18:
Can you post on how you had achieved this?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I don't believe there is an existing package that does this. The costmap_2d package is likely overkill for what you're trying to do. You might want to check out the http://wiki.ros.org/laser_geometry package which will help with putting the laser into a grid.


Originally posted by David Lu with karma: 10932 on 2014-08-23

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by AliAs on 2014-08-25:
Thank you. I will study the package and report the result here.

Comment by AliAs on 2014-08-25:
According to http://wiki.ros.org/laser_geometry package it just converts a 2D laser scan into a point cloud. But I need an occupancy grid not a point cloud! (I am using kinect and I already transformed the 3d point cloud to laser scan with depthimage_to_laserscan package)

Comment by David Lu on 2014-08-25:
I would look at the implementations of costmap_2d's mapToWorld and worldToMap functions. https://github.com/ros-planning/navigation/blob/hydro-devel/costmap_2d/src/costmap_2d.cpp#L199

Then use that to write your own specific script for your use case.

Comment by AliAs on 2014-08-26:
Thank you. As http://wiki.ros.org/costmap_2d says: costmap_2d only subscribes [/footprint (geometry_msgs/Polygon)]. It seems the costmap_2d doesn't subscribe the (sensor_msgs/LaserScan) that I have it published. what should I do to have costmap_2d subscribed to /scan topic? (I'm trying to use standalone costmap_2d node to check if it works)

Comment by AliAs on 2014-08-26:
I ask it as an another question here: http://answers.ros.org/question/191283/laser-scan-to-occupancy-grid-using-costmap_2d-new-user/

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.