Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple small fixes and add docker rviz support #61

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM osrf/ros:melodic-desktop-bionic
ENV CATKIN_WS=/root/covins_ws

# fix keys see (https://github.com/googlecartographer/cartographer_ros/issues/1323)
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA
RUN apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116

# install ros packages
Expand Down
25 changes: 24 additions & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ ROS_CLIENT=0
CLIENT=0
ROS_CORE=0
FRONTEND_WRAPPER=0
RVIZ=0

while getopts "hsforct" opt; do
while getopts "hsforcvt" opt; do
case "$opt" in
h)
echoUsage
Expand All @@ -103,6 +104,8 @@ while getopts "hsforct" opt; do
;;
c) ROS_CORE=1
;;
v) RVIZ=1
;;
t) ;;
*)
echoUsage
Expand Down Expand Up @@ -143,6 +146,8 @@ elif [ $ROS_CLIENT -eq 1 ]; then
elif [ $FRONTEND_WRAPPER -eq 1 ]; then
CONFIG_FILE_COMM=$(absPath ${*: -2:1})
LAUNCH_FILE=$(absPath ${*: -1})
echo ${CONFIG_FILE_COMM};
echo ${LAUNCH_FILE};
docker run \
-it \
--rm \
Expand Down Expand Up @@ -183,6 +188,24 @@ elif [ $ROS_CORE -eq 1 ]; then
/bin/bash -c \
"cd ${CATKIN_WS}; \
roscore"
elif [ $RVIZ -eq 1 ]; then
docker run \
-it \
--privileged \
--rm \
--net=host \
--env DISPLAY=${DISPLAY} \
--env QT_X11_NO_MITSHM=1 \
--env XAUTHORITY=/tmp/.docker.xauth \
--env ROS_IP=${ROS_IP} \
--env ROS_MASTER_URI=${ROS_MASTER_URI} \
--volume /tmp/.X11-unix:/tmp/.X11-unix:rw \
--volume /tmp/.docker.xauth:/tmp/.docker.xauth \
covins \
/bin/bash -c \
"source devel/setup.bash; \
roslaunch src/covins/covins_backend/launch/tf.launch &
rviz -d /root/covins_ws/src/covins/covins_backend/config/covins.rviz"
else
docker run \
-it \
Expand Down
17 changes: 17 additions & 0 deletions docker/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

function setup_xauth() {
local XAUTH=/tmp/.docker.xauth

if [ ! -f $XAUTH ]; then
xauth_list=$(xauth nlist :0 | sed -e 's/^..../ffff/')
if [ -n "$xauth_list" ]; then
echo "$xauth_list" | xauth -f $XAUTH nmerge -
else
touch $XAUTH
fi
chmod a+r $XAUTH
fi
}

setup_xauth
18 changes: 16 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,29 @@ The convins server back-end needs a running roscore, how to start one see above.

#### ORB-SLAM3 Front-End
The ORB-SLAM3 front-end client needs the communication server config file, the file which should be executed, and the path to the dataset. The dataset has to be given seperately since the file system of the docker container differs from the host system. Hence, the `pathDatasetEuroc` variable in the run script gets adapted automatically inside the docker container.
* ```./run.sh -o ../covins_comm/config/config_comm.yaml ../orb_slam3/covins_examples/euroc_examples_mh1 <dataset_path, e.g. /home/pschmuck/data/euroc>```
* ```./run.sh -o ../covins_comm/config/config_comm.yaml ../orb_slam3/covins_examples/euroc_examples_mh1.sh <dataset_path, e.g. /home/pschmuck/data/euroc>```

#### ORB-SLAM3 ROS Front-End
The ROS wrapper of the ORB-SLAM3 front-end can also be started in the docker container. It requires the server config file and the ROS launch file. A bag file can then for example be played on the host system.
* ```./run.sh -r ../covins_comm/config/config_comm.yaml ../orb_slam3/Examples/ROS/ORB_SLAM3/launch/launch_docker_ros_euroc.launch```

#### ROS Front-End Wrapper (Only for COVINS-G)
The ROS Front-end wrapper can also be started in the docker container. It requires the server config file and the ROS launch file. A bag file can then for example be played on the host system.
* ```./run.sh -f ../covins_comm/config/config_comm.yaml ../covins_frontend/launch/covins_frontend/launch/vins_docker_euroc_agent.launch```
* ```./run.sh -f ../covins_comm/config/config_comm.yaml ../covins_frontend/launch/vins_docker_euroc_agent.launch```

#### Run rviz
A terminal within the docker image can also be opened. This can for example be used to send `rosservice` commands.

In one terminal:
* ```./run.sh -t```
* ```export ROS_IP=public_IP_of_!SERVER!```
* ```roslaunch src/covins/covins_backend/launch/tf.launch```

In another terminal:
* ```./setup.sh```
* ```export ROS_IP=public_IP_of_!SERVER!```
* ```export ROS_MASTER_URI=http://IP_of_the_!SERVER!:11311```
* ```./run.sh -v```

#### Terminal
A terminal within the docker image can also be opened. This can for example be used to send `rosservice` commands.
Expand Down