Skip to content

Commit c8d798e

Browse files
authored
Update auv_control_demos configurations (#60)
* Fixed stale demos * Update package versions * Fix obsolete tf2 header
1 parent d197fc7 commit c8d798e

File tree

39 files changed

+457
-358
lines changed

39 files changed

+457
-358
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"files.trimTrailingWhitespace": true,
2222
"editor.formatOnSave": true,
2323
"editor.tabSize": 2,
24+
"editor.detectIndentation": false,
2425
"autoDocstring.startOnNewLine": false,
2526
"autoDocstring.docstringFormat": "google-notypes",
2627
"python.autoComplete.extraPaths": [

auv_control_demos/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog for package auv_control_demos
22

3+
## 0.2.1 (2025-06-03)
4+
5+
- Updates the individual_controller and chained_controllers demos to use the
6+
current `hydrodynamics` API and the new adaptive integral terminal sliding mode
7+
controller.
8+
39
## 0.2.0 (2025-05-03)
410

511
## 0.1.0 (2025-04-27)

auv_control_demos/chained_controllers/README.md

Lines changed: 53 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ applies a PWM command to the hardware interface.
2323
The output should resemble:
2424

2525
```bash
26-
integral_sliding_mode_controller[velocity_controllers/IntegralSlidingModeController] active
27-
thruster_allocation_matrix_controller[thruster_allocation_matrix_controller/ThrusterAllocationMatrixController] active
28-
thruster_1_controller[thruster_controllers/PolynomialThrustCurveController] active
29-
thruster_2_controller[thruster_controllers/PolynomialThrustCurveController] active
30-
thruster_3_controller[thruster_controllers/PolynomialThrustCurveController] active
31-
thruster_4_controller[thruster_controllers/PolynomialThrustCurveController] active
32-
thruster_5_controller[thruster_controllers/PolynomialThrustCurveController] active
33-
thruster_6_controller[thruster_controllers/PolynomialThrustCurveController] active
34-
thruster_7_controller[thruster_controllers/PolynomialThrustCurveController] active
35-
thruster_8_controller[thruster_controllers/PolynomialThrustCurveController] active
26+
adaptive_integral_terminal_sliding_mode_controller velocity_controllers/AdaptiveIntegralTerminalSlidingModeController active
27+
thruster_allocation_matrix_controller thruster_allocation_matrix_controller/ThrusterAllocationMatrixController active
28+
thruster_8_controller thruster_controllers/PolynomialThrustCurveController active
29+
thruster_7_controller thruster_controllers/PolynomialThrustCurveController active
30+
thruster_6_controller thruster_controllers/PolynomialThrustCurveController active
31+
thruster_5_controller thruster_controllers/PolynomialThrustCurveController active
32+
thruster_4_controller thruster_controllers/PolynomialThrustCurveController active
33+
thruster_3_controller thruster_controllers/PolynomialThrustCurveController active
34+
thruster_2_controller thruster_controllers/PolynomialThrustCurveController active
35+
thruster_1_controller thruster_controllers/PolynomialThrustCurveController active
3636
```
3737

3838
3. Verify that the hardware interfaces have been properly loaded by opening
@@ -46,57 +46,51 @@ applies a PWM command to the hardware interface.
4646

4747
```bash
4848
command interfaces
49-
integral_sliding_mode_controller/rx/velocity [available] [unclaimed]
50-
integral_sliding_mode_controller/ry/velocity [available] [unclaimed]
51-
integral_sliding_mode_controller/rz/velocity [available] [unclaimed]
52-
integral_sliding_mode_controller/x/velocity [available] [unclaimed]
53-
integral_sliding_mode_controller/y/velocity [available] [unclaimed]
54-
integral_sliding_mode_controller/z/velocity [available] [unclaimed]
55-
thruster_1_controller/thruster_1_joint/effort [available] [claimed]
56-
thruster_1_joint/effort [available] [claimed]
57-
thruster_2_controller/thruster_2_joint/effort [available] [claimed]
58-
thruster_2_joint/effort [available] [claimed]
59-
thruster_3_controller/thruster_3_joint/effort [available] [claimed]
60-
thruster_3_joint/effort [available] [claimed]
61-
thruster_4_controller/thruster_4_joint/effort [available] [claimed]
62-
thruster_4_joint/effort [available] [claimed]
63-
thruster_5_controller/thruster_5_joint/effort [available] [claimed]
64-
thruster_5_joint/effort [available] [claimed]
65-
thruster_6_controller/thruster_6_joint/effort [available] [claimed]
66-
thruster_6_joint/effort [available] [claimed]
67-
thruster_7_controller/thruster_7_joint/effort [available] [claimed]
68-
thruster_7_joint/effort [available] [claimed]
69-
thruster_8_controller/thruster_8_joint/effort [available] [claimed]
70-
thruster_8_joint/effort [available] [claimed]
71-
thruster_allocation_matrix_controller/rx/effort [available] [claimed]
72-
thruster_allocation_matrix_controller/ry/effort [available] [claimed]
73-
thruster_allocation_matrix_controller/rz/effort [available] [claimed]
74-
thruster_allocation_matrix_controller/x/effort [available] [claimed]
75-
thruster_allocation_matrix_controller/y/effort [available] [claimed]
76-
thruster_allocation_matrix_controller/z/effort [available] [claimed]
49+
adaptive_integral_terminal_sliding_mode_controller/rx/velocity [available] [unclaimed]
50+
adaptive_integral_terminal_sliding_mode_controller/ry/velocity [available] [unclaimed]
51+
adaptive_integral_terminal_sliding_mode_controller/rz/velocity [available] [unclaimed]
52+
adaptive_integral_terminal_sliding_mode_controller/x/velocity [available] [unclaimed]
53+
adaptive_integral_terminal_sliding_mode_controller/y/velocity [available] [unclaimed]
54+
adaptive_integral_terminal_sliding_mode_controller/z/velocity [available] [unclaimed]
55+
thruster_1_controller/thruster_1_joint/effort [available] [claimed]
56+
thruster_1_joint/pwm [available] [claimed]
57+
thruster_2_controller/thruster_2_joint/effort [available] [claimed]
58+
thruster_2_joint/pwm [available] [claimed]
59+
thruster_3_controller/thruster_3_joint/effort [available] [claimed]
60+
thruster_3_joint/pwm [available] [claimed]
61+
thruster_4_controller/thruster_4_joint/effort [available] [claimed]
62+
thruster_4_joint/pwm [available] [claimed]
63+
thruster_5_controller/thruster_5_joint/effort [available] [claimed]
64+
thruster_5_joint/pwm [available] [claimed]
65+
thruster_6_controller/thruster_6_joint/effort [available] [claimed]
66+
thruster_6_joint/pwm [available] [claimed]
67+
thruster_7_controller/thruster_7_joint/effort [available] [claimed]
68+
thruster_7_joint/pwm [available] [claimed]
69+
thruster_8_controller/thruster_8_joint/effort [available] [claimed]
70+
thruster_8_joint/pwm [available] [claimed]
71+
thruster_allocation_matrix_controller/rx/effort [available] [claimed]
72+
thruster_allocation_matrix_controller/ry/effort [available] [claimed]
73+
thruster_allocation_matrix_controller/rz/effort [available] [claimed]
74+
thruster_allocation_matrix_controller/x/effort [available] [claimed]
75+
thruster_allocation_matrix_controller/y/effort [available] [claimed]
76+
thruster_allocation_matrix_controller/z/effort [available] [claimed]
7777
state interfaces
78-
rx/velocity
79-
ry/velocity
80-
rz/velocity
81-
x/velocity
82-
y/velocity
83-
z/velocity
8478
```
8579

86-
4. State feedback can be provided to ISMC using the controller's state
80+
4. State feedback can be provided to AITSMC using the controller's state
8781
interfaces or a topic. To demonstrate the topic-based interface, run the
8882
following command:
8983

9084
```bash
91-
ros2 topic pub /integral_sliding_mode_controller/system_state nav_msgs/msg/Odometry
85+
ros2 topic pub /adaptive_integral_terminal_sliding_mode_controller/system_state nav_msgs/msg/Odometry
9286
```
9387

94-
5. The ISMC accepts reference commands sent over a topic or a reference
88+
5. The AITSMC accepts reference commands sent over a topic or a reference
9589
interface. Run the following command in a separate terminal to provide the
9690
controller with a dummy reference input:
9791

9892
```bash
99-
ros2 topic pub /integral_sliding_mode_controller/reference geometry_msgs/msg/Twist "{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.2}}"
93+
ros2 topic pub /adaptive_integral_terminal_sliding_mode_controller/reference geometry_msgs/msg/Twist "{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.2}}"
10094
```
10195

10296
6. Each of the implemented controllers publishes controller state information to
@@ -111,23 +105,23 @@ applies a PWM command to the hardware interface.
111105
```bash
112106
header:
113107
stamp:
114-
sec: 1710818346
115-
nanosec: 252453476
108+
sec: 1748936962
109+
nanosec: 907678344
116110
frame_id: ''
117111
dof_state:
118112
name: thruster_2_joint
119-
reference: -39.79632414479818
113+
reference: -63.32823451272053
120114
feedback: 0.0
121115
feedback_dot: 0.0
122116
error: 0.0
123117
error_dot: 0.0
124-
time_step: 0.033380572
118+
time_step: 0.033281545
125119
output: 1134.0
126120
```
127121

128122
This output indicates that the controller chaining was successful. In
129123
particular, we can see that the velocity commands sent to the
130-
`integral_sliding_mode_controller` are converted to thrust values, which is
124+
`adaptive_integral_terminal_sliding_mode_controller` are converted to thrust values, which is
131125
reflected in the `thruster_controller` output.
132126

133127
## Files used for this demo
@@ -136,14 +130,15 @@ applies a PWM command to the hardware interface.
136130
- [chaining.launch.py](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/launch/chaining.launch.py)
137131

138132
- Controllers:
139-
- [Integral Sliding Mode Controller](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/tree/main/velocity_controllers)
133+
- [Adaptive Integral Terminal Sliding Mode Controller](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/tree/main/velocity_controllers)
140134
- [Thruster Allocation Matrix Controller](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/tree/main/thruster_allocation_matrix_controller)
141135
- [Polynomial Thrust Curve Controller](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/tree/main/thruster_controllers)
142136

143137
- Controller Config:
144-
- [chained_controllers.yaml](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/config/chained_controllers.yaml)
138+
- [chained.controllers.yaml](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/config/chained_controllers.yaml)
145139

146140
- Xacro Files:
147-
- [chained_config.xacro](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/xacro/chained_config.xacro)
148-
- [chained_ros2_control.xacro](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/xacro/chained_ros2_control.xacro)
149-
- [chained_urdf.xacro](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/xacro/chained_urdf.xacro)
141+
- [chained.config.xacro](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/xacro/chained.config.xacro)
142+
- [chained.ros2_control.xacro](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/xacro/chained.ros2_control.xacro)
143+
- [chained.urdf.xacro](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/xacro/chained.urdf.xacro)
144+
- [chained.model.xacro](https://github.com/Robotic-Decision-Making-Lab/auv_controllers/blob/main/auv_control_demos/chained_controllers/xacro/chained.urdf.xacro)

auv_control_demos/chained_controllers/config/chained_controllers.yaml

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ controller_manager:
22
ros__parameters:
33
update_rate: 30 # Hz
44

5-
integral_sliding_mode_controller:
6-
type: velocity_controllers/IntegralSlidingModeController
5+
adaptive_integral_terminal_sliding_mode_controller:
6+
type: velocity_controllers/AdaptiveIntegralTerminalSlidingModeController
77

88
thruster_allocation_matrix_controller:
99
type: thruster_allocation_matrix_controller/ThrusterAllocationMatrixController
@@ -32,24 +32,48 @@ controller_manager:
3232
thruster_8_controller:
3333
type: thruster_controllers/PolynomialThrustCurveController
3434

35-
integral_sliding_mode_controller:
35+
adaptive_integral_terminal_sliding_mode_controller:
3636
ros__parameters:
37-
use_external_measured_states: true
3837
reference_controller: thruster_allocation_matrix_controller
38+
use_external_measured_states: true
3939
gains:
40-
rho: 20.0
41-
lambda: 200.0
42-
Kp: [10.0, 10.0, 6.0, 3.0, 6.0, 10.0]
43-
hydrodynamics:
44-
mass: 13.5
45-
weight: 114.80
46-
buoyancy: 112.80
47-
moments_of_inertia: [0.16, 0.16, 0.16]
48-
added_mass: [-5.50, -12.70, -14.60, -0.12, -0.12, -0.12]
49-
center_of_buoyancy: [0.0, 0.0, 0.0]
50-
center_of_gravity: [0.0, 0.0, 0.0]
51-
linear_damping: [-4.03, -6.22, -5.18, -0.07, -0.07, -0.07]
52-
quadratic_damping: [-18.18, -21.66, -36.99, -1.55, -1.55, -1.55]
40+
lambda: 0.9
41+
x:
42+
alpha: 12.0
43+
k1_min: 0.1
44+
k2: 0.4
45+
k_theta: 2.0
46+
mu: 0.01
47+
y:
48+
alpha: 12.0
49+
k1_min: 0.1
50+
k2: 0.4
51+
k_theta: 2.0
52+
mu: 0.01
53+
z:
54+
alpha: 12.0
55+
k1_min: 0.4
56+
k2: 0.8
57+
k_theta: 2.0
58+
mu: 0.01
59+
rx:
60+
alpha: 0.5
61+
k1_min: 0.1
62+
k2: 0.4
63+
k_theta: 2.0
64+
mu: 0.01
65+
ry:
66+
alpha: 12.0
67+
k1_min: 0.1
68+
k2: 1.0
69+
k_theta: 2.0
70+
mu: 0.01
71+
rz:
72+
alpha: 12.0
73+
k1_min: 0.1
74+
k2: 0.4
75+
k_theta: 2.0
76+
mu: 0.01
5377

5478
thruster_allocation_matrix_controller:
5579
ros__parameters:

auv_control_demos/chained_controllers/launch/chaining.launch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def generate_launch_description():
4040
[
4141
FindPackageShare("auv_control_demos"),
4242
"xacro",
43-
"chained_config.xacro",
43+
"chained.config.xacro",
4444
]
4545
),
4646
]
@@ -51,7 +51,7 @@ def generate_launch_description():
5151
package="controller_manager",
5252
executable="spawner",
5353
arguments=[
54-
"integral_sliding_mode_controller",
54+
"adaptive_integral_terminal_sliding_mode_controller",
5555
"--controller-manager",
5656
["", "controller_manager"],
5757
],

auv_control_demos/chained_controllers/xacro/chained_config.xacro renamed to auv_control_demos/chained_controllers/xacro/chained.config.xacro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<robot name="auv"
33
xmlns:xacro="http://ros.org/wiki/xacro">
44

5-
<xacro:include filename="$(find auv_control_demos)/xacro/chained_urdf.xacro" />
6-
7-
<xacro:include filename="$(find auv_control_demos)/xacro/chained_ros2_control.xacro" />
5+
<xacro:include filename="$(find auv_control_demos)/xacro/chained.urdf.xacro" />
6+
<xacro:include filename="$(find auv_control_demos)/xacro/chained.model.xacro" />
7+
<xacro:include filename="$(find auv_control_demos)/xacro/chained.ros2_control.xacro" />
88

99
</robot>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0"?>
2+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
3+
<hydrodynamics>
4+
<inertial>
5+
<mass value="16.61" />
6+
<inertia ixx="0.24"
7+
iyy="0.2"
8+
izz="0.4" />
9+
<center_of_gravity x="0.0"
10+
y="0.0"
11+
z="0.0" />
12+
<added_mass Xdu="-12.7"
13+
Ydv="-10.5"
14+
Zdw="-14.57"
15+
Kdp="-0.12"
16+
Mdq="-0.12"
17+
Ndr="-0.12" />
18+
</inertial>
19+
20+
<damping>
21+
<linear Xu="-28.23"
22+
Yv="-18.29"
23+
Zw="-23.51"
24+
Kp="-0.31"
25+
Mq="-0.31"
26+
Nr="-0.31" />
27+
<quadratic Xuu="-93.47"
28+
Yvv="-74.28"
29+
Zww="-168.17"
30+
Kpp="-1.55"
31+
Mqq="-1.55"
32+
Nrr="-1.55" />
33+
</damping>
34+
35+
<hydrostatics>
36+
<buoyancy value="159.91" />
37+
<center_of_buoyancy x="0.0"
38+
y="0.0"
39+
z="0.0" />
40+
</hydrostatics>
41+
</hydrodynamics>
42+
</robot>

auv_control_demos/chained_controllers/xacro/chained_ros2_control.xacro renamed to auv_control_demos/chained_controllers/xacro/chained.ros2_control.xacro

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,6 @@
77
<param name="calculate_dynamics">false</param>
88
</hardware>
99

10-
<joint name="x">
11-
<state_interface name="velocity">
12-
<param name="initial_value">0.0</param>
13-
</state_interface>
14-
</joint>
15-
16-
<joint name="y">
17-
<state_interface name="velocity">
18-
<param name="initial_value">0.0</param>
19-
</state_interface>
20-
</joint>
21-
22-
<joint name="z">
23-
<state_interface name="velocity">
24-
<param name="initial_value">0.0</param>
25-
</state_interface>
26-
</joint>
27-
28-
<joint name="rx">
29-
<state_interface name="velocity">
30-
<param name="initial_value">0.0</param>
31-
</state_interface>
32-
</joint>
33-
34-
<joint name="ry">
35-
<state_interface name="velocity">
36-
<param name="initial_value">0.0</param>
37-
</state_interface>
38-
</joint>
39-
40-
<joint name="rz">
41-
<state_interface name="velocity">
42-
<param name="initial_value">0.0</param>
43-
</state_interface>
44-
</joint>
45-
4610
<joint name="thruster_1_joint">
4711
<command_interface name="pwm" />
4812
</joint>

0 commit comments

Comments
 (0)