Hi would like to be notified when the position of an object in gazebo changes. I have found the following options:
1. Subscribe to gazebo/ModelStates and check for the object attributes
2. Use the service call Get_model_state provided by Gazebo to retrieve state and property information about the object
I am trying the first one since I haven't found any documentation about calling a gazebo service from ROSJava. Check [here](http://answers.ros.org/question/248630/calling-gazebospawn_sdf_model-from-rosjava/)
I started with the basic Subscriber from the official RosJava documentation. Now I need to define a new subscriber
Subscriber subscriber = connectedNode.newSubscriber("chatter", gazebo_msgs.ModelStates._TYPE);
subscriber.addMessageListener(new MessageListener() {
@Override
public void onNewMessage(gazebo_msgs.ModelStates message) {
log.info("I heard: \"" + message.getName() + "\"");
}
});
I would like to subscribe to a topic which exchanges gazebo_msgs/ModelStates messages.
string[] name # model names
geometry_msgs/Pose[] pose # desired pose in world frame
geometry_msgs/Twist[] twist # desired twist in world frame
Catkin_make returns the error:> gazebo_msgs does not exist > Subscriber> subscriber => connectedNode.newSubscriber("chatter",> gazebo_msgs.ModelStates._TYPE);
**Question**
How do I include this type of message in ROSJava?
↧