@@ -22,29 +22,43 @@ docker pull osrf/subt-virtual-testbed:cloudsim_sim_latest
2222docker pull osrf/subt-virtual-testbed:cloudsim_bridge_latest
2323```
2424
25+ ## Precoditions
26+
27+ 3D X server needs to be running under the same user that is going to be running the simulation.
28+ If the X server runs display ` :0 ` the variable ` DISPLAY ` needs to be set and exported
29+ ```
30+ export DISPLAY=:0
31+ ```
32+ Also ` XAUTHORITY ` variable needs to be set to point to the location of the XAuthority file. Example on
33+ ubuntu could be
34+ ```
35+ $ echo $XAUTHORITY
36+ /run/user/1000/gdm/Xauthority
37+ ```
38+ Another possiblity is to run ` xhost + ` to disable the security on the X server or ` xhost +local: ` to allow
39+ any local user to access the X server.
40+
41+ The main point here is that the simulation can find and access the 3D X server.
42+
2543## Build and run locally simple unittest image
2644```
2745./subt/docker/build.bash unittest
2846./subt/docker/run.bash unittest
2947```
30-
3148It is necessary to run also simulation and bridge in other two terminals:
3249- terminal 1
3350 ```
34- xhost +local:root
35- ROBOT=X0F200L WORLD=urban_circuit_practice_01 ./subt/script/sim.bash
51+ ROBOT=X100L WORLD=simple_cave_01 ./subt/script/sim.bash
3652 ```
37- Note, that `xhost` workaround is not secure and it is current workaround how to start the process for the first time,
38- open screen session and then use the simulator remotely via ssh.
3953
4054- terminal 2
4155 ```
42- ROBOT=X0F200L WORLD=urban_circuit_practice_01 ./subt/script/bridge.bash
56+ ROBOT=X100L WORLD=simple_cave_01 ./subt/script/bridge.bash
4357 ```
4458
4559Note, that configuration and robot name is variable. The command above with
46- robot name X0F200L encodes waiting for 0 s, exploring for 200 s and navigating
47- along a wall on the left. Our own ROBOTIKA_X2_SENSOR_CONFIG_1 is used. It is
60+ robot name X100L encodes exploring for 100 s and navigating
61+ along a wall on the left. Our own ROBOTIKA_X2_SENSOR_CONFIG_1 is used by default . It is
4862a small robot, 30m lidar, 640x380 RGBD camera and gas detector.
4963
5064The unittest should display number of received messages for scan, image, imu, odometry and clock. After 10000 clock
@@ -66,32 +80,32 @@ solution not covered by this HOWTO.
6680```commandline
6781./subt/docker/run.bash robotika
6882```
69- which by default runs ` ./src/osgar/subt/docker/robotika/run_solution.bash ` inside the container.
70- To get a shell inside the docker instead, run
83+ which by default runs ` /osgar-ws/run_solution.bash ` which itself is soft link to
84+ ` /osgar-ws/src/osgar/subt/docker/robotika/run_solution.bash ` inside the container.
85+ To get a shell inside the container instead, run
7186``` commandline
7287./subt/docker/run.bash robotika bash
7388```
7489and you can call ` run_solution.bash ` when you are ready.
7590
7691A copy of ` osgar ` directory from the time of the build of the image is located
77- at ` /home/developer/subt_solution/ osgar ` . For local development it is advantageous
92+ at ` /osgar-ws/src/ osgar/ ` . For local development it is advantageous
7893to mount your ` osgar ` directory from the host over this directory in the container.
7994
8095``` commandline
8196./subt/script/devel.bash
8297```
8398
8499When you do so, you can edit the files as you are used to. To rebuild the ROS
85- nodes from within the running container, switch to ` /osgar-ws/build/ ` directory
86- and call ` make ` . After that running
87- ` ./src/osgar/subt/docker/robotika/run_solution.bash ` will run the rebuilt version.
100+ nodes from within the running container, call ` make ` in ` /osgar-ws/ ` directory
101+ After that running ` /osgar-ws/run_solution.bash ` will run the rebuilt version.
88102
89103At this moment you should see waiting for ROS master, debug count outputs of received messages
90104(similarly as in unittest) and Python3 outputs of robot navigating towards the gate. The exploration reports
91105number and type of received messages by OSGAR.
92106
93- There is a logfile available when the robot finishes. It is in the current
94- directory with name zmq * .log. It is necessary to upload the logfile (for example
107+ There is a logfile available when the robot finishes in ` /osgar-ws/logs/ ` .
108+ It is necessary to copy the logfile (for example
95109via ` docker cp ` ) to the host for further analysis, otherwise
96110it will be lost with the termination of the container.
97111
0 commit comments