robot-motion / bench-mr

Motion Planning Benchmark
https://robot-motion.github.io/bench-mr
MIT License
80 stars 34 forks source link

Map from image resolution #37

Open pkicki opened 3 years ago

pkicki commented 3 years ago

Is it possible to load the environment map from the image with certain resolution i.e. 0.2m / px?

roym899 commented 3 years ago

Not directly, but you can specify the desired width and height. So if you use the Python interface, it should be relatively straightforward to first check the resolution of the image (with any image package), then compute the required desired width and height based on the scale (i.e., desired_width = actual_width * scale).

You can check the Image Grid Maze Notebook for an example on how to set desired width and desired height.

Note that the width and height will be the number of cells used for collision checking though. So if you want to do collision checking at 0.2m resolution, not losing any information in the image, you currently would have to think of the base unit as 20cm. I.e., the resulting distances would be multiples of 20cm and possibly you'd want to scale up the collision model accordingly. Another way of interpreting this is that the base unit for the GridMaze environment is always "cells".

I don't think that it is currently supported to specify the grid resolution explicitly to have a different base unit, correct me if I'm wrong @eric-heiden. I guess a scaling parameter similar to the PolygonMaze would be a nice addition.

pkicki commented 3 years ago

Thank you for the explanations. I found in the code the _voxelSize field and adopted it to serve as a 'resolution' parameter. I'll try to prepare a PR for it if you like.

ksatyaki commented 2 years ago

Over at my fork, I have now implemented a new environment MRPTGridMap You basically give it a ROS-type yaml file and it will load the image (at the resolution specified in the yaml file). If you simply have an image, you can easily write your own yaml file for use with the image. :-)

@palmieri maybe you want to merge this ?

palmieri commented 2 years ago

@ksatyaki which branch is this exactly?

ksatyaki commented 2 years ago

Fork rather: mod-wip branch on https://github.com/ksatyaki/bench-mr

you might want to cherry-pick since adding mod package as a submodule and making sure it compiles has not been tested entirely.