0
$\begingroup$

Rosanswers logo

I'm using Gazebo/ROS with TurtleBot. My robot needs to find the distance from itself to all the obstacles that exist in the environment. I believe Laserscan has this information, but I am not sure how can I get the position of the models from Gazebo and reuse them in ROS with rospy. Can someone help me with some examples/tutorials?


Originally posted by Turtle on ROS Answers with karma: 41 on 2017-03-27

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The Gazebo ROS interface is designed to simulate the interface that the robot would see in the real world as closely as possible. The generic goal is that the robot software should not know the difference between the real world and the simulated world.

Because of that the position of all obstacles is not made available from the simulator. You can use tools like laser scanners to make estimates of the observable obstacles. This is one of the fundamental elements of robotics to build a model of the world around the robot to allow it to operate. There are many different approaches for different application areas. Some are more mature like 2D navigation or plain object recognition

If you really want all the obstacles with ground trute from the simulator you need to write a plugin and give it a ROS interface. To make that happen please read through some of the Gazebo Tutorials on that topic.


Originally posted by tfoote with karma: 58457 on 2017-03-27

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Turtle on 2017-03-28:
Thank you for the answer! You say I can "use tools like laser scanners to make estimates of the observable obstacles". I have searched about this but have not found a good solution yet. Do you have any code examples about how I can use laser scanner for this problem?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.