Hi,
I need to read the map's information in a ROS node. But how do I export the 3D map created in v-rep as a 2D map? The height is not important, I just need to get the size of the room and the position and size of obstacles. Is this possible?
Thanks
Nika
How to export a 2D-map?
Re: How to export a 2D-map?
Hello Nika,
the easiest would be to have a vision sensor over the terrain. Have a look at this simple example. You can adjust the refresh rate of the vision sensor inside of the child script it has attached.
Then, if you need to stream that image to ROS, you could start a publisher with:
Cheers
the easiest would be to have a vision sensor over the terrain. Have a look at this simple example. You can adjust the refresh rate of the vision sensor inside of the child script it has attached.
Then, if you need to stream that image to ROS, you could start a publisher with:
Code: Select all
topicName=simExtROS_enablePublisher('visionSensorData',1,simros_strmcmd_get_vision_sensor_image,mapSensor,0,'')
Re: How to export a 2D-map?
Thanks for your answer. So, as I see it right, I need to have v-rep running to do this? It's ok as long as I use the simulation, but is there an opportunity to use the map's data when running the real system without the simulation?
Re: How to export a 2D-map?
hmmm print screen?
cheers Eric
cheers Eric
Re: How to export a 2D-map?
Well, you can read the map via a customization script also while simulation is not running.
But publishers and subscribers will only run during simulation, except for the info publisher. So you could slightly modify the ROS plugin as to enable the publisher you need also while simulation is not running.
Cheers
But publishers and subscribers will only run during simulation, except for the info publisher. So you could slightly modify the ROS plugin as to enable the publisher you need also while simulation is not running.
Cheers
Re: How to export a 2D-map?
printing the screen doesn't give me the resolution and size of the walls and obstacles. In ROS, I want to use only the map as a costmap2d input. So I'm acutually looking for a solution to extract the static map out of v-rep, the ROS map_server needs the following: "Maps manipulated by the tools in this package are stored in a pair of files. The YAML file describes the map meta-data, and names the image file. The image file encodes the occupancy data."
So I can't just subscribe to a topic, I need the data offline as a 2D picture.
So I can't just subscribe to a topic, I need the data offline as a 2D picture.
Re: How to export a 2D-map?
if you need the data offline, as a picture, and a screenshot doesn't work for you, then you could export the data from within your child script. I would suggest a simple binary file for simplicity.
Cheers
Cheers