0
$\begingroup$

Rosanswers logo

Hello, trying to move the turtlebot with a node but i was not able to make it,status

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!


Originally posted by pexison on ROS Answers with karma: 82 on 2015-02-10

Post score: 0


Original comments

Comment by pexison on 2015-02-11:
It stills without moving, what else can you suggest me?

Comment by marguedas on 2015-02-11:
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?

Comment by pexison on 2015-02-11:
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)

Comment by marguedas on 2015-02-11:
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.

Comment by pexison on 2015-02-12:
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?

Comment by pexison on 2015-02-12:
Please marguedas convert your first comment to an answer to mark it like correct and close this thread.

Comment by marguedas on 2015-02-12:
did you finally succeed to make it move ?

Comment by pexison on 2015-02-12:
yes, thanks

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

As I remember this was the topic I was publishing to. Does the turtlebot_teleop node works on your robot ? According to the code it's publishing (through the velocity smoother) to /mobile_base/commands/velocity. Maybe you can give it a try


Originally posted by marguedas with karma: 3606 on 2015-02-10

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.