diff --git a/doc/minimal_dockers.md b/doc/minimal_dockers.md new file mode 100644 index 0000000000000000000000000000000000000000..cf2f80f3305ea9b05a96ea352a3c019b5a780d05 --- /dev/null +++ b/doc/minimal_dockers.md @@ -0,0 +1,316 @@ +# Minimal Dockers + +## Minimal LRS Dockers + +There is a set of minimal dockers that contains a set or related functionalities. The idea is that these dockers can be used in conjunction with a native ROS installation. + +The set of minimal dockers are currently: + +- base-dji-minimal +- dji-minimal +- exec-common-minimal +- exec-dji-minimal +- exec-exec-minimal +- exec-minimal +- gazebo_minimal +- mqtt_minimal +- rtsp_minimal +- rviz_minimal +- tst-minimal +- wdb-minimal + +Missing: + +- delegation_minimal + +### Using Minimal Dockers + +The simplest way is to check ouy the repo: +```bash +git clone git@gitlab.liu.se:lrs/waraps.git +``` +and make sure that waraps/script is in the path + +The following scripts will then be available: + +- [base_dji](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/base_dji) +- [dji_system](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/dji_system) +- [wdb](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/wdb) +- [tst](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/tst) +- [exec_system](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/exec_system) +- [exec_exec](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/exec_exec) +- [exec_common](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/exec_common) +- [exec_dji](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/exec_dji) +- [rviz_gpu](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/rviz_gpu) Use if you have the NVIDIA docker extension. +- [rviz_no_gpu](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/rviz_no_gpu) Use if you do not have the NVIDIA docker extension. +- [gazebo](https://gitlab.liu.se/lrs/waraps/-/blob/master/script/gazebo) Must have the NVIDIA docker extension. + +For example base_dji is defined as: +```bash +#!/bin/bash + +tag=gitlab.liu.se:5000/lrs/lrs_docker_images/base-dji-minimal:v01 + +if [ $1 = "pull" ]; then + docker pull $tag + exit 0 +fi + + +docker run \ + --init \ + --network host \ + --security-opt apparmor:unconfined \ + --ulimit nofile=1024 \ + -e ROS_HOSTNAME=localhost \ + --rm -it ${tag} "$@" +``` + +### base-dji-minimal + +#### Contains repos +- dji_sdk +- motion_models +- converter_mavdjisdk +- nonlinearmpc +- lrs_gazebo + +#### Example of usage +```bash +base_dji roslaunch lrs_dji_sim sim.launch dynamics:=true mpc:=true inair:=true ns:=/dji0 gazebo:=true +base_dji bash +base_dji more ws_install/install/share/lrs_dji_sim/launch/sim.launch +``` + +### dji-minimal + +#### Contains repos +- lrs_basic +- lrs_common +- lrs_dji +- lrs_kdb_bridge_msgs +- lrs_kdb_msgs +- lrs_launch +- lrs_msgs_common +- lrs_srvs_wdb +- lrs_util_kdb +- Onboard-SDK-ROS + +#### Example of usage + +Create an LRS DJI +```bash +dji_system roslaunch lrs_launch lrsdji.launch publish_pose:=false ns:=/dji0 +``` + +### wdb-minimal + +#### Contains repos +- lrs_basic +- lrs_common +- lrs_launch +- lrs_msgs_common +- lrs_srvs_wdb +- lrs_team_msgs +- lrs_util_wdb +- lrs_wdb + +#### Example of usage + +Create a WDB LRS DJI +```bash +wdb roslaunch lrs_launch wdb.launch vehicle:=dji ns:=/dji0 +``` + +### tst-minimal + +#### Contain repos + +- lrs_basic +- lrs_common +- lrs_launch +- lrs_msgs +- lrs_msgs_common +- lrs_msgs_del +- lrs_msgs_mp +- lrs_msgs_tfpop +- lrs_msgs_tst +- lrs_pyutil +- lrs_srvs +- lrs_srvs_exec +- lrs_srvs_tst +- lrs_srvs_wdb +- lrs_tst +- lrs_util_tst +- lrs_util_wdb + +#### Example of usage + +Create TST Factory for Execution Trees +``` +tst roslaunch lrs_launch tst_part ns:=/dji0 +``` + +### exec-minimal + +#### Contain repos +- lrs_exec +- lrs_launch +- lrs_msgs_common +- lrs_msgs_del +- lrs_msgs_tfpop +- lrs_msgs_tst +- lrs_resource +- lrs_srvs_exec +- lrs_srvs_ra +- lrs_srvs_tst +- lrs_srvs_wdb +- lrs_util_tst +- lrs_util_wdb + +#### Example of usage + +Start the nodes_ +- tstexecmanager +- resourceagent + +```bash +exec_system roslaunch lrs_launch exec_part.launch ns:=/dji0 + +``` + +### exec-exec-minimal + +#### Contain repos +- lrs_exec_exec +- lrs_interaction_msgs +- lrs_srvs_tfpop +- lrs_util_interaction +- lrs_util_tfpop + +#### Example of usage + +```bash +exec_exec roslaunch lrs_launch exec_exec.launch ns:=/dji0 +``` + +### exec-common-minimal + +#### Contain repos + +- lrs_basic +- lrs_common +- lrs_exec_common +- lrs_exec_scan +- lrs_interaction_msgs +- lrs_kdb_bridge_msgs +- lrs_kdb_msgs +- lrs_launch +- lrs_msgs +- lrs_msgs_mp +- lrs_scan_msgs +- lrs_srvs_del +- lrs_srvs_mp +- lrs_util +- lrs_util_del +- lrs_util_interaction +- lrs_util_kdb +- lrs_util_mp +- lrs_util_scan + +#### Example of usage + +```bash +exec_common roslaunch lrs_launch exec_common.launch ns:=/dji0 +``` + +### exec-dji-minimal + +#### Contain repos + +- lrs_basic +- lrs_common +- lrs_exec_dji +- lrs_interaction_msgs +- lrs_launch +- lrs_msgs +- lrs_msgs_mp +- lrs_srvs +- lrs_util_interaction +- Onboard-SDK-ROS + + +#### Example of usage + +```bash +exec_dji roslaunch lrs_launch exec_vehicle.launch vehicle:=dji ns:=/dji0 +``` + +## Examples + +How to load vehicle config file, cannot be loaded in location since it depends on unit + +We assume a roscore have been started on the development machine: +```bash +roscore +``` + +### /op0 + +```bash +roslaunch lrs_launch config.launch location:=granso kdb:=true ns:=/op0 +wdb roslaunch lrs_launch wdb.launch vehicle:=op ns:=/op0 +tst roslaunch lrs_launch tst_part ns:=/op0 +exec_system roslaunch lrs_launch exec_part.launch ns:=/op0 +exec_exec roslaunch lrs_launch exec_exec.launch ns:=/op0 +``` + +### /dji0 +```bash +roslaunch lrs_launch config.launch location:=granso kdb:=true ns:=/dji0 +base_dji roslaunch lrs_dji_sim sim.launch dynamics:=true mpc:=true inair:=true ns:=/dji0 gazebo:=true +dji_system roslaunch lrs_launch lrsdji.launch publish_pose:=false ns:=/dji0 +wdb roslaunch lrs_launch wdb.launch vehicle:=dji ns:=/dji0 +tst roslaunch lrs_launch tst_part ns:=/dji0 +exec_system roslaunch lrs_launch exec_part.launch ns:=/dji0 +exec_exec roslaunch lrs_launch exec_exec.launch ns:=/dji0 +exec_dji roslaunch lrs_launch exec_vehicle.launch vehicle:=dji ns:=/dji0 +``` + +### Using Your Own Controller for the DJI + +```bash +roslaunch lrs_launch config.launch location:=granso kdb:=true ns:=/dji0 +# Start your own controller here +base_dji roslaunch lrs_dji_sim sim.launch dynamics:=true mpc:=false pid:=false inair:=true ns:=/dji0 gazebo:=true +dji_system roslaunch lrs_launch lrsdji.launch publish_pose:=false ns:=/dji0 +``` + +### Running RVIZ + +```bash +rviz_gpu roslaunch lrs_launch rviz_outside.launch +``` + +or + +```bash +rviz_no_gpu roslaunch lrs_launch rviz_outside.launch +``` + +### Running Gazebo + +For gazebo we have to start gazebo first and since it uses simtime. +```bash +roslaunch lrs_launch config.launch location:=granso kdb:=true ns:=/dji0 +gazebo roslaunch lrs_wara_gazebo gazebo.launch world:=granso.world +gazebo roslaunch lrs_wara_gazebo dji_to_gazebo.launch name:=dji0 with_laser:=true x:=5 +base_dji roslaunch lrs_dji_sim sim.launch dynamics:=true mpc:=false pid:=false inair:=true ns:=/dji0 gazebo:=true +# Start your own controller here +dji_system roslaunch lrs_launch lrsdji.launch publish_pose:=false ns:=/dji0 +``` + +BUG: + +[ INFO] [1599222870.282665159, 565.980000000]: Updating LinkState: reference_frame is empty/world/map, using inertial frame + diff --git a/script/tst b/script/tst index 131733f29e4e293820c5fa178d8591c72d3c7cce..65234208c67fe01ecacc14ac2e8e6b7fd21012ae 100755 --- a/script/tst +++ b/script/tst @@ -12,6 +12,7 @@ exec docker run \ --network host \ --security-opt apparmor:unconfined \ --ulimit nofile=1024 \ + --ipc=host \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e DISPLAY=unix${DISPLAY} \ -e ROS_HOSTNAME=localhost \ diff --git a/script/tst_noetic b/script/tst_noetic index dcad5b64fff292ead334dc5db986e84ccbe36ee3..30c9fc52a9a5165e25c774c0a56a98331163cf14 100755 --- a/script/tst_noetic +++ b/script/tst_noetic @@ -15,4 +15,7 @@ exec docker run \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e DISPLAY=unix${DISPLAY} \ -e ROS_HOSTNAME=localhost \ + --ipc=host \ --rm -it ${tag} "$@" + +## --ipc=host Solves problem with crash in tstdisplayserver