Calling gazebo/spawn_sdf_model service from rosJava

asked 2016-11-22 08:44:58 -0600

UserK gravatar image

updated 2016-11-22 12:25:59 -0600

I would like to call the spawn_sdf_model service from RosJava and update the simulation in Gazebo.

In order to spawn a model in gazebo I used a python node with the following code:

   rospy.wait_for_service("gazebo/spawn_sdf_model")
   delete_model = rospy.ServiceProxy("gazebo/delete_model", DeleteModel)
   # Use this service to spawn sdf model @ pose
   s = rospy.ServiceProxy("gazebo/spawn_sdf_model", SpawnModel)

   with open("/home/userk/.gazebo/models/coke_can/model.sdf", "r") as f:
            coke_xml = f.read()
   nameTable = "table1"
   roll = 0
   pitch = 0
   yaw = 0

I haven't found any documentation related to services and RosJava.

Question: How do I spawn a model in Gazebo from ROSJava?

edit retag flag offensive close merge delete