Run SUAVE
With Runner
Trying it out!
If you simply want to try out the exemplar, simply enter the following commands in a terminal:
cd ~/suave_ws/src/suave/runner/
./example_run.sh
Within a couple of minutes, some new terminals should open as well as the Gazebo simulator.
A default mission is executed of inspecting the pipeline with a time limit.
To follow the robot as it progresses along its mission make sure to right click and follow it in the entity tree of Gazebo as shown below:
Please note: It can take a little while for the robot to get moving, it is an issue we are aware of. Once it does get a move on you should see it perform its mission for about 5 minutes.
Full Runner
To run the exemplar with the runner, first make sure you source the suave workspace:
cd ~/suave_ws/
source ~/suave_ws/install/setup.bash
Then run:
Without gui:
ros2 run suave_runner suave_runner \
--ros-args \
-p gui:=False \
-p experiments:='[
"{\"experiment_launch\": \"ros2 launch suave_bt suave_bt.launch.py\", \
\"num_runs\": 2, \
\"adaptation_manager\": \"bt\", \
\"mission_name\": \"suave\"}"
]'
With gui:
ros2 run suave_runner suave_runner \
--ros-args \
-p gui:=True \
-p experiments:='[
"{\"experiment_launch\": \"ros2 launch suave_bt suave_bt.launch.py\", \
\"num_runs\": 2, \
\"adaptation_manager\": \"bt\", \
\"mission_name\": \"suave\"}"
]'
You can also use a launch file with a config file to make it easier to run the experiments:
ros2 launch suave_runner suave_runner.launch.py
To run SUAVE with different managing subsystems. Just replace the experiment_launch
with the proper launch file.
Without the runner
Configuring SUAVE:
SUAVE has a number of parameters that may be of interest when running experiments with its missions, such as the time limit of a time constrained mission or the frequency of thruster failure. These can be found in the mission_config.yaml file. Note: When you change the mission_config file, you need to rebuild the suave_ws with colcon build --symlink-install
Note: Before starting the simulation or the ros nodes, remember that you have to source SUAVE’s workspace. If you are using the dockerized version this is already done for you, therefore sourcing the workspace is not necessary.
Navigate to the workspace and source it:
cd ~/suave_ws/
source install/setup.bash
With SUAVE configured and sourced, start ArduSub, the simulation, and the SUAVE’s nodes with the following instructions.
Start ArduSub
Run:
sim_vehicle.py -L RATBeach -v ArduSub --model=JSON --console
Start the simulation
Run:
ros2 launch suave simulation.launch.py x:=-17.0 y:=2.0
Note: It is possible to pass arguments to specify the x and y coordinates of where the UUV spawns, by changing the values. In the above launch command the initial coordinates are set to (-17.0, 2.0).
Start SUAVE’s nodes
Run:
ros2 launch suave_missions mission.launch.py
Mission results: The mission results will be saved in the path specified in the mission_config.yaml file.
Selecting the manging system and mission type: Launching the mission file without launch arguments will start a time-constrained mission without a managing subsystem. To select a different managing subsystem or a different type of mission, the following launch arguments can be used:
'adaptation_manager':
Managing subsystem to be used
available values: none/metacontrol/random/bt
(default: 'none')
'result_filename':
Filename for the mission measured metrics
available values: any name
(default: 'time_constrained_mission_results')
The arguments can be defined by adding the above arguments with the notation <name>:=<value>
to the end of the command line.
An example of running the constant distance mission with metacontrol saving to a file called ‘measurement_1’:
ros2 launch suave_missions mission.launch.py adaptation_manager:=metacontrol result_filename:=measurement_1