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

My Robot doesn't stops even if cmd_vel is not Published.Why ?

asked 2016-08-25 03:52:33 -0600

Aasiya Shaikh gravatar image

Hello I am using teleop_twist_keyboard to generate cmd_vel ( geometry_msgs/twist). The Robot successfully subscribes this cmd_vel and moves .

I am using A proportional–integral–derivative controller (PID controller) which is a control loop feedback mechanism (controller) for the robot. This loop takes 1 0r 2 seconds to achieve the required generated cmd_vel .

As we knew If I stopped pressing the keys of keyboard then the cmd_vel shouldn't be published and then the robot should also stop moving.

But in my case this doesn't happens means my robot is taking the last value of generated cmd_vel and it never stops.So please can any one suggests why this is happening ? Why the robot doesn't stops ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-08-25 09:01:30 -0600

Marcin Bogdanski gravatar image

What is the receive logic on your robot?

If you set PID target when you receive cmd_vel, then your robot will be stuck on last received value, disregarding how old it is. If cmd_vel topic just stops, your robot will carry on using last cmd_vel

Most probably you need to check for timeout, e.g. if no message was received in last 1 second, then set PID target to zero. This way if cmd_vel cut's off, then robot will carry on for 1 second, then timeout will kick in and set PID target to zero, which in turn will stop the robot.

If my understanding of your problem is wrong, please edit your question to include relevant source code section from your robot.

edit flag offensive delete link more

Comments

Thank you , your suggestion was right and it worked .

Aasiya Shaikh gravatar image Aasiya Shaikh  ( 2016-08-27 03:23:31 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-08-25 03:52:33 -0600

Seen: 684 times

Last updated: Aug 25 '16