From d0374d19789c66c7999cdc7447f4494ef3f25cef Mon Sep 17 00:00:00 2001
From: Tommy Persson <tommmy.persson@liu.se>
Date: Tue, 8 Sep 2020 19:44:17 +0200
Subject: [PATCH] Work on development environment.

---
 doc/local_ros_installation.md | 45 +++++++++-------
 doc/minimal_dockers.md        | 98 +++++++++++++++++++++++++++++++++++
 doc/prepare_ros_computer.md   |  7 ++-
 3 files changed, 129 insertions(+), 21 deletions(-)

diff --git a/doc/local_ros_installation.md b/doc/local_ros_installation.md
index 82d61fe..b6e6d26 100644
--- a/doc/local_ros_installation.md
+++ b/doc/local_ros_installation.md
@@ -98,9 +98,14 @@ docker pull gitlab.liu.se:5000/lrs/lrs_docker_images/wara-melodic:v01
 
 ## How to start different parts
 
-### Start a ros core locally:
+Start by puling the image:
 ```bash
-roscore
+wpull
+```
+
+### Start a ros core and the docker container:
+```bash
+wgrun roscore
 ```
 
 ### Loading configurtion launch files
@@ -112,8 +117,8 @@ the config.launch file is location and ns.
 Suppose we want to start unit /op0 and /dji0 in Gränsö then we do:
 
 ```bash
-wdb roslaunch lrs_launch config.launch location:=granso ns:=/op0
-wdb roslaunch lrs_launch config.launch location:=granso ns:=/dji0
+wexec roslaunch lrs_launch config.launch location:=granso ns:=/op0
+wexec roslaunch lrs_launch config.launch location:=granso ns:=/dji0
 ```
 
 We are not setting kdb to trues since the repo lrs_kdb_base_knowledge is not available.
@@ -128,16 +133,16 @@ roslaunch lrs_launch config.launch location:=granso ns:=/dji0
 ### Start gazebo using docker:
 
 If you have a NVIDIA graphics card and support for that in docker then
-you can if needed start gazebo:
+you can if needed start gazebo (and if the container was started with wgrun):
 
 ```bash
-gazebo roslaunch lrs_wara_gazebo gazebo.launch
+wexec roslaunch lrs_wara_gazebo gazebo.launch
 ```
 
 Load the dji model in gazebo:
 
 ```bash
-gazebo roslaunch lrs_wara_gazebo dji_to_gazebo.launch name:=dji0 with_laser:=true x:=0
+wexec roslaunch lrs_wara_gazebo dji_to_gazebo.launch name:=dji0 with_laser:=true x:=0
 ```
 
 ### Start /op0 using a screen:
@@ -148,10 +153,10 @@ env NS=/op0 screen -c waraps/screen/screen_op
 
 This will start the following scripts which starts docker containers:
 ```bash
-wdb roslaunch lrs_launch wdb.launch vehicle:=op ns:=${NS}
-tst roslaunch lrs_launch tst_part.launch ns:=${NS}
-exec_system roslaunch lrs_launch exec_part.launch ns:=${NS}
-exec_exec roslaunch lrs_launch exec_exec.launch ns:=${NS}
+wexec roslaunch lrs_launch wdb.launch vehicle:=op ns:=${NS}
+wexec roslaunch lrs_launch tst_part.launch ns:=${NS}
+wexec_system roslaunch lrs_launch exec_part.launch ns:=${NS}
+wexec roslaunch lrs_launch exec_exec.launch ns:=${NS}
 ```
 
 ### Start /dji0 simulation using a screen:
@@ -162,13 +167,13 @@ env NS=/dji0 screen -c waraps/screen/screen_djisim
 
 This will start the following scripts which starts docker containers:
 ```bash
-base_dji roslaunch lrs_dji_sim sim.launch dynamics:=true mpc:=true inair:=false ns:=/dji0 basic:=false gazebo:=true
-dji_system roslaunch lrs_launch lrsdji.launch publish_pose:=true ns:=${NS}
-wdb roslaunch lrs_launch wdb.launch vehicle:=op ns:=${NS}
-tst roslaunch lrs_launch tst_part.launch ns:=${NS}
-exec_system roslaunch lrs_launch exec_part.launch ns:=${NS}
-exec_exec roslaunch lrs_launch exec_exec.launch ns:=${NS}
-exec_dji roslaunch lrs_launch exec_vehicle.launch vehicle:=dji ns:=${NS}
+wexec roslaunch lrs_dji_sim sim.launch dynamics:=true mpc:=true inair:=false ns:=/dji0 basic:=false gazebo:=true
+wexec roslaunch lrs_launch lrsdji.launch publish_pose:=true ns:=${NS}
+wexec roslaunch lrs_launch wdb.launch vehicle:=op ns:=${NS}
+wexec roslaunch lrs_launch tst_part.launch ns:=${NS}
+wexec roslaunch lrs_launch exec_part.launch ns:=${NS}
+wexec roslaunch lrs_launch exec_exec.launch ns:=${NS}
+wexec roslaunch lrs_launch exec_vehicle.launch vehicle:=dji ns:=${NS}
 ```
 
 ### Test the two running screens
@@ -182,12 +187,12 @@ rostopic echo /dji0/pose
 
 Takeoff
 ```bash
-tst rosrun lrs_tst tstcommand.py --takeoff --exec __ns:=/dji0
+wexec rosrun lrs_tst tstcommand.py --takeoff --exec __ns:=/dji0
 ```
 
 Flyto
 ```bash
-tst rosrun lrs_tst tstcommand.py --fly -x 100 -y 100 -z 12 --speed 3 --exec __ns:=/dji0
+wexec rosrun lrs_tst tstcommand.py --fly -x 100 -y 100 -z 12 --speed 3 --exec __ns:=/dji0
 ```
 
 
diff --git a/doc/minimal_dockers.md b/doc/minimal_dockers.md
index ff1184b..aa074c9 100644
--- a/doc/minimal_dockers.md
+++ b/doc/minimal_dockers.md
@@ -333,3 +333,101 @@ BUG:
 
 [ INFO] [1599222870.282665159, 565.980000000]: Updating LinkState: reference_frame is empty/world/map, using inertial frame
 
+
+OLD:
+
+## How to start different parts
+
+### Start a ros core locally:
+```bash
+roscore
+```
+
+### Loading configurtion launch files
+
+For each agent you have to load a configuration file and that have to
+be done before the screen for the agent is loaded. The arguments to
+the config.launch file is location and ns.
+
+Suppose we want to start unit /op0 and /dji0 in Gränsö then we do:
+
+```bash
+wdb roslaunch lrs_launch config.launch location:=granso ns:=/op0
+wdb roslaunch lrs_launch config.launch location:=granso ns:=/dji0
+```
+
+We are not setting kdb to trues since the repo lrs_kdb_base_knowledge is not available.
+
+If you have ROS configured to local repos the above could have been done as:
+```bash
+roslaunch lrs_launch config.launch location:=granso ns:=/op0
+roslaunch lrs_launch config.launch location:=granso ns:=/dji0
+```
+
+
+### Start gazebo using docker:
+
+If you have a NVIDIA graphics card and support for that in docker then
+you can if needed start gazebo:
+
+```bash
+gazebo roslaunch lrs_wara_gazebo gazebo.launch
+```
+
+Load the dji model in gazebo:
+
+```bash
+gazebo roslaunch lrs_wara_gazebo dji_to_gazebo.launch name:=dji0 with_laser:=true x:=0
+```
+
+### Start /op0 using a screen:
+
+```bash
+env NS=/op0 screen -c waraps/screen/screen_op
+```
+
+This will start the following scripts which starts docker containers:
+```bash
+wdb roslaunch lrs_launch wdb.launch vehicle:=op ns:=${NS}
+tst roslaunch lrs_launch tst_part.launch ns:=${NS}
+exec_system roslaunch lrs_launch exec_part.launch ns:=${NS}
+exec_exec roslaunch lrs_launch exec_exec.launch ns:=${NS}
+```
+
+### Start /dji0 simulation using a screen:
+
+```bash
+env NS=/dji0 screen -c waraps/screen/screen_djisim
+```
+
+This will start the following scripts which starts docker containers:
+```bash
+base_dji roslaunch lrs_dji_sim sim.launch dynamics:=true mpc:=true inair:=false ns:=/dji0 basic:=false gazebo:=true
+dji_system roslaunch lrs_launch lrsdji.launch publish_pose:=true ns:=${NS}
+wdb roslaunch lrs_launch wdb.launch vehicle:=op ns:=${NS}
+tst roslaunch lrs_launch tst_part.launch ns:=${NS}
+exec_system roslaunch lrs_launch exec_part.launch ns:=${NS}
+exec_exec roslaunch lrs_launch exec_exec.launch ns:=${NS}
+exec_dji roslaunch lrs_launch exec_vehicle.launch vehicle:=dji ns:=${NS}
+```
+
+### Test the two running screens
+
+On the local machine do:
+
+Watch the pose:
+```bash
+rostopic echo /dji0/pose
+```
+
+Takeoff
+```bash
+tst rosrun lrs_tst tstcommand.py --takeoff --exec __ns:=/dji0
+```
+
+Flyto
+```bash
+tst rosrun lrs_tst tstcommand.py --fly -x 100 -y 100 -z 12 --speed 3 --exec __ns:=/dji0
+```
+
+
diff --git a/doc/prepare_ros_computer.md b/doc/prepare_ros_computer.md
index b7998b5..561485e 100644
--- a/doc/prepare_ros_computer.md
+++ b/doc/prepare_ros_computer.md
@@ -2,7 +2,12 @@
 
 If you already have a ROS computer with a docker daeamon running you can do:
 
-### Configuring Development Computer
+## Install Docker
+
+See [docker_linux.md]() for installation instruction for Ubuntu 18.04 and 20.04.
+
+
+## Configuring Development Computer
 
 You need an Ubuntu machine with Docker installed.  Tested with 18.04 and 20.04.
 
-- 
GitLab