subscibe from Model state in Gazebo
how can i subscribe to /gazebo/model_states ? Sorry, i am a beginner an did not understand it, yet.I read the tutorial but it does not help me.I want to get the x,y and z Position of my model. For beginning i write this.But how to go on ?
ros::Subscriber xyz_subscriber_;
void ModelStatecallback(const gazebo_msgs::ModelStates::ConstPtr& msg)
{
}
xyz_subscriber_ = node_handle_.subscribe</gazebo/model_states>("currentposition", 1, ModelStatecallback);
};