ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

local map subtraction for moving object detection

asked 2014-08-22 06:24:47 -0600

AliAs gravatar image

updated 2014-08-27 18:57:59 -0600

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?


edit retag flag offensive close merge delete


You need good localisation to get good results from subsraction.

bvbdort gravatar image bvbdort  ( 2014-08-24 08:45:39 -0600 )edit

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.

AliAs gravatar image AliAs  ( 2014-08-25 06:43:31 -0600 )edit

Can you post on how you had achieved this?

pravi gravatar image pravi  ( 2020-11-18 12:17:53 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-08-23 12:59:41 -0600

David Lu gravatar image

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 package which will help with putting the laser into a grid.

edit flag offensive delete link more


Thank you. I will study the package and report the result here.

AliAs gravatar image AliAs  ( 2014-08-25 06:53:56 -0600 )edit

According to 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)

AliAs gravatar image AliAs  ( 2014-08-25 12:13:10 -0600 )edit

I would look at the implementations of costmap_2d's mapToWorld and worldToMap functions.

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

David Lu gravatar image David Lu  ( 2014-08-25 15:42:47 -0600 )edit

Thank you. As 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)

AliAs gravatar image AliAs  ( 2014-08-26 05:47:57 -0600 )edit

I ask it as an another question here:

AliAs gravatar image AliAs  ( 2014-08-26 09:08:34 -0600 )edit

Question Tools



Asked: 2014-08-22 06:19:58 -0600

Seen: 1,412 times

Last updated: Aug 27 '14