From 393e62276129a0960ae34be4685d142761d99071 Mon Sep 17 00:00:00 2001 From: Vimarsh Date: Wed, 2 Jul 2025 11:26:16 +0530 Subject: [PATCH] working on support and testing functionality with ros2 jazzy --- bash_into_container.sh | 6 ++++++ start_container.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100755 bash_into_container.sh create mode 100755 start_container.sh diff --git a/bash_into_container.sh b/bash_into_container.sh new file mode 100755 index 0000000..654f1e9 --- /dev/null +++ b/bash_into_container.sh @@ -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 \ No newline at end of file diff --git a/start_container.sh b/start_container.sh new file mode 100755 index 0000000..ef17899 --- /dev/null +++ b/start_container.sh @@ -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