reference example for cmd_vel command subscriber
Hi, I would like to move a gazebo model using a twist messages (geometry_msgs/Twist) that come from keyboard input. I managed to run teleop_twist_keboard node (rosrun teleop_twist_keyboard teleop_twist_keyboard.py) to generate these messages. I tried to pipeline these messages to ros node that move my model using this code
void OnTwistMsg(const geometry_msgs::TwistConstPtr &_msg) {
this->model->SetWorldTwist (ignition::math::Vector3d{_msg->linear.x,_msg->linear.y,_msg->linear.z},
ignition::math::Vector3d{_msg->angular.x,_msg->angular.y,_msg->angular.z}
, true);
Assuming all nodes are correctly created and this message was subscribed properly. I'm not sure the model twist function is the right function to use. Can you point me to some reference code of similar subscriber? Should I use the Twist message ?
Thanks a lot Tal