Skip to content

Commit

Permalink
fix docker.sh dv (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA authored Dec 4, 2024
1 parent 345d6e6 commit 4cf939c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions scripts/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,16 @@ setup_image_name_and_version() {
IMAGE_NAME=$DOCKERHUB_REPOSITOTY:$TAG_NAME
}

setup_mavlink_sitl_config() {
setup_minimim_required_docker_flags() {
DOCKER_FLAGS="--net=host"
DOCKER_FLAGS="$DOCKER_FLAGS -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -e DISPLAY=$DISPLAY -e QT_X11_NO_MITSHM=1)"
DOCKER_FLAGS+=" -v /tmp/.X11-unix:/tmp/.X11-unix:rw"
DOCKER_FLAGS+=" -e DISPLAY=$DISPLAY"
DOCKER_FLAGS+=" -e QT_X11_NO_MITSHM=1"
DOCKER_FLAGS+=" --volume=${REPOSITORY_DIR}/uav_dynamics/uav_hitl_dynamics/config:/catkin_ws/src/uav_hitl_simulator/uav_dynamics/uav_hitl_dynamics/config:ro"
}

setup_dronecan_hitl_config() {
setup_mavlink_sitl_config
setup_minimim_required_docker_flags
if [ -z "$SNIFFER" ]; then
source ./tools/can/create_slcan.sh --only-find
DRONECAN_DEV_PATH_SYMLINK=$DEV_PATH
Expand All @@ -99,7 +102,7 @@ setup_dronecan_hitl_config() {
}

setup_cyphal_hitl_config() {
setup_mavlink_sitl_config
setup_minimim_required_docker_flags
if [ -z "$SNIFFER" ]; then
source ./tools/can/create_slcan.sh --only-find
CYPHAL_DEV_PATH_SYMLINK=$DEV_PATH
Expand All @@ -118,7 +121,7 @@ setup_cyphal_hitl_config() {
}

setup_cyphal_and_dronecan_hitl_config() {
setup_mavlink_sitl_config
setup_minimim_required_docker_flags

DRONECAN_DEV_PATH_SYMLINK="/dev/serial/by-id/usb-STMicroelectronics_STM32_STLink_0674FF524957778667133858-if02"
CYPHAL_DEV_PATH_SYMLINK="/dev/serial/by-id/usb-STMicroelectronics_STM32_STLink_066AFF524957778667134207-if02"
Expand Down Expand Up @@ -156,7 +159,7 @@ docker_countainer_run_interactive() {
}

docker_container_run_test() {
setup_mavlink_sitl_config
setup_minimim_required_docker_flags
docker container run --rm $DOCKER_FLAGS $IMAGE_NAME ./uav_dynamics/uav_hitl_dynamics/catkin_test.sh --docker
}

Expand Down Expand Up @@ -191,7 +194,7 @@ docker_container_run_cyphal() {

docker_container_run_mavlink() {
docker_kill_all_related_containers
setup_mavlink_sitl_config
setup_minimim_required_docker_flags
docker container run --rm $DOCKER_FLAGS $IMAGE_NAME ./scripts/run_sim.sh ${vehicle}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/run_sim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ setup_cyphal_hitl() {

setup_combined_hitl() {
if [ ! -z $DRONECAN_DEV_PATH_SYMLINK ]; then
echo "Trying to create slcan0 for dronecan..."
echo "Trying to create slcan0 for combined HITL: dronecan..."
$SCRIPT_DIR/tools/can/create_slcan.sh -d $DRONECAN_DEV_PATH_SYMLINK -i slcan0
fi
if [ ! -z $CYPHAL_DEV_PATH_SYMLINK ]; then
echo "Trying to create slcan1 for cyphal..."
echo "Trying to create slcan1 for combined HITL: cyphal..."
$SCRIPT_DIR/tools/can/create_slcan.sh -d $CYPHAL_DEV_PATH_SYMLINK -i slcan1
source $SCRIPT_DIR/cyphal_config_slcan1.sh
fi
Expand Down

0 comments on commit 4cf939c

Please sign in to comment.