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

Using a laser scan/point cloud to set work-area boundaries

asked 2017-10-17 22:24:07 -0500

rmck gravatar image

Can anyone recommend a way to use a laser scan or point cloud to limit the areas a fixed-base robot arm will try to reach? I've got a 2D lidar mounted behind the arm that scans the walls and ceiling, giving a roughly parabolic profile. The arm has sufficient reach and maneuverability that it could easily reach and collide with the walls or ceiling. I can assume that the output of the scanner approximately matches the profile directly ahead and behind the position of the arm.

Is there a simple way to set the laser scan as the Y and Z boundaries of the work-area? Since the scans are loosely parabolic I can't just set a square work area limit or create a work cell like in ROS Industrial.

I'm using MoveIt and ROS-Control to control the arm. I'm essentially trying to use the arm to paint the walls and ceiling of the space. I've included a fake link on the URDF that traces the surface profile so collision is avoided there. However, some times other links will move outside the laser scan space which would lead to a collision in real world usage.

Any advice or recommendations appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-17 23:28:19 -0500

rmck gravatar image

updated 2017-10-18 16:32:04 -0500

I realised a simple solution here was to fake additional 3D scans and pass these as a point cloud to the MoveIt sensor manager. This allows the octomap occupancy tool to work correctly. This in turn provides collision checking. Working as expected now. Here's my code for anyone else looking to do similar.

void fakeProfile(PointCloud::Ptr cloud)
{
    PointCloud add_cloud(*cloud);
    for(int j = 0; j < 10; j++)
    {
        PointCloud temp_cloud(*cloud);
        for (int i = 0; i < cloud->points.size(); i++)
        {   
            temp_cloud.points[i].x += double(j);
        }
        add_cloud += temp_cloud;
    }
    *cloud += add_cloud;
}

And then using the standard moveit sensors.yaml,

    sensors:
      - sensor_plugin: occupancy_map_monitor/PointCloudOctomapUpdater
        point_cloud_topic: /extended_profile
        max_range: 25.0
        point_subsample: 1
        padding_offset: 0.1
        padding_scale: 1.0
        filtered_cloud_topic: filtered_cloud

Edit: The result is shown below, the nearest points are the real scan, the subsequent ones are the faked scans. In my use case, I can guarantee that the area ahead of the robot is clear so only a vertical scan is needed. The scan used here is of my office walls rather than the real work area, hence the square shape.

faked laser scans

And here's the resulting octomap. I need to refine it a little further, the robot does keep finding ways to reach through the gaps in the scans but that's easily resolved. image description

edit flag offensive delete link more

Comments

This sounds interesting, but I'm having a bit of a hard time trying to visualise it. Any chance you could clarify things a bit and / or include an image of what the result looks like?

Are you essentially creating an arc shaped 'wall' that cordons off the planning volume?

gvdhoorn gravatar image gvdhoorn  ( 2017-10-18 02:35:24 -0500 )edit

Sort of, the laser scan represents the surface I want to paint and which I don't want to collide with. I have a fake link on my end effector which I send commands to "touch" the points along the profile. Have a look at the photos I've added to my answer.

rmck gravatar image rmck  ( 2017-10-18 16:35:01 -0500 )edit

Thanks for the update. This makes it completely clear.

Nice idea.

Btw: you might be interested in the laser_assembler package. It can do this - and more - for you.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-19 02:53:58 -0500 )edit

What would you suggest doing differently? A quick glance over the assembler package isn't making anything leap out at me.

rmck gravatar image rmck  ( 2017-10-22 17:17:20 -0500 )edit
1

Probably it can be configured to do the same thing, but reusing that node could mean less custom code to maintain, something I believe is always something to strive for.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-23 01:27:51 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2017-10-17 22:24:07 -0500

Seen: 901 times

Last updated: Oct 18 '17