-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added changes from recent testings - Changed the thruster ID values to correspond to the current thruster connection setup. - Changed FRV thruster direction from -1Z to +1Z. - Changed PID values for the sub. Values are still not ideal and will be adjusted over the next few testing sessions. - Changed the identifier for the USB to CAN board's USB to serial converter. - Changed tcp address for the depth sensor, imu, and dvl connection scripts to their ip addresses instead of their DNS names (there is an issue with the DNS server in the network box, or in the lab, or both). - Made changes to the sub8.urdf.xacro for gazebo to avoid URDF inertia warning. - Added bag_debugging_controller.launch file which is a launch file to record bags for debugging the PID controller on the sub. * Add documentation for bag_debugging_controller.launch * pre-commit and CI fixes...probably * Added documentation about PID controller - Added documentation page about PID controller containing information about the bag_debugging_controller.launch file and some tips for how to tune the PID controller. - Reverted subjugator_launch/readme.md changes to reflect moving to a new documentation page. - Modified adaptive controller values to remove commented out kd values. * Modify URDF fix to fix /mission_server crash - Another URDF xacro fix has been applied to the URDF xacro file using these ROS forum posts as reference: https://answers.ros.org/question/393006/urdf-link-not-properly-fixed-to-world/, https://answers.ros.org/question/192817/error-msg-the-root-link_base-has-an-inertia-specified-in-the-urdf-but-kdl/. NOTE: This is not a complete fix yet. I'm getting a tf republisher error that 'base_link' and 'map' do not have a connection with TF having 2+ unconnected trees. Additionally, gazebogui does not work since the /gzclient/set_physics_properties service is not advertised (even though /gazebo/set_physics_properties is). * Add support for simulation vs physical PID gains --------- Co-authored-by: Cameron Brown <[email protected]> Co-authored-by: cameron brown <[email protected]>
- Loading branch information
1 parent
64a7f8a
commit 9bcfdcb
Showing
14 changed files
with
75 additions
and
22 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
SubjuGator/command/subjugator_launch/config/adaptive_controller.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
kp: 1000, 1000, 1000, 5000, 5000, 5000 | ||
kd: 150, 150, 150, 50, 100, 25 | ||
kg: 5,5,5,5,5,5 | ||
ki: 5,5,5,5,10,5 | ||
use_learned: false | ||
kp: 120, 150, 200, 100, 50, 50 | ||
kd: 25, 25, 25, 25, 25, 25 | ||
kg: 2.5,2.5,2.5,2.5,2.5,2.5 | ||
ki: 2.5,2.5,2.5,2.5,2.5,2.5 | ||
use_learned: true |
6 changes: 6 additions & 0 deletions
6
SubjuGator/command/subjugator_launch/config/adaptive_controller_gazebo.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
kp: 1000, 1000, 1000, 5000, 5000, 5000 | ||
kd: 150, 150, 150, 50, 100, 25 | ||
kg: 5,5,5,5,5,5 | ||
ki: 5,5,5,5,10,5 | ||
use_learned: false |
7 changes: 7 additions & 0 deletions
7
SubjuGator/command/subjugator_launch/launch/bag_debugging_controller.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<launch> | ||
<arg name="prefix_name" default="controller_debug" /> | ||
<arg name="bag_name" default="$(find subjugator_controller)/debug_bags/$(arg prefix_name)" /> | ||
<node name="record" pkg="rosbag" type="record" args="-o $(arg bag_name) /adaptive_controller/pose_error /adaptive_controller/twist_error /adaptive_controller/adaptation /adaptive_controller/dist /adaptive_controller/drag /wrench /trajectory /odom /imu/data_raw /dvl/range"> | ||
</node> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
SubjuGator/command/subjugator_launch/launch/subsystems/adaptive_controller.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<launch> | ||
<arg name="debug" default="True" /> | ||
<arg name="debug" default="True"/> | ||
<arg name="environment" default="real"/> | ||
<node pkg="subjugator_controller" type="adaptive_controller" name="adaptive_controller"> | ||
<rosparam param="" file="$(find subjugator_launch)/config/adaptive_controller.yaml" /> | ||
<param name="debug" value="$(arg debug)" /> | ||
<rosparam if="$(eval environment == 'real')" param="" file="$(find subjugator_launch)/config/adaptive_controller.yaml"/> | ||
<rosparam if="$(eval environment == 'gazebo')" param="" file="$(find subjugator_launch)/config/adaptive_controller_gazebo.yaml"/> | ||
<param name="debug" value="$(arg debug)"/> | ||
</node> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,10 @@ | |
<description>The subjugator_launch package</description> | ||
<maintainer email="[email protected]">Jacob Panikulam</maintainer> | ||
<license>MIT</license> | ||
<build_depend>rosbag</build_depend> | ||
<build_depend>roslaunch</build_depend> | ||
<run_depend>roslaunch</run_depend> | ||
<run_depend>rosbag</run_depend> | ||
<run_depend>robot_state_publisher</run_depend> | ||
<run_depend>nodelet</run_depend> | ||
<run_depend>c3_trajectory_generator</run_depend> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/sh | ||
exec socat -d -d pty,link=/tmp/depth,raw,echo=0 tcp:mil-sub-gumstix.ad.mil.ufl.edu:33056 | ||
exec socat -d -d pty,link=/tmp/depth,raw,echo=0 tcp:192.168.37.61:33056 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/sh | ||
exec socat -d -d pty,link=/tmp/dvl,raw,echo=0 tcp:mil-sub-gumstix.ad.mil.ufl.edu:349 | ||
exec socat -d -d pty,link=/tmp/dvl,raw,echo=0 tcp:192.168.37.61:349 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/sh | ||
exec socat -d -d pipe:/tmp/imu,wronly=1 tcp:mil-sub-gumstix.ad.mil.ufl.edu:1382 | ||
exec socat -d -d pipe:/tmp/imu,wronly=1 tcp:192.168.37.61:1382 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
PID Controller | ||
-------------- | ||
|
||
SubjuGator 8 uses 6 PID controllers for its 6 degrees of freedom (x, y, z, roll, pitch, yaw). The gain for these PID controllers can be adjusted in ``adaptive_controller.yaml`` found in the ``subjugator_launch/config`` directory. Since the weight of the sub shifts with each component modified, the PID controller values have to be adjusted from time to time. There are two approaches to adjust PID values in the water: | ||
|
||
1. Have someone with experience in tuning PID controllers swim with the sub and use the sub's response to movement commands to adjust the gains. | ||
2. Eliminate the error in each axis by adjusting the gains and evaluating the RMS error in each axis after sending the same movement commands. | ||
|
||
PID Controller Tuning Tips | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* The learning gains (``ki`` and ``kd``) provide very little input to the wrenches applied to the sub, so it is better to treat it as a PD controller to start with. You can disable the learning gains using ``use_learned: false``. | ||
* While you are tuning the PID values, keep a history of the values you have tried for further analysis during and after testing. You can use ``scp`` for this, but it may just be easier to take a screenshot or a photo. You can also take videos of the sub from the side of the pool to reference later. | ||
|
||
PID Debugging Data Collection | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code-block:: bash | ||
$ roslaunch subjugator_launch bag_debugging_controller.launch prefix_name:="my_prefix" | ||
This launch file records a bag file containing adaptive controller ``pose_error``, ``twist_error``, ``adaptation``, ``dist``, and ``drag`` data along with ``wrench``, ``trajectory``, ``odom``, ``imu/data_raw``, and ``dvl/range`` data. This data is useful in determining if the PID values are getting better or worse using simulations. The resulting bag file will be located in ``gnc/subjugator_controller/debug_bags/``. This launch file was written by Andres Pulido. | ||
|
||
.. warning:: | ||
|
||
This launch file needs the sub launch file (``sub8.launch``) running in order to function properly. |