This guide assumes that the following packages have been cloned and/or installed by the user:
- ROS Melodic
- uuv_simulator
- openai_gym 0.17.2
- python 3.6.9
- stable_baselines
- tensorflow 1.14
Package to simulate the underwater environment
-
Added only the modified uuv_simulator packages to spawn the docking station in a custom world and the package for modified camera parameters of the deepleng auv.
-
Replace the folders uuv_gazebo_worlds and uuv_sensor_plugins in the uuv_simulator package with the ones provided here.
-
The world designed for use of the docking station is called empty_underwater_docking.
-
Launch the world with
roslaunch uuv_gazebo_worlds empty_underwater_world.launch
-
To launch other worlds use either the respective launch file or change the world name in the empty_underwater_world.launch
Package to spawn the deepleng AUV in the simulator
-
The meshes for docking station are present in uuv_gazebo_worlds/models/deepleng_docking_station.
-
Publish rpm values to the AUV thruster's using:
rostopic pub -r 20 /deepleng/thrusters/0/input uuv_gazebo_ros_plugins_msgs/FloatStamped '{header: auto, data: 40.0}'
-
To publish to different thrusters only the thruster_id(0,1,2) needs to be changed.
-
-
Launch the deepleng auv with
roslaunch deepleng_description upload.launch
Submodule to aid in ros transforms when running ros melodic with python3
-
This helps overcome the following errors if they occur:
-
To build a ros workspace with catkin_make and python3, please follow the steps in the link below:
-
Other common errors while building the ros workspace with catkin_make and python3 are answered in the following links:
Package containing the openai-gym environment to train and test DRL agents
-
The environment can be imported using:
from deepleng_gym.task_envs.deepleng import deepleng_docking
-
Instansiate the environment with:
gym.make('DeeplengDocking-v2')
-
robot_envs: contains all the ros and gazebo specific code such as the publishers and subscribers to various rostopics.
-
task_envs: contains the gym.Env wrapped code that defines the deepleng docking environment.
Package containing the python scripts and ros nodes to launch DRL agents from the stable_baselines library
-
scripts: contains the python scripts where the agent and the environment are defined
-
launch: contains the launch files used to run the training and evaluation of the DRL agents
-
Training can be launched with:
roslaunch deepleng_control start_training.launch
-
This will start the simulation, spawn the robot as well as start the training of the DRL agent.
- Different agents can be trained by changing the node type:
<node pkg="deepleng_control" name="rl_controller" type="stable_baselines_ddpg.py" output="screen"/>
in the launch file.
-
-
Inference can be launched with:
roslaunch deepleng_control start_inference.launch
-
This will only launch the inference, start the simulation and spawn the AUVseperately using the commands descirbed in the prior sections before starting the inference.
-
Package that acts as the interface between the gazebo simulator and the openai-gym environment
- Create a python3 virtual_env containing atleast:
- openai_gym 0.17.2
- stable_baselines
- tensorflow 1.14
- numpy
- scipy
- defusedxml
-
Create a ROS melodic workspace using the folders present here (modify the uuv_simulator package as described earlier) that is built with catkin build and python2.
-
Create a seperate ROS melodic workspace using the folders present here (modify the uuv_simulator package as described earlier) and build it with catkin_make and python3
-
Source the virtual_env before sourcing the ROS workspaces in the following order:
-
Source ROS workspace built with python2 and catkin build
-
Source ROS workspace built with python3 and catkin_make
-
Set experiment_name in the set_env_variables.sh script and source it.
-
Launch training or inference using the commands described in the prior sections.