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

Revision history [back]

click to hide/show revision 1
initial version

Hi, I noticed in your cmd_vel subscriber, you have declared a queue size of 1000 messages for the cmd_vel topic.

From the ROS wiki,

ros::Subscriber subscribe(const std::string& topic, uint32_t queue_size, <callback>, transport_hints)

This implies that there is a backlog of 1000 velocity commands in the subscriber queue and hence your base controller will not be processing the latest command given by your joystick but rather a command given a few seconds ago. To fix this, simply set a smaller queue size. A queue size of 1 will ensure that only the latest command from the joystick will be interpreted but at the cost of ignoring some older commands since likely your joystick will publish command values faster than the base_controller node can process them. So you can balance out these 2 requirements and select a queue size between 1 and 10 and still receive "real time" response to your controller.

Hope that helps.