Skip to content

[wip] Adding support and testing functionality with ros2 jazzy #51

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

Open
wants to merge 1 commit into
base: ros2
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
6 changes: 6 additions & 0 deletions bash_into_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
xhost +local:root

docker exec -it --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" -e "ROS_DOMAIN_ID=0" bcr_arm_container /bin/bash -c "cd /bcr_ws && colcon build && source install/setup.bash && exec bash"

xhost -local:root
32 changes: 32 additions & 0 deletions start_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Start a new BCR ARM container if not already running
if [ ! "$(docker ps -q -f name=bcr_arm_container)" ]; then
if [ "$(docker ps -aq -f status=exited -f name=bcr_arm_container)" ]; then
# Container exists but is stopped, remove it
docker rm bcr_arm_container
fi

# Enable X11 forwarding
xhost +local:docker

# Start new container
docker run -it \
--name bcr_arm_container \
--network host \
-e DISPLAY=$DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-e CYCLONEDX_URI=/ddsconfig.xml \
-e ROS_DOMAIN_ID=0 \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-v /dev/dri:/dev/dri \
-v "$(dirname "$0")/../../docker/ddsconfig.xml":/ddsconfig.xml \
-v "$(dirname "$0")":/bcr_ws/src/bcr_bot \
--privileged \
bcr_arm:jazzy-harmonic \
/bin/bash -c "cd /bcr_ws && rosdep install -i --from-path src --rosdistro jazzy -y && . /opt/ros/jazzy/setup.bash && colcon build && exec bash"

echo "BCR ARM container started."
else
echo "BCR ARM container is already running."
fi