ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Turtlebot and handmade teleop - about topics

asked 2015-02-10 03:47:00 -0500

pexison gravatar image

updated 2015-02-12 07:16:10 -0500

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!

edit retag flag offensive close merge delete

Comments

It stills without moving, what else can you suggest me?

pexison gravatar image pexison  ( 2015-02-11 04:40:53 -0500 )edit

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?

marguedas gravatar image marguedas  ( 2015-02-11 08:54:42 -0500 )edit

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)

pexison gravatar image pexison  ( 2015-02-11 09:33:33 -0500 )edit

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.

marguedas gravatar image marguedas  ( 2015-02-11 10:01:11 -0500 )edit

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?

pexison gravatar image pexison  ( 2015-02-12 05:58:13 -0500 )edit

Please marguedas convert your first comment to an answer to mark it like correct and close this thread.

pexison gravatar image pexison  ( 2015-02-12 08:43:15 -0500 )edit

did you finally succeed to make it move ?

marguedas gravatar image marguedas  ( 2015-02-12 10:01:14 -0500 )edit

yes, thanks

pexison gravatar image pexison  ( 2015-02-12 10:08:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-02-10 07:35:26 -0500

marguedas gravatar image

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

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-02-10 03:47:00 -0500

Seen: 1,343 times

Last updated: Feb 12 '15