move_base publishes on cmd_vel topic but robot does not move when commands are sent from 2dnavgoal

asked 2021-07-02 11:12:06 -0600

serna0125 gravatar image

i have built a custom differential robot with a rpi 3B+, RPlidar A1 and DC motors (with encoders) controlled through arduino and a motor controller (running ROS melodic). I have 2 launch files, the 1st with the bringup of the robot where i launch the urdf, lidar, odometry and serial nodes (for comm with arduino) and the 2nd file with the amcl_diff.launch and all parameters for global and local maps as required by the nav stack.

The thing is, when i launch the teleop twist keyboard node, i can control the robot and it moves OK, but when i send a 2d nav goal through rviz, although the move_base is publishing on the cmd_vel topic, the robot does not move, and thus i have 2 questions:

  1. Any help on what may be happening on any parameter or configuration i may be missing?
  2. Is there any failsafe or anything similar that stops the robot from moving even though move_base is publishing data on the cmd_vel topic and arduino is subscribed to this topic? (This question is bugging me because trying to debugg this, i sent a 2d nav goal through rviz and also tried to move the robot using the teleop twist keyboard node and the robot moves a bit and stops, if i send another command from the keyboard, again the robot moves and then stops (without me sending commands again), but it keeps ignoring the commands from move_base?)

On the following link i have some screenshots of the CPU usage from RPi, another one from rviz where you can see the robot, the goal generated and its global and local paths, another one from the echo of the cmd_vel topic when the 2dnav goal is sent (with those values or less i can still move the robot manually when using the teleop twist keyboard), tf tree and the parameters of the planner.

edit retag flag offensive close merge delete


1) Have you checked the frequency of the cmd_vel published by move_base? It may not be frequent enough to drive the motors? Also having both teleoperation and move_base active simultaneously may create unwanted behaviors.

2) It is possible to add a physical button and check the state of the button to prevent Arduino from driving the robot even if it takes cmd_vel callbacks or you can also create a ROS service to set some sort of flag inside your Arduino code to prevent cmd_vel callback functions from driving your motors.

rappy gravatar image rappy  ( 2021-07-06 14:32:36 -0600 )edit