TurtleBot movement is not smooth; Twist message sequences published from workstation

asked 2017-03-10 00:50:13 -0600

TravelAmerica gravatar image

How can I make a real TurtleBot to move along straight-line and goes smoothly? except for using the turtlebot_teleop keyboard control.

On the console, running command "rostopic pub -r 30 /mobile_base/commands/velocity geometry_msgs/Twist '{linear: {x: 0.2, y: 0, z: 0}, angular: { x: 0, y: 0, z: 0}}'", the real bot does go straight-line, but not in smooth manner, the bot goes and shakes, mixed with frequent brakes.

Alternatively, below is my code to have turtlebot move forward smoothly. After run the program, however TurtleBot's straight-line movement is not smooth at all, the bot sounds like stop and go, stop and go, shakes vibrantly, mixed with frequent brakes. Does anyone have thoughts on this behavior?

BTW, the turtlebot_teleop keyboard control can make the bot move smoothly. All these controls are issued from workstation PC through WiFi to the notebook on the bot.

for (unsigned i = 0; i < ticks; ++i) {

    geometry_msgs::Twist msg;
    msg.linear.x = linear_speed;
    msg.linear.y = 0;
    msg.linear.z = 0;

    msg.angular.x = 0;
    msg.angular.y = 0;
    msg.angular.z = 0;

edit retag flag offensive close merge delete