0
$\begingroup$

Rosanswers logo

Hi there, Is it possible to obtain the co-ordinates of an obstacle that we manually add in Gazebo ? I want to write a ros node such that the user adds the obstacle initially and then the node obtains that position of obstacle from Gazebo and modifies its x-cordinate. Is this possible ?


Originally posted by ktiwari9 on ROS Answers with karma: 61 on 2015-08-17

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You can probably achieve what you want by using the Gazebo services that are available when you start gazebo with ROS support. Once Gazebo is started you can do a

rosservice list

and you should multiple services offered by Gazebo that allow retrieving model properties, spawning models, moving them etc (here are the srv definitions).

Most services offered are also described in the Gazebo "Connect to ROS" tutorial.


Originally posted by Stefan Kohlbrecher with karma: 24361 on 2015-08-17

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by ktiwari9 on 2015-08-17:
So in the Connect to ROS tutorial they mention something like rosservice call /gazebo/set_model_state to spawn a coke can at a specific location and orientation, Is it possible to do this via a ROS node ?

Comment by Stefan Kohlbrecher on 2015-08-17:
Yes, you can cal ROS service from the command line (by typing "rosservice call ...", but you can of course also call them from code (see Python or C++ tutorials for "Writing a Simple Service and Clieant" here: http://wiki.ros.org/ROS/Tutorials).

Comment by ktiwari9 on 2015-08-18:
Hi Stefan, Please see my comments above. I uploaded my code and I have some trouble adding both pedestrian and robot to the scene. Could you help me out ?

$\endgroup$

Your Answer

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