Skip to content

vrx_classic_thruster_articulation_tutorial

M1chaelM edited this page May 5, 2023 · 1 revision

Propulsion: Thruster Articulation

Description

The VRX simulator supports the ability to rotate thrusters to change the direction of their thrust. This capability is enabled by default.

Controlling thruster articulation with rqt_publisher

The rqt_publisher tool provides a convenient graphical interface for experimenting with thruster articulation parameters. To set it up, first launch the example world:

roslaunch vrx_gazebo vrx.launch

This will launch and environment containing a WAM-V with the T thruster configuration. Using the Gazebo interface, position the camera even with the surface of the water so all three thrusters are visible:

WAM-V T Thruster Default Configuration Next, in a separate terminal, run

rostopic list | grep thrust

to see a list of all thruster-related topics. Confirm that there is a thrust angle topic and a thrust command topic for each of the three thrusters, and note the full topic names.

We will now create an rqt_publisher as follows:

rosrun rqt_publisher rqt_publisher

This will open a new window similar to the one shown below. Click on the topic dropdown menu and scroll to the bottom to choose each of the six thruster angle/command topics you just listed, then press the green plus sign on the right to add them. Expand each by clicking on the arrow to show the current value in the "expression" field:

rqt_publisher Thruster Topics

Publish thrust angles and commands

To see the effect of publishing various values to the thruster topics, double click the expression value for a topic and enter the new desired value. Then click the checkmark next to the topic to start publishing.

Example: Changing angle and thrust

  • Change left_thrust_angle and right_thrust_angle to 1.57 to see the left and right thrusters rotate by 90 degrees (pi/2 radians) in the counter-clockwise (positive) direction, as shown below.

rqt_publisher Rotated Counter Clockwise

  • Now set the right and left thrust_cmd topics to 2 to cause the WAM-V to spint clockwise.

Example: Exceeding Max Angle

  • Reset all values back to 0 to turn off the thrusters and return them to their original position.
  • Now change the left and right thrust_cmd values back to 2 and change the left and right thruster angles to -10.
  • We have set <maxAngle>${pi/2}</maxAngle>, so -10 will be clipped to ${-pi/2} or -1.57.
  • This will cause the left and right thrusters to rotate -90 degrees (-pi/2 radians) in the clockwise (negative) direction, as shown below.

rqt_publisher Angle Clip Demo

The WAM-V should now spin in a counter-clockwise direction.

Note:

The thruster angle is controlled by a pre-tuned PID controller at the rotating joint. It does not move the angle immediately to the position being subscribed to, but uses a PID controller to send force commands to the joint to reach the desired angle quickly and accurately. The PID constants can be tuned for different desired use.

Teleop control of thruster articulation

  • Limited control of the thruster angles is also supported using usv_keydrive.launch or usv_joydrive.launch. Read Driving for more information.

Configure or disable thruster articulation

Thruster articulation settings are stored in the wamv_gazebo_thruster_config.xacro file.

To edit this file, run

roscd wamv_gazebo/urdf/thruster_layouts
gedit wamv_gazebo_thruster_config.xacro

The parameters relevant to thruster_articulation are:

  • <enableAngle>: If true, thruster articulation will be enabled.
  • <angleTopic>: The topic name that the thruster will subscribe to if <enableAngle> is true. If <enableAngle> is false, the thruster will not subcribe to <angleTopic> and will remain fixed in its angle with respect to the vehicle.
  • <maxAngle>: The absolute value of the maximum thruster angle (in radians). If a value with a larger absolute value is published, it will be clipped to be in either the range [-maxAngle, maxAngle] or [-pi, pi], whichever is smaller.
Clone this wiki locally