Turtlebot and handmade teleop - about topics
Hello, trying to move the turtlebot with a node but i was not able to make it,
is the status of my experiment, using the minimal.launch
and this is the code of the talker:
#include "ros/ros.h"
#include "geometry_msgs/Twist.h"
int main(int argc, char** argv) {
ros::init(argc, argv,"talker");
ros::NodeHandle n;
ros::Publisher control_pub = n.advertise<geometry_msgs::Twist>("/cmd_vel_mux/input/teleop",1);
ros::Rate loop_rate(10);
int count = 0;
while(ros::ok()) {
geometry_msgs::Twist twist;
twist.linear.x = 2.0;
twist.linear.y = 0.0;
twist.linear.z = 0.0;
twist.angular.x = 0.0;
twist.angular.y = 0.0;
twist.angular.z = 1.0;
control_pub.publish(twist);
ros::spinOnce();
loop_rate.sleep();
++count;
}
return 0;
}
The question is: /cmd_vel_mux/input/teleop
is the right topic to subscribe? (tried /cmd_vel
but still not working)
Actual status: The messages are being published but the turtlebot isnt moving.
Thanks beforehand!
It stills without moving, what else can you suggest me?
Did the official turtlebot_teleop work on your robot?
roslaunch turtlebot_bringup minimal.launch
roslaunch turtlebot_teleop keyboard_teleop.launch
Have you ever succeed to move you robot ? When you send comand on /cmd_vel_mux/teleop/input, do you echo anything on /mobile_base/commands/velocity?
yes I made the tutorials, follower and keyboard_teleop, but in this particular case, I think that i am not subscribing to the correct topic for the turtlebot. (I thought at the beginning that /cmd_vel was the right topic to subscribe, but it wasn't)
ok cool! in this case all you need to do is run teleop and check (rqt_graph) to which topic the commands are sent and use the same topic for your custom teleop.
Taking a look and compairing the keyboard teleop of the tutorials with my solution is the same when we talk about topics conection, the messages are published but the robot doesnt move, do i have to publish something more apart of the twist message?
Please marguedas convert your first comment to an answer to mark it like correct and close this thread.
did you finally succeed to make it move ?
yes, thanks