Giter Club home page Giter Club logo

collision_map_creator_plugin's Introduction

Collision map creator plugin

This is a fork of Stephen Brawner's collision_map_creator_plugin for Gazebo with the major difference that you can choose which entity to treat as ground (useful for table-top robotics), e.g. by speciying collision entity or setting a minimum height.

How to compile

mkdir build
cd build
cmake ..
make

How to use

Add the plugin to your world file

    ...
    <plugin filename="libcollision_map_creator.so" name="collision_map_creator"/>
  </world>
</sdf>

Run the Gazebo simulation, but make sure to copy the libcollision_map_creator.so to a folder inside your GAZEBO_PLUGIN_PATH, or add the build folder to that path before running, e.g.:

GAZEBO_PLUGIN_PATH=PATH/TO/collision_map_creator_plugin/build/ gazebo <worldfile>

Request to create the collision map

$ ./request_publisher "(-10,-10)(10,10)" 10 0.01 $(pwd)/map.png 255 office_desk::link::collision

This will create a PNG file called ./map.png which contains the bird's-eye view from 10 meters above of the area specified by the bounds (-10,-10)(10,10) at a resolution of 0.01 meter per pixel. The collision entity office_desk::link::collision is treated as the ground and represented by white color in the image. Everything else is colored in black (255 - 255 = 0).

Request to create the collision map in a height interval

$ ./request_publisher "(-10,10)(10,10)" 10 0.01 $(pwd)/map.png 255 office_desk::link::collision 0.8

The last parameter tells the plugin to consider only the parts of the entity office_desk::link::collision that lie between 0.8 and 10 meters as ground. The default value is 0.

Parameters

  1. Region of interest with corner coordinates (meter): (lowerleft.x, lowerleft.y)(upperright.x, upperright.y)
  2. Height from which map is created (meter)
  3. Resolution (meter per pixel)
  4. Path where the png file will be stored. (Hint: this is relative to Gazebo's working directory, e.g. ~/.ros/ or use a full path.)
  5. (optional) threshold: which value to use for objects (default: 255)
  6. (optional) ground entity name: which Gazebo entity to treat as ground (default: ground_plane::link::collision)
  7. (optional) minimum height (meter): everything below this height will also be treated as obstacles (default: 0)

Coordinates are with respect to the collision object's reference coordinate system:

sketch

Example

You will find a world example in world/simple.world with three primitives which can be run as follows:

$ gazebo /path/to/repository/world/simple.world

Gazebo screenshot of simple.world

simple.world

./request_publisher "(-5,-3)(4,5)" 0.1 0.04 $(pwd)/map.png 255 ground_plane::link::collision

The created images are flipped, because the y-axis points down in images. Furthermore, the height was chosen to be 10 cm which is a common LiDAR height and thus, the footprint of the sphere at this height is much smaller. The following created image is flipped afterwards for correct visualization (e.g. by $ convert map.png -flip map_flip.png):

map_flipped

collision_map_creator_plugin's People

Contributors

brawner avatar caguero avatar jexner avatar nkoenig avatar ronwalf avatar scpeters avatar tik0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

collision_map_creator_plugin's Issues

I'm getting an error

/home/user/Pulpit/collision_map_creator/collision_map_creator.cc:3:10: fatal error: boost/gil/gil_all.hpp: There is not directiory
3 | #include <boost/gil/gil_all.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Is it required to install Boost or something like this?
I tried to download this:
https://www.boost.org/users/history/version_1_68_0.html
It' will be ok?

Edit:
I've installed boost, but it didn't work for me... :(

Can you help me?

how to get the map of a certain height

Hi,
I wonder whether it is possible to get a map of a certain height?For instance, I want to get map above ground 0.29m which is mouting height of my laser scanner. The map will be used to compare with the SLAM output.Any idea will be highly appreciated!
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.