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

Revision history [back]

Exactly what type of actuator are you controlling? This information will help us understand your problem.

However I can see a problem with your approach. You're publishing acceleration command messages as fast as the computer is able to not at a fixed rate. This is probably resulting in message buffers filling up and overflowing.

You cannot assume that because you publish acceleration commands for a fixed amount of time, they will be received for that same fixed amount of time, due to buffering problems amongst others. This is probably the cause of your problem.

If you use a ros::Rate object to set the rate of your two while loops to something sensible such as 100 Hz. This may help alleviate the problem but reaching point p2 will probably still be a challenge.

If there is position feedback on your actuator a closed loop solution would probably be a much better way to go.

You probably also want to look into Trapezoidal velocity control because there may be a maximum velocity that has to be adhered to as well.

Hope this helps.