4.5 Control Output

To control the vessel, guidance systems will be expected to continuously output a vector of 3 forces, in surge (forward/backward), sway (lateral) and yaw.

The example_ros_client node is published to the /force_control topic and expects ‘GeneralizedForce’ messages. The message is built up of 3 forces, one for each translational degree of freedom, as well as 3 torques, for each rotational degree of freedom.

GeneralizedForce( 
x = force.x, 
y = force.y, 
z = force.z, 
k = force.k, 
m = force.m, 
n = force.n, 
) 

As the vessel is only actuated in 3 degrees of freedom (x, y and n), the remaining 3 forces (z, k and m) are ignored and should be set to 0.

The force controller accepts inputs between -100 and 100, where 100 results in full throttle. Larger inputs will be constrained back down to ±100.

The force controller can be tested by opening a terminal window in the virtual machine and tweaking the values in the following command:

source catkin_ws/devel/setup.bash

rostopic pub /force_control ros_clients/GeneralizedForce "{x: 0.0 , y: 0.0 , z: 0.0 , k: 0.0 , m: 0.0 , n: 0.0}"

This method will continuously apply the requested force until the command is canceled (ctrl+c) and run again with different values.

Last updated