Skip to content

thruster_articulation_tutorial

Jessica edited this page May 25, 2023 · 6 revisions

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

The rqt tool provides a convenient graphical interface for visualizing and experimenting with ROS2 topics. We will use the publisher functionality to explore thruster articulation parameters. To set it up, first launch the example world:

ros2 launch vrx_gz competition.launch.py world:=sydney_regatta

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

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

ros2 topic list | grep thrust

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

From the terminal, start rqt:

rqt

This will open a new window similar to the one shown below. Click on the Plugins dropdown menu, scroll to Topics, and click on Message Publisher. You should see a new section in your window for the publishing functionality. Select each of the four thruster angle/command topics you saw listed above, then press the 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 thrusters/left/pos and thrusters/right/pos 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 thrusters/left/thrust and thrusters/right/thrust 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 values back to 2 and change the left and right thruster angles to -10.
  • We have set the maximum thruster angle to $\pm \pi$ ($\pm$ 3.14), so -10 will be clipped to $-\pi$ or -3.14.
  • This will cause the left and right thrusters to rotate -180 degrees ($-\pi$ radians) in the clockwise (negative) direction, as shown below.

rqt Publisher Angle Clip Demo

The WAM-V should now move backwards.

Teleop_tutorial control of thruster articulation

  • Limited control of the thruster angles is also supported using gamepad control. Read the Teleop Tutorial for more information.
Back: Driving the WAM-V Top: VRX Tutorials Next: Adding Course Elements
Clone this wiki locally