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,

Actually setting the friction force to thrusters will not assure constant speed due to the vehicle inertia. Vehicle needs to accelerate from stop so it will slowly gain speed. Furthermore friction depends on the velocity the vehicle is moving so you will need to dynamically adjust it. So the best option is use a controller, the most basic is a PID: wikipedia. There is a tutorial about how to create it in UWSim using Matlab/SImulink here, but it is pretty straight forward to implement it yourself.

Hi,

Actually setting the friction force to thrusters will not assure constant speed due to the vehicle inertia. Vehicle needs to accelerate from stop so it will slowly gain speed. Furthermore friction depends on the velocity the vehicle is moving so you will need to dynamically adjust it. So the best option is use a controller, the most basic is a PID: wikipedia. There is a tutorial about how to create it in UWSim using Matlab/SImulink here, but it is pretty straight forward to implement it yourself.

Edit:

Some comments after reading your problems, thrusters effort ranges from -1 to 1 so setting higher effort will not help. Also check keyboard controller is not running as it sends 0's to the thrusters effort (default dynamics launcher, runs this node). Anyway a big part of navigation involves controlling the vehicle speed, but if you are not testing this just use it in kinematic mode. About the oscillating speed in a PID try adjusting the parameters and use small values, obtaining good values is not trivial, there is a lot of research work about this. Just using a P controller with a small value should be enough to achieve a reasonable result like this: effort=(vel_reference-velocity)*P . It may not achieve the desired velocity or do it slowly but should work.