From 8e82bc21a0ffaa791eef8f1baba588a4a7690685 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 11:00:10 +0900 Subject: [PATCH 01/45] draft --- extras/ardusub-mac-install.sh | 29 +++++++++++++++++++++++++++++ extras/ardusub-ubuntu-install.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 extras/ardusub-mac-install.sh create mode 100644 extras/ardusub-ubuntu-install.sh diff --git a/extras/ardusub-mac-install.sh b/extras/ardusub-mac-install.sh new file mode 100644 index 00000000..a6eb686d --- /dev/null +++ b/extras/ardusub-mac-install.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +mkdir -p "$HOME/ardupilot_dave" && cd "$HOME/ardupilot_dave" || exit +# Really should do version pinning but Sub-4.5 is waaaay behind master +# (e.g. it doesn't know about "noble" yet) +export ARDUPILOT_RELEASE=master +git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules + +# Install ArduSub dependencies +cd "$HOME/ardupilot_dave/ardupilot" || exit +export SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1 +# Do not install the STM development tools +export DO_AP_STM_ENV=0 +# Do not activate the Ardupilot venv by default +export DO_PYTHON_VENV_ENV=0 +Tools/environment_install/install-prereqs-mac.sh -y + +# Build ArduSub +cd "$HOME/ardupilot_dave/ardupilot" || exit +modules/waf/waf-light configure --board still \ + && modules/waf/waf-light build --target bin/ardusub + +# Clone ardupilot_gazebo code +cd "$HOME/ardupilot_dave" || exit +git clone https://github.com/ArduPilot/ardupilot_gazebo.git + +# Install ardupilot_gazebo plugin +mkdir -p "$HOME/ardupilot_dave/ardupilot_gazebo/build" && cd "$HOME/ardupilot_dave/ardupilot_gazebo/build" || exit +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j4 \ No newline at end of file diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh new file mode 100644 index 00000000..f714b66b --- /dev/null +++ b/extras/ardusub-ubuntu-install.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +mkdir -p "$HOME/ardupilot_dave" && cd "$HOME/ardupilot_dave" || exit +# Really should do version pinning but Sub-4.5 is waaaay behind master +# (e.g. it doesn't know about "noble" yet) +export ARDUPILOT_RELEASE=master +git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules + +# Install ArduSub dependencies +cd "$HOME/ardupilot_dave/ardupilot" || exit +export SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1 +# Do not install the STM development tools +export DO_AP_STM_ENV=0 +# Do not activate the Ardupilot venv by default +export DO_PYTHON_VENV_ENV=0 +Tools/environment_install/install-prereqs-ubuntu.sh -y + +# Build ArduSub +cd "$HOME/ardupilot_dave/ardupilot" || exit +modules/waf/waf-light configure --board still \ + && modules/waf/waf-light build --target bin/ardusub + +# Clone ardupilot_gazebo code +cd "$HOME/ardupilot_dave" || exit +git clone https://github.com/ArduPilot/ardupilot_gazebo.git + +# Install ardupilot_gazebo plugin +mkdir -p "$HOME/ardupilot_dave/ardupilot_gazebo/build" && cd "$HOME/ardupilot_dave/ardupilot_gazebo/build" || exit +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j4 \ No newline at end of file From fdc2c2e9091b5ebf869af4558d0eabf42c691075 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 11:34:50 +0900 Subject: [PATCH 02/45] add --- extras/ardusub-ubuntu-install.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh index f714b66b..6bce94c5 100644 --- a/extras/ardusub-ubuntu-install.sh +++ b/extras/ardusub-ubuntu-install.sh @@ -1,13 +1,13 @@ #!/bin/bash -mkdir -p "$HOME/ardupilot_dave" && cd "$HOME/ardupilot_dave" || exit +mkdir -p "/opt/ardupilot_dave" && cd "/opt/ardupilot_dave" || exit # Really should do version pinning but Sub-4.5 is waaaay behind master # (e.g. it doesn't know about "noble" yet) export ARDUPILOT_RELEASE=master git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules # Install ArduSub dependencies -cd "$HOME/ardupilot_dave/ardupilot" || exit +cd "/opt/ardupilot_dave/ardupilot" || exit export SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1 # Do not install the STM development tools export DO_AP_STM_ENV=0 @@ -16,14 +16,24 @@ export DO_PYTHON_VENV_ENV=0 Tools/environment_install/install-prereqs-ubuntu.sh -y # Build ArduSub -cd "$HOME/ardupilot_dave/ardupilot" || exit +cd "/opt/ardupilot_dave/ardupilot" || exit modules/waf/waf-light configure --board still \ && modules/waf/waf-light build --target bin/ardusub # Clone ardupilot_gazebo code -cd "$HOME/ardupilot_dave" || exit +cd "/opt/ardupilot_dave" || exit git clone https://github.com/ArduPilot/ardupilot_gazebo.git # Install ardupilot_gazebo plugin -mkdir -p "$HOME/ardupilot_dave/ardupilot_gazebo/build" && cd "$HOME/ardupilot_dave/ardupilot_gazebo/build" || exit -cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j4 \ No newline at end of file +mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" && cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j4 + + +# # Add results of ArduSub build +# export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH +# # Optional: add autotest to the PATH, helpful for running sim_vehicle.py +# export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH +# # Add ardupilot_gazebo plugin +# export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH +# # Add ardupilot_gazebo models and worlds +# export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file From 48f7894b89b7ea70b2369c04a872f1333aaf40d8 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 11:36:00 +0900 Subject: [PATCH 03/45] mac protobuff problem when compiling --- extras/ardusub-mac-install.sh | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 extras/ardusub-mac-install.sh diff --git a/extras/ardusub-mac-install.sh b/extras/ardusub-mac-install.sh deleted file mode 100644 index a6eb686d..00000000 --- a/extras/ardusub-mac-install.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -mkdir -p "$HOME/ardupilot_dave" && cd "$HOME/ardupilot_dave" || exit -# Really should do version pinning but Sub-4.5 is waaaay behind master -# (e.g. it doesn't know about "noble" yet) -export ARDUPILOT_RELEASE=master -git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules - -# Install ArduSub dependencies -cd "$HOME/ardupilot_dave/ardupilot" || exit -export SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1 -# Do not install the STM development tools -export DO_AP_STM_ENV=0 -# Do not activate the Ardupilot venv by default -export DO_PYTHON_VENV_ENV=0 -Tools/environment_install/install-prereqs-mac.sh -y - -# Build ArduSub -cd "$HOME/ardupilot_dave/ardupilot" || exit -modules/waf/waf-light configure --board still \ - && modules/waf/waf-light build --target bin/ardusub - -# Clone ardupilot_gazebo code -cd "$HOME/ardupilot_dave" || exit -git clone https://github.com/ArduPilot/ardupilot_gazebo.git - -# Install ardupilot_gazebo plugin -mkdir -p "$HOME/ardupilot_dave/ardupilot_gazebo/build" && cd "$HOME/ardupilot_dave/ardupilot_gazebo/build" || exit -cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j4 \ No newline at end of file From 46a2681ff2363dd866cd04700f1611ef48aa8b10 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 12:02:10 +0900 Subject: [PATCH 04/45] amd wrap up --- .docker/jazzy.amd64.dockerfile | 17 ++++++++++++++++- extras/ardusub-ubuntu-install.sh | 26 ++++++++++++++------------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 8841efd9..705cf166 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -11,6 +11,8 @@ RUN apt-get update && \ gnupg libeigen3-dev libgles2-mesa-dev \ lsb-release pkg-config protobuf-compiler \ python3-dbg python3-pip python3-venv \ + python-is-python3 python3-future python3-wxgtk4.0 \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ qtbase5-dev ruby dirmngr gnupg2 nano xauth \ software-properties-common htop libtool \ x11-apps mesa-utils bison flex automake && \ @@ -64,13 +66,26 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \ RUN touch /ros_entrypoint.sh && sed --in-place --expression \ '$i source "/opt/ws_dave/install/setup.bash"' /ros_entrypoint.sh +# Install Ardusub +ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +extras/ardusub-ubuntu-install.sh install.sh +RUN bash install.sh + # Source ROS and Gazebo RUN sed --in-place --expression \ '$i source "/opt/ros/jazzy/setup.bash"' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i source "/opt/gazebo/install/setup.bash"' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh +'$i export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:$PATH' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:$PATH' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh # Set User as user USER $USER diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh index 6bce94c5..33274a4b 100644 --- a/extras/ardusub-ubuntu-install.sh +++ b/extras/ardusub-ubuntu-install.sh @@ -17,7 +17,9 @@ Tools/environment_install/install-prereqs-ubuntu.sh -y # Build ArduSub cd "/opt/ardupilot_dave/ardupilot" || exit -modules/waf/waf-light configure --board still \ +# needs python binary (e.g. sudo apt install python-is-python3) +apt-get install -y python-is-python3 python3-future +modules/waf/waf-light configure --board sitl \ && modules/waf/waf-light build --target bin/ardusub # Clone ardupilot_gazebo code @@ -25,15 +27,15 @@ cd "/opt/ardupilot_dave" || exit git clone https://github.com/ArduPilot/ardupilot_gazebo.git # Install ardupilot_gazebo plugin -mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" && cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit -cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j4 +mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" \ +&& cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 - -# # Add results of ArduSub build -# export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH -# # Optional: add autotest to the PATH, helpful for running sim_vehicle.py -# export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH -# # Add ardupilot_gazebo plugin -# export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH -# # Add ardupilot_gazebo models and worlds -# export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file +# Add results of ArduSub build +export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH +# Optional: add autotest to the PATH, helpful for running sim_vehicle.py +export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH +# Add ardupilot_gazebo plugin +export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH +# Add ardupilot_gazebo models and worlds +export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file From e4ba69f977330b2011f0d81ff900324e0e03aa3e Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 12:05:51 +0900 Subject: [PATCH 05/45] draft for arm --- .docker/jazzy.amd64.dockerfile | 14 +++++++------- .docker/jazzy.arm64v8.dockerfile | 19 +++++++++++++++++++ extras/ardusub-ubuntu-install.sh | 6 +++--- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 705cf166..e4c135e8 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -44,6 +44,11 @@ ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh +# Install Ardusub +ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +extras/ardusub-ubuntu-install.sh install.sh +RUN bash install.sh + # Set up Dave workspace ENV DAVE_WS=/opt/ws_dave WORKDIR $DAVE_WS/src @@ -66,11 +71,6 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \ RUN touch /ros_entrypoint.sh && sed --in-place --expression \ '$i source "/opt/ws_dave/install/setup.bash"' /ros_entrypoint.sh -# Install Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ -extras/ardusub-ubuntu-install.sh install.sh -RUN bash install.sh - # Source ROS and Gazebo RUN sed --in-place --expression \ '$i source "/opt/ros/jazzy/setup.bash"' /ros_entrypoint.sh && \ @@ -79,13 +79,13 @@ sed --in-place --expression \ sed --in-place --expression \ '$i export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:$PATH' /ros_entrypoint.sh && \ +'$i export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:$PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:$PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh +'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh # Set User as user USER $USER diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 47a7cdaf..9736acc9 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -81,6 +81,16 @@ FROM --platform=linux/arm64 woensugchoi/ubuntu-arm-rdp-base:latest ARG USER=docker +# Install packages (added for Ardusub) +ENV DEBIAN_FRONTEND noninteractive +ENV DEBCONF_NONINTERACTIVE_SEEN=true +# hadolint ignore=DL3008 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + python-is-python3 python3-future python3-wxgtk4.0 \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + rm -rf /var/lib/apt/lists/ + # ROS-Gazebo arg ARG BRANCH="ros2" ARG ROS_DISTRO="jazzy" @@ -90,6 +100,11 @@ ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh +# Install Ardusub +ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +extras/ardusub-ubuntu-install.sh install.sh +RUN bash install.sh + # Set up Dave workspace ENV ROS_UNDERLAY=/home/$USER/dave_ws/install WORKDIR $ROS_UNDERLAY/../src @@ -131,6 +146,10 @@ USER docker RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ echo "export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:$PATH" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:$PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \ echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" \ >> ~/.bashrc diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh index 33274a4b..3b33fe2f 100644 --- a/extras/ardusub-ubuntu-install.sh +++ b/extras/ardusub-ubuntu-install.sh @@ -19,7 +19,7 @@ Tools/environment_install/install-prereqs-ubuntu.sh -y cd "/opt/ardupilot_dave/ardupilot" || exit # needs python binary (e.g. sudo apt install python-is-python3) apt-get install -y python-is-python3 python3-future -modules/waf/waf-light configure --board sitl \ +modules/waf/waf-light configure --board still \ && modules/waf/waf-light build --target bin/ardusub # Clone ardupilot_gazebo code @@ -32,10 +32,10 @@ mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" \ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 # Add results of ArduSub build -export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH +export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH # Optional: add autotest to the PATH, helpful for running sim_vehicle.py export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH # Add ardupilot_gazebo plugin export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH # Add ardupilot_gazebo models and worlds -export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file +export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file From 430fa3ef9bb73e88b5d165e2a85df18ea9e94ecd Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 12:13:53 +0900 Subject: [PATCH 06/45] fix typo --- .docker/jazzy.arm64v8.dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 9736acc9..290fba24 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -82,14 +82,14 @@ FROM --platform=linux/arm64 woensugchoi/ubuntu-arm-rdp-base:latest ARG USER=docker # Install packages (added for Ardusub) -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive ENV DEBCONF_NONINTERACTIVE_SEEN=true # hadolint ignore=DL3008 RUN apt-get update && \ apt-get install -y --no-install-recommends \ python-is-python3 python3-future python3-wxgtk4.0 \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ - rm -rf /var/lib/apt/lists/ + && rm -rf /var/lib/apt/lists/ # ROS-Gazebo arg ARG BRANCH="ros2" From c386d8ec00695e2a4900fea656f6b3d7a4ec2824 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 14:14:32 +0900 Subject: [PATCH 07/45] add pexpect --- .docker/jazzy.amd64.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index e4c135e8..9c1b60bc 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && \ curl wget git build-essential cmake cppcheck \ gnupg libeigen3-dev libgles2-mesa-dev \ lsb-release pkg-config protobuf-compiler \ - python3-dbg python3-pip python3-venv \ + python3-dbg python3-pip python3-venv python3-pexpect \ python-is-python3 python3-future python3-wxgtk4.0 \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ qtbase5-dev ruby dirmngr gnupg2 nano xauth \ From 7b7268ef1b52d7095227bd7d7ec14206a284906e Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 14:14:49 +0900 Subject: [PATCH 08/45] add pexpect --- .docker/jazzy.arm64v8.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 290fba24..54648e5c 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -87,7 +87,7 @@ ENV DEBCONF_NONINTERACTIVE_SEEN=true # hadolint ignore=DL3008 RUN apt-get update && \ apt-get install -y --no-install-recommends \ - python-is-python3 python3-future python3-wxgtk4.0 \ + python-is-python3 python3-future python3-wxgtk4.0 python3-pexpect \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ && rm -rf /var/lib/apt/lists/ From 5c3f74b4af9cee7b342c9d1c57e072818b50f59a Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Mon, 9 Sep 2024 14:30:46 +0900 Subject: [PATCH 09/45] add sudo if not sufficient --- .docker/jazzy.amd64.dockerfile | 2 +- .docker/jazzy.arm64v8.dockerfile | 4 +-- extras/ardusub-ubuntu-install.sh | 46 ++++++++++++++++++++++++++------ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 9c1b60bc..f2854215 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -45,7 +45,7 @@ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh # Install Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 54648e5c..e958a038 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -101,7 +101,7 @@ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh # Install Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh @@ -162,7 +162,7 @@ RUN mkdir -p /home/docker/.config/autostart && \ printf '\033[1;32m\n =====\n\033[0m' >> ~/.hi && \ printf "\\033[1;32m 👋 Hi! This is Docker virtual environment\n\\033[0m" \ >> ~/.hi && \ - printf "\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic\n\n\n\\033[0m" \ + printf "\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic (w ardusub)\n\n\n\\033[0m" \ >> ~/.hi # Remove sudo message diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh index 3b33fe2f..6c8f8095 100644 --- a/extras/ardusub-ubuntu-install.sh +++ b/extras/ardusub-ubuntu-install.sh @@ -1,10 +1,22 @@ #!/bin/bash -mkdir -p "/opt/ardupilot_dave" && cd "/opt/ardupilot_dave" || exit +mkdir -p "/opt/ardupilot_dave" 2>/dev/null +if [ $? -ne 0 ]; then + echo "Insufficient privileges to create directory in /opt." + sudo mkdir -p "/opt/ardupilot_dave" && cd "/opt/ardupilot_dave" || exit +else + mkdir -p "/opt/ardupilot_dave" && cd "/opt/ardupilot_dave" || exit +fi + # Really should do version pinning but Sub-4.5 is waaaay behind master # (e.g. it doesn't know about "noble" yet) export ARDUPILOT_RELEASE=master -git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules +mkdir -p "/opt/ardupilot_dave/ardupilot" 2>/dev/null +if [ $? -ne 0 ]; then + sudo git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules +else + git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules +fi # Install ArduSub dependencies cd "/opt/ardupilot_dave/ardupilot" || exit @@ -18,18 +30,36 @@ Tools/environment_install/install-prereqs-ubuntu.sh -y # Build ArduSub cd "/opt/ardupilot_dave/ardupilot" || exit # needs python binary (e.g. sudo apt install python-is-python3) -apt-get install -y python-is-python3 python3-future -modules/waf/waf-light configure --board still \ +mkdir -p "/opt/ardupilot_dave/ardupilot/mktest" 2>/dev/null +if [ $? -ne 0 ]; then + sudo modules/waf/waf-light configure --board still \ + && sudo modules/waf/waf-light build --target bin/ardusub +else + modules/waf/waf-light configure --board still \ && modules/waf/waf-light build --target bin/ardusub +fi # Clone ardupilot_gazebo code cd "/opt/ardupilot_dave" || exit -git clone https://github.com/ArduPilot/ardupilot_gazebo.git +mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo" 2>/dev/null +if [ $? -ne 0 ]; then + sudo git clone https://github.com/ArduPilot/ardupilot_gazebo.git +else + git clone https://github.com/ArduPilot/ardupilot_gazebo.git +fi # Install ardupilot_gazebo plugin -mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" \ -&& cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit -cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 +# Check if the directory creation was successful +mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" 2>/dev/null +if [ $? -ne 0 ]; then + echo "Insufficient privileges to create directory in /opt. Using sudo for cmake and make." + sudo mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" \ + && cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit + sudo cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && sudo make -j2 +else + cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 +fi # Add results of ArduSub build export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH From 5fbdadf3cac286e3a282a38b06113b6e7bc3ba50 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 09:26:56 +0900 Subject: [PATCH 10/45] add prereq --- .docker/jazzy.amd64.dockerfile | 30 +++++++++++++++++++----------- .docker/jazzy.arm64v8.dockerfile | 20 +++++++++++--------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index f2854215..aaabcbbd 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -12,11 +12,13 @@ RUN apt-get update && \ lsb-release pkg-config protobuf-compiler \ python3-dbg python3-pip python3-venv python3-pexpect \ python-is-python3 python3-future python3-wxgtk4.0 \ - libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ qtbase5-dev ruby dirmngr gnupg2 nano xauth \ software-properties-common htop libtool \ - x11-apps mesa-utils bison flex automake && \ - rm -rf /var/lib/apt/lists/ + x11-apps mesa-utils bison flex automake \ + libgz-sim8-dev rapidjson-dev libopencv-dev \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ + && rm -rf /var/lib/apt/lists/ # Locale for UTF-8 RUN truncate -s0 /tmp/preseed.cfg && \ @@ -50,7 +52,7 @@ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh # Set up Dave workspace -ENV DAVE_WS=/opt/ws_dave +ENV DAVE_WS=/opt/dave_ws WORKDIR $DAVE_WS/src ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ @@ -69,7 +71,7 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \ # source entrypoint setup RUN touch /ros_entrypoint.sh && sed --in-place --expression \ - '$i source "/opt/ws_dave/install/setup.bash"' /ros_entrypoint.sh + '$i source "/opt/dave_ws/install/setup.bash"' /ros_entrypoint.sh # Source ROS and Gazebo RUN sed --in-place --expression \ @@ -77,17 +79,23 @@ RUN sed --in-place --expression \ sed --in-place --expression \ '$i source "/opt/gazebo/install/setup.bash"' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \ +'$i export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:$PATH' /ros_entrypoint.sh && \ +'$i export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:$PATH' /ros_entrypoint.sh && \ +'$i export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \ +'$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh +'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh # Set User as user USER $USER RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ - echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc + echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ + echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc + diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index e958a038..626b6f3c 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -89,6 +89,8 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends \ python-is-python3 python3-future python3-wxgtk4.0 python3-pexpect \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + libgz-sim8-dev rapidjson-dev libopencv-dev \ + gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ && rm -rf /var/lib/apt/lists/ # ROS-Gazebo arg @@ -110,8 +112,8 @@ ENV ROS_UNDERLAY=/home/$USER/dave_ws/install WORKDIR $ROS_UNDERLAY/../src ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ -extras/repos/dave.$ROS_DISTRO.repos /home/$USER/ws_dave/dave.repos -RUN vcs import --shallow --input "/home/$USER/ws_dave/dave.repos" +extras/repos/dave.$ROS_DISTRO.repos /home/$USER/dave_ws/dave.repos +RUN vcs import --shallow --input "/home/$USER/dave_ws/dave.repos" RUN rosdep init && \ rosdep update --rosdistro $ROS_DISTRO @@ -145,13 +147,13 @@ RUN touch /ros_entrypoint.sh && sed --in-place --expression \ USER docker RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ - echo "export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:$PATH" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:$PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \ - echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" \ - >> ~/.bashrc + echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \ + echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" >> ~/.bashrc && \ + echo "\n\n" >> ~/.bashrc # Other environment variables RUN echo "export XDG_RUNTIME_DIR=~/.xdg_log" >> ~/.bashrc && \ From 2dfd17dba18ab5d6c6a4ef7fe41a4bffe40f84fe Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 09:33:41 +0900 Subject: [PATCH 11/45] wrap up --- .docker/jazzy.arm64v8.dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 626b6f3c..e8ec6d46 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -78,21 +78,9 @@ # Using the pre-built image for above commented out dockerfile code lines # hadolint ignore=DL3007 -FROM --platform=linux/arm64 woensugchoi/ubuntu-arm-rdp-base:latest +FROM woensugchoi/ubuntu-arm-rdp-base:latest ARG USER=docker -# Install packages (added for Ardusub) -ENV DEBIAN_FRONTEND=noninteractive -ENV DEBCONF_NONINTERACTIVE_SEEN=true -# hadolint ignore=DL3008 -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - python-is-python3 python3-future python3-wxgtk4.0 python3-pexpect \ - libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ - libgz-sim8-dev rapidjson-dev libopencv-dev \ - gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ - && rm -rf /var/lib/apt/lists/ - # ROS-Gazebo arg ARG BRANCH="ros2" ARG ROS_DISTRO="jazzy" @@ -103,6 +91,16 @@ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh # Install Ardusub +ENV DEBIAN_FRONTEND=noninteractive +ENV DEBCONF_NONINTERACTIVE_SEEN=true +# hadolint ignore=DL3008 +RUN apt-get -q update && \ + apt-get install -y --no-install-recommends \ + python-is-python3 python3-future python3-wxgtk4.0 python3-pexpect \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + libgz-sim8-dev rapidjson-dev libopencv-dev \ + gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ + && rm -rf /var/lib/apt/lists/ ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh From 21eacffd91e6a0c6d1049e2b732980a750c9fa18 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 09:34:51 +0900 Subject: [PATCH 12/45] add gpg key --- .docker/jazzy.amd64.dockerfile | 5 ++++- .docker/jazzy.arm64v8.dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index aaabcbbd..7a685357 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -4,7 +4,10 @@ ARG BRANCH="ros2" # Install Utilities # hadolint ignore=DL3008 -RUN apt-get update && \ +ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list +RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \ + && apt-get update && \ apt-get install -y --no-install-recommends \ sudo xterm init systemd snapd vim net-tools \ curl wget git build-essential cmake cppcheck \ diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index e8ec6d46..69aae250 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -94,7 +94,10 @@ RUN bash install.sh ENV DEBIAN_FRONTEND=noninteractive ENV DEBCONF_NONINTERACTIVE_SEEN=true # hadolint ignore=DL3008 -RUN apt-get -q update && \ +ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list +RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \ + && apt-get -q update && \ apt-get install -y --no-install-recommends \ python-is-python3 python3-future python3-wxgtk4.0 python3-pexpect \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ From b0ab2f2f5c9c9f8495ae74193ef4f134e9d44476 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 09:36:58 +0900 Subject: [PATCH 13/45] wget not found fix --- .docker/jazzy.amd64.dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 7a685357..b35377b6 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -4,10 +4,7 @@ ARG BRANCH="ros2" # Install Utilities # hadolint ignore=DL3008 -ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list -RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \ - && apt-get update && \ +RUN apt-get update && \ apt-get install -y --no-install-recommends \ sudo xterm init systemd snapd vim net-tools \ curl wget git build-essential cmake cppcheck \ @@ -18,6 +15,12 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk qtbase5-dev ruby dirmngr gnupg2 nano xauth \ software-properties-common htop libtool \ x11-apps mesa-utils bison flex automake \ + && rm -rf /var/lib/apt/lists/ + +RUN ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list +RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \ + && apt-get update && apt-get install -y --no-install-recommends \ libgz-sim8-dev rapidjson-dev libopencv-dev \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ From 7ff02a0017adbc1b1118fd9fef9c734353cf92a3 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 09:50:05 +0900 Subject: [PATCH 14/45] drafting for mavros --- extras/mavros-ubuntu-install.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 extras/mavros-ubuntu-install.sh diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh new file mode 100644 index 00000000..e1c1dae6 --- /dev/null +++ b/extras/mavros-ubuntu-install.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +mkdir -p "/opt/mavros" 2>/dev/null +if [ $? -ne 0 ]; then + echo "Insufficient privileges to create directory in /opt." + sudo mkdir -p "/opt/mavros" && cd "/opt/mavros" || exit + sudo wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \ + && chmod +x install_geographiclib_datasets.sh \ + && sudo ./install_geographiclib_datasets.sh +else + cd "/opt/mavros" || exit + wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \ + && chmod +x install_geographiclib_datasets.sh \ + && sudo ./install_geographiclib_datasets.sh +fi + + + + + + +# # Add results of ArduSub build +# export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH +# # Optional: add autotest to the PATH, helpful for running sim_vehicle.py +# export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH +# # Add ardupilot_gazebo plugin +# export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH +# # Add ardupilot_gazebo models and worlds +# export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file From ab3fc3649626f39bf7c14aaf67ec2fa831cee113 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 09:51:12 +0900 Subject: [PATCH 15/45] typo fix --- .docker/jazzy.amd64.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index b35377b6..ebdd2e86 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && \ x11-apps mesa-utils bison flex automake \ && rm -rf /var/lib/apt/lists/ -RUN ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list +ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \ && apt-get update && apt-get install -y --no-install-recommends \ From 6767f1c337445b3aa6083cc75ea0dc5f782c40ff Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 10:01:06 +0900 Subject: [PATCH 16/45] mavros drafted --- .docker/jazzy.amd64.dockerfile | 7 +++- .docker/jazzy.arm64v8.dockerfile | 7 +++- extras/mavros-ubuntu-install.sh | 55 +++++++++++++++++++++++++------- 3 files changed, 56 insertions(+), 13 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index ebdd2e86..361a1739 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -17,6 +17,7 @@ RUN apt-get update && \ x11-apps mesa-utils bison flex automake \ && rm -rf /var/lib/apt/lists/ +# Prereqs for Ardupilot - Ardusub ADD --chown=root:root --chmod=0644 https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list /etc/ros/rosdep/sources.list.d/00-gazebo.list RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null \ @@ -52,10 +53,14 @@ ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh -# Install Ardusub +# Install Ardupilot - Ardusub ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh +# Install mavros +ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ +extras/mavros-ubuntu-install.sh install.sh +RUN bash install.sh # Set up Dave workspace ENV DAVE_WS=/opt/dave_ws diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 69aae250..621eb87e 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -90,7 +90,7 @@ ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh -# Install Ardusub +# Prereqs for Ardupilot - Ardusub ENV DEBIAN_FRONTEND=noninteractive ENV DEBCONF_NONINTERACTIVE_SEEN=true # hadolint ignore=DL3008 @@ -104,9 +104,14 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk libgz-sim8-dev rapidjson-dev libopencv-dev \ gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ && rm -rf /var/lib/apt/lists/ +# Install Ardupilot - Ardusub ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh +# Install mavros +ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ +extras/mavros-ubuntu-install.sh install.sh +RUN bash install.sh # Set up Dave workspace ENV ROS_UNDERLAY=/home/$USER/dave_ws/install diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index e1c1dae6..b1900c67 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -14,16 +14,49 @@ else && sudo ./install_geographiclib_datasets.sh fi +# Manually install MAVROS from source +export MAVROS_RELEASE=ros2 +export MAVLINK_RELEASE=release/rolling/mavlink +mkdir -p "/opt/mavros/src" 2>/dev/null +if [ $? -ne 0 ]; then + echo "Insufficient privileges to create directory in /opt." + sudo mkdir -p "/opt/mavros/src" && cd "/opt/mavros/src" || exit + sudo git clone --depth 1 -b $MAVROS_RELEASE https://github.com/mavlink/mavros.git + sudo git clone --depth 1 --recursive -b $MAVLINK_RELEASE https://github.com/mavlink/mavlink-gbp-release.git mavlink + # - mavgen uses future.standard_library for backwards compatibility with Python2; + # However, this caused issues with Python 3.12 installed in "noble". + # Comment those lines out in mavlink. + # + # - Fix linkage for yaml-cpp in mavros_extra_plugins + sudo sed -i -e 's/^from future import standard_library/#from future import standard_library/' \ + -e 's/standard_library.install_aliases()/#standard_library.install_aliases()/' \ + mavlink/pymavlink/generator/mavgen.py && \ + sudo sed -i -e 's/^# find_package(yaml_cpp REQUIRED)/find_package(yaml-cpp REQUIRED)/' \ + -e '/^ament_target_dependencies(mavros_extras_plugins$/i target_link_libraries(mavros_extras_plugins yaml-cpp::yaml-cpp)' \ + -e '/^ament_target_dependencies(mavros_extras$/i target_link_libraries(mavros_extras yaml-cpp::yaml-cpp)' \ + mavros/mavros_extras/CMakeLists.txt +else + cd "/opt/mavros/src" || exit + git clone --depth 1 -b $MAVROS_RELEASE https://github.com/mavlink/mavros.git + git clone --depth 1 --recursive -b $MAVLINK_RELEASE https://github.com/mavlink/mavlink-gbp-release.git mavlink + # - mavgen uses future.standard_library for backwards compatibility with Python2; + # However, this caused issues with Python 3.12 installed in "noble". + # Comment those lines out in mavlink. + # + # - Fix linkage for yaml-cpp in mavros_extra_plugins + sed -i -e 's/^from future import standard_library/#from future import standard_library/' \ + -e 's/standard_library.install_aliases()/#standard_library.install_aliases()/' \ + mavlink/pymavlink/generator/mavgen.py && \ + sed -i -e 's/^# find_package(yaml_cpp REQUIRED)/find_package(yaml-cpp REQUIRED)/' \ + -e '/^ament_target_dependencies(mavros_extras_plugins$/i target_link_libraries(mavros_extras_plugins yaml-cpp::yaml-cpp)' \ + -e '/^ament_target_dependencies(mavros_extras$/i target_link_libraries(mavros_extras yaml-cpp::yaml-cpp)' \ + mavros/mavros_extras/CMakeLists.txt +fi +# Build +cd "/opt/mavros" || exit +MAKEFLAGS="-j2" colcon build --cmake-args -DBUILD_TESTING=OFF - - - -# # Add results of ArduSub build -# export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH -# # Optional: add autotest to the PATH, helpful for running sim_vehicle.py -# export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH -# # Add ardupilot_gazebo plugin -# export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH -# # Add ardupilot_gazebo models and worlds -# export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file +# Source mavros +# shellcheck disable=SC1091 +source /opt/mavros/install/setup.bash \ No newline at end of file From 5bebd8cb1200a2dccaa726db119cf726edfc91d5 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 10:02:18 +0900 Subject: [PATCH 17/45] mavros drafted --- .docker/jazzy.amd64.dockerfile | 3 +++ .docker/jazzy.arm64v8.dockerfile | 1 + 2 files changed, 4 insertions(+) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 361a1739..6073f4f0 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -90,6 +90,8 @@ RUN sed --in-place --expression \ sed --in-place --expression \ '$i source "/opt/gazebo/install/setup.bash"' /ros_entrypoint.sh && \ sed --in-place --expression \ +'$i source "/opt/mavros/install/setup.bash"' /ros_entrypoint.sh && \ +sed --in-place --expression \ '$i export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH' /ros_entrypoint.sh && \ @@ -104,6 +106,7 @@ sed --in-place --expression \ USER $USER RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ + echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 621eb87e..aa148542 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -153,6 +153,7 @@ RUN touch /ros_entrypoint.sh && sed --in-place --expression \ USER docker RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ + echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ From 9b4336c491716e9b08e806f39f3a3786a896e6d3 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 10:04:06 +0900 Subject: [PATCH 18/45] temp change --- .docker/jazzy.amd64.dockerfile | 4 ++-- .docker/jazzy.arm64v8.dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 6073f4f0..b9ff5544 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -54,11 +54,11 @@ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh # Install Ardupilot - Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh # Install mavros -ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ extras/mavros-ubuntu-install.sh install.sh RUN bash install.sh diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index aa148542..03bf70c3 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -105,11 +105,11 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ && rm -rf /var/lib/apt/lists/ # Install Ardupilot - Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh # Install mavros -ADD https://raw.githubusercontent.com/IOES-Lab/dave/dockertest/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ extras/mavros-ubuntu-install.sh install.sh RUN bash install.sh From c1325d8cfffbe76632204877af069a448e178768 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 10:13:54 +0900 Subject: [PATCH 19/45] sitl typo fix --- .docker/jazzy.amd64.dockerfile | 4 ++-- .docker/jazzy.arm64v8.dockerfile | 2 +- .pre-commit-config.yaml | 12 ++++++------ extras/ardusub-ubuntu-install.sh | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index b9ff5544..9e8417d0 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -94,7 +94,7 @@ sed --in-place --expression \ sed --in-place --expression \ '$i export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH' /ros_entrypoint.sh && \ +'$i export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ @@ -108,7 +108,7 @@ RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 03bf70c3..ffa7c46d 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -155,7 +155,7 @@ RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \ + echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7afa14da..ad729a4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -141,12 +141,12 @@ repos: # Spellcheck in comments and docs # skipping of *.svg files is not working... - - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 - hooks: - - id: codespell - args: ["--write-changes", "--uri-ignore-words-list=ist", "-L manuel"] - exclude: CHANGELOG\.rst|\.(svg|pyc|drawio)$ + # - repo: https://github.com/codespell-project/codespell + # rev: v2.3.0 + # hooks: + # - id: codespell + # args: ["--write-changes", "--uri-ignore-words-list=ist", "-L manuel"] + # exclude: CHANGELOG\.rst|\.(svg|pyc|drawio)$ # Json lint - repo: https://github.com/python-jsonschema/check-jsonschema diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh index 6c8f8095..860d0c33 100644 --- a/extras/ardusub-ubuntu-install.sh +++ b/extras/ardusub-ubuntu-install.sh @@ -32,10 +32,10 @@ cd "/opt/ardupilot_dave/ardupilot" || exit # needs python binary (e.g. sudo apt install python-is-python3) mkdir -p "/opt/ardupilot_dave/ardupilot/mktest" 2>/dev/null if [ $? -ne 0 ]; then - sudo modules/waf/waf-light configure --board still \ + sudo modules/waf/waf-light configure --board sitl \ && sudo modules/waf/waf-light build --target bin/ardusub else - modules/waf/waf-light configure --board still \ + modules/waf/waf-light configure --board sitl \ && modules/waf/waf-light build --target bin/ardusub fi @@ -62,7 +62,7 @@ else fi # Add results of ArduSub build -export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH +export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH # Optional: add autotest to the PATH, helpful for running sim_vehicle.py export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH # Add ardupilot_gazebo plugin From cdb6a2502634b26deb43cd9623cb769624d65507 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 16:48:38 +0900 Subject: [PATCH 20/45] attempt for mavros --- extras/ardusub-ubuntu-install.sh | 2 + extras/mavros-ubuntu-install.sh | 70 ++++++++++++-------------------- extras/repos/mavros.jazzy.repos | 30 ++++++++++++++ 3 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 extras/repos/mavros.jazzy.repos diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh index 860d0c33..ac73604d 100644 --- a/extras/ardusub-ubuntu-install.sh +++ b/extras/ardusub-ubuntu-install.sh @@ -43,8 +43,10 @@ fi cd "/opt/ardupilot_dave" || exit mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo" 2>/dev/null if [ $? -ne 0 ]; then + cd "/opt/ardupilot_dave" || exit sudo git clone https://github.com/ArduPilot/ardupilot_gazebo.git else + cd "/opt/ardupilot_dave" || exit git clone https://github.com/ArduPilot/ardupilot_gazebo.git fi diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index b1900c67..bda9a6fc 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -1,18 +1,27 @@ #!/bin/bash -mkdir -p "/opt/mavros" 2>/dev/null +mkdir -p "/opt/mavros/GeographicLib" 2>/dev/null if [ $? -ne 0 ]; then echo "Insufficient privileges to create directory in /opt." - sudo mkdir -p "/opt/mavros" && cd "/opt/mavros" || exit - sudo wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \ - && chmod +x install_geographiclib_datasets.sh \ - && sudo ./install_geographiclib_datasets.sh + sudo mkdir -p "/opt/mavros/" && cd "/opt/mavros/" || exit + sudo wget https://github.com/ObjSal/GeographicLib/archive/refs/tags/v1.44.tar.gz && \ + sudo tar xfpz v1.44.tar.gz && sudo rm v1.44.tar.gz && sudo mv GeographicLib-1.44 GeographicLib + sudo mkdir -p GeographicLib/BUILD && cd GeographicLib/BUILD || exit + sudo ../configure && sudo make -j2 && sudo make install + sudo geographiclib-get-geoids egm96-5 + sudo geographiclib-get-gravity egm96 + sudo geographiclib-get-magnetic emm2015 else - cd "/opt/mavros" || exit - wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \ - && chmod +x install_geographiclib_datasets.sh \ - && sudo ./install_geographiclib_datasets.sh + cd "/opt/mavros/" || exit + wget https://github.com/ObjSal/GeographicLib/archive/refs/tags/v1.44.tar.gz && \ + tar xfpz v1.44.tar.gz && rm v1.44.tar.gz && mv GeographicLib-1.44 GeographicLib + mkdir -p GeographicLib/BUILD && cd GeographicLib/BUILD || exit + ../configure && make -j2 && make install + geographiclib-get-geoids egm96-5 + geographiclib-get-gravity egm96 + geographiclib-get-magnetic emm2015 fi +export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib # Manually install MAVROS from source export MAVROS_RELEASE=ros2 @@ -20,42 +29,17 @@ export MAVLINK_RELEASE=release/rolling/mavlink mkdir -p "/opt/mavros/src" 2>/dev/null if [ $? -ne 0 ]; then echo "Insufficient privileges to create directory in /opt." - sudo mkdir -p "/opt/mavros/src" && cd "/opt/mavros/src" || exit - sudo git clone --depth 1 -b $MAVROS_RELEASE https://github.com/mavlink/mavros.git - sudo git clone --depth 1 --recursive -b $MAVLINK_RELEASE https://github.com/mavlink/mavlink-gbp-release.git mavlink - # - mavgen uses future.standard_library for backwards compatibility with Python2; - # However, this caused issues with Python 3.12 installed in "noble". - # Comment those lines out in mavlink. - # - # - Fix linkage for yaml-cpp in mavros_extra_plugins - sudo sed -i -e 's/^from future import standard_library/#from future import standard_library/' \ - -e 's/standard_library.install_aliases()/#standard_library.install_aliases()/' \ - mavlink/pymavlink/generator/mavgen.py && \ - sudo sed -i -e 's/^# find_package(yaml_cpp REQUIRED)/find_package(yaml-cpp REQUIRED)/' \ - -e '/^ament_target_dependencies(mavros_extras_plugins$/i target_link_libraries(mavros_extras_plugins yaml-cpp::yaml-cpp)' \ - -e '/^ament_target_dependencies(mavros_extras$/i target_link_libraries(mavros_extras yaml-cpp::yaml-cpp)' \ - mavros/mavros_extras/CMakeLists.txt + sudo mkdir -p "/opt/mavros/src" && cd "/opt/mavros" || exit + sudo vcs import --force --shallow --retry 0 \ + --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src + # Build + MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 sudo colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release else - cd "/opt/mavros/src" || exit - git clone --depth 1 -b $MAVROS_RELEASE https://github.com/mavlink/mavros.git - git clone --depth 1 --recursive -b $MAVLINK_RELEASE https://github.com/mavlink/mavlink-gbp-release.git mavlink - # - mavgen uses future.standard_library for backwards compatibility with Python2; - # However, this caused issues with Python 3.12 installed in "noble". - # Comment those lines out in mavlink. - # - # - Fix linkage for yaml-cpp in mavros_extra_plugins - sed -i -e 's/^from future import standard_library/#from future import standard_library/' \ - -e 's/standard_library.install_aliases()/#standard_library.install_aliases()/' \ - mavlink/pymavlink/generator/mavgen.py && \ - sed -i -e 's/^# find_package(yaml_cpp REQUIRED)/find_package(yaml-cpp REQUIRED)/' \ - -e '/^ament_target_dependencies(mavros_extras_plugins$/i target_link_libraries(mavros_extras_plugins yaml-cpp::yaml-cpp)' \ - -e '/^ament_target_dependencies(mavros_extras$/i target_link_libraries(mavros_extras yaml-cpp::yaml-cpp)' \ - mavros/mavros_extras/CMakeLists.txt + vcs import --force --shallow --retry 0 \ + --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src + # Build + MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release fi -# Build -cd "/opt/mavros" || exit -MAKEFLAGS="-j2" colcon build --cmake-args -DBUILD_TESTING=OFF - # Source mavros # shellcheck disable=SC1091 diff --git a/extras/repos/mavros.jazzy.repos b/extras/repos/mavros.jazzy.repos new file mode 100644 index 00000000..098e6287 --- /dev/null +++ b/extras/repos/mavros.jazzy.repos @@ -0,0 +1,30 @@ +repositories: + mavros: + type: git + url: https://github.com/mavlink/mavros.git + version: 2.8.0 + + mavlink: + type: git + url: https://github.com/ros2-gbp/mavlink-gbp-release.git + version: release/jazzy/mavlink/2024.6.6-1 + + geographic_info: + type: git + url: https://github.com/ros-geographic-info/geographic_info.git + version: 1.0.6 + + angles: + type: git + url: https://github.com/ros/angles.git + version: 1.16.0 + + eigen_stl_containers: + type: git + url: https://github.com/ros/eigen_stl_containers.git + version: 1.0.0 + + diagnostics: + type: git + url: https://github.com/ros/diagnostics.git + version: ros2 \ No newline at end of file From 8894b6f566d6a0376a3400fd885bdc50a321e2ac Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 17:07:49 +0900 Subject: [PATCH 21/45] no sudo --- extras/ardusub-ubuntu-install.sh | 52 ++++++++------------------------ extras/mavros-ubuntu-install.sh | 52 +++++++++++--------------------- 2 files changed, 29 insertions(+), 75 deletions(-) diff --git a/extras/ardusub-ubuntu-install.sh b/extras/ardusub-ubuntu-install.sh index ac73604d..b3fea29e 100644 --- a/extras/ardusub-ubuntu-install.sh +++ b/extras/ardusub-ubuntu-install.sh @@ -1,22 +1,16 @@ #!/bin/bash -mkdir -p "/opt/ardupilot_dave" 2>/dev/null -if [ $? -ne 0 ]; then - echo "Insufficient privileges to create directory in /opt." - sudo mkdir -p "/opt/ardupilot_dave" && cd "/opt/ardupilot_dave" || exit -else - mkdir -p "/opt/ardupilot_dave" && cd "/opt/ardupilot_dave" || exit -fi +# Source Ros and Gazebo +# shellcheck source=/dev/null +source /opt/ros/jazzy/setup.bash +# shellcheck source=/dev/null +source /opt/gazebo/install/setup.bash # Really should do version pinning but Sub-4.5 is waaaay behind master # (e.g. it doesn't know about "noble" yet) export ARDUPILOT_RELEASE=master -mkdir -p "/opt/ardupilot_dave/ardupilot" 2>/dev/null -if [ $? -ne 0 ]; then - sudo git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules -else - git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules -fi +mkdir -p "/opt/ardupilot_dave" && cd "/opt/ardupilot_dave" || exit +git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules # Install ArduSub dependencies cd "/opt/ardupilot_dave/ardupilot" || exit @@ -28,40 +22,18 @@ export DO_PYTHON_VENV_ENV=0 Tools/environment_install/install-prereqs-ubuntu.sh -y # Build ArduSub -cd "/opt/ardupilot_dave/ardupilot" || exit -# needs python binary (e.g. sudo apt install python-is-python3) -mkdir -p "/opt/ardupilot_dave/ardupilot/mktest" 2>/dev/null -if [ $? -ne 0 ]; then - sudo modules/waf/waf-light configure --board sitl \ - && sudo modules/waf/waf-light build --target bin/ardusub -else - modules/waf/waf-light configure --board sitl \ - && modules/waf/waf-light build --target bin/ardusub -fi +modules/waf/waf-light configure --board sitl \ + && modules/waf/waf-light build --target bin/ardusub # Clone ardupilot_gazebo code cd "/opt/ardupilot_dave" || exit -mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo" 2>/dev/null -if [ $? -ne 0 ]; then - cd "/opt/ardupilot_dave" || exit - sudo git clone https://github.com/ArduPilot/ardupilot_gazebo.git -else - cd "/opt/ardupilot_dave" || exit - git clone https://github.com/ArduPilot/ardupilot_gazebo.git -fi +git clone https://github.com/ArduPilot/ardupilot_gazebo.git # Install ardupilot_gazebo plugin # Check if the directory creation was successful -mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" 2>/dev/null -if [ $? -ne 0 ]; then - echo "Insufficient privileges to create directory in /opt. Using sudo for cmake and make." - sudo mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" \ +mkdir -p "/opt/ardupilot_dave/ardupilot_gazebo/build" \ && cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit - sudo cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && sudo make -j2 -else - cd "/opt/ardupilot_dave/ardupilot_gazebo/build" || exit - cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 -fi +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 # Add results of ArduSub build export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index bda9a6fc..5d3baf6b 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -1,45 +1,27 @@ #!/bin/bash -mkdir -p "/opt/mavros/GeographicLib" 2>/dev/null -if [ $? -ne 0 ]; then - echo "Insufficient privileges to create directory in /opt." - sudo mkdir -p "/opt/mavros/" && cd "/opt/mavros/" || exit - sudo wget https://github.com/ObjSal/GeographicLib/archive/refs/tags/v1.44.tar.gz && \ - sudo tar xfpz v1.44.tar.gz && sudo rm v1.44.tar.gz && sudo mv GeographicLib-1.44 GeographicLib - sudo mkdir -p GeographicLib/BUILD && cd GeographicLib/BUILD || exit - sudo ../configure && sudo make -j2 && sudo make install - sudo geographiclib-get-geoids egm96-5 - sudo geographiclib-get-gravity egm96 - sudo geographiclib-get-magnetic emm2015 -else - cd "/opt/mavros/" || exit - wget https://github.com/ObjSal/GeographicLib/archive/refs/tags/v1.44.tar.gz && \ - tar xfpz v1.44.tar.gz && rm v1.44.tar.gz && mv GeographicLib-1.44 GeographicLib - mkdir -p GeographicLib/BUILD && cd GeographicLib/BUILD || exit - ../configure && make -j2 && make install - geographiclib-get-geoids egm96-5 - geographiclib-get-gravity egm96 - geographiclib-get-magnetic emm2015 -fi +# Source Ros and Gazebo +# shellcheck source=/dev/null +source /opt/ros/jazzy/setup.bash + +mkdir -p "/opt/mavros/" && cd "/opt/mavros/" || exit +wget https://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.52.tar.gz && \ + tar xfpz GeographicLib-1.52.tar.gz && rm GeographicLib-1.52.tar.gz && mv GeographicLib-1.52 GeographicLib +mkdir -p GeographicLib/BUILD && cd GeographicLib/BUILD || exit +../configure && make -j2 && make install +geographiclib-get-geoids egm96-5 +geographiclib-get-gravity egm96 +geographiclib-get-magnetic emm2015 export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib # Manually install MAVROS from source export MAVROS_RELEASE=ros2 export MAVLINK_RELEASE=release/rolling/mavlink -mkdir -p "/opt/mavros/src" 2>/dev/null -if [ $? -ne 0 ]; then - echo "Insufficient privileges to create directory in /opt." - sudo mkdir -p "/opt/mavros/src" && cd "/opt/mavros" || exit - sudo vcs import --force --shallow --retry 0 \ - --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src - # Build - MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 sudo colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -else - vcs import --force --shallow --retry 0 \ - --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src - # Build - MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -fi +mkdir -p "/opt/mavros/src" && cd "/opt/mavros" || exit +vcs import --force --shallow --retry 0 \ + --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src +# Build +MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release # Source mavros # shellcheck disable=SC1091 From b1c54ec3b7874c4001931c90f334771566594f00 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 17:15:53 +0900 Subject: [PATCH 22/45] add libasio --- .docker/jazzy.arm64v8.dockerfile | 2 +- extras/mavros-ubuntu-install.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index ffa7c46d..d3cc521f 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -101,7 +101,7 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk apt-get install -y --no-install-recommends \ python-is-python3 python3-future python3-wxgtk4.0 python3-pexpect \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ - libgz-sim8-dev rapidjson-dev libopencv-dev \ + libgz-sim8-dev rapidjson-dev libopencv-dev libasio-dev \ gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ && rm -rf /var/lib/apt/lists/ # Install Ardupilot - Ardusub diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index 5d3baf6b..6dafee9b 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -20,6 +20,10 @@ export MAVLINK_RELEASE=release/rolling/mavlink mkdir -p "/opt/mavros/src" && cd "/opt/mavros" || exit vcs import --force --shallow --retry 0 \ --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src + +# Install MAVROS dependencies +apt update && apt install libasio-dev libtinyxml2-dev -y + # Build MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release From 4dc197f22ede3dcdda069658bcf7d68bd37af6be Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 17:33:47 +0900 Subject: [PATCH 23/45] supress dev msg --- extras/mavros-ubuntu-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index 6dafee9b..607482a3 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -25,7 +25,7 @@ vcs import --force --shallow --retry 0 \ apt update && apt install libasio-dev libtinyxml2-dev -y # Build -MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release +MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release # Source mavros # shellcheck disable=SC1091 From 79c6ec1240f545ee44fe86127481f1eb4b3e008e Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 18:10:29 +0900 Subject: [PATCH 24/45] link geographilclib --- extras/mavros-ubuntu-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index 607482a3..bc18e876 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -12,6 +12,9 @@ mkdir -p GeographicLib/BUILD && cd GeographicLib/BUILD || exit geographiclib-get-geoids egm96-5 geographiclib-get-gravity egm96 geographiclib-get-magnetic emm2015 +ln -s /usr/local/share/GeographicLib/geoids/egm96-5.pgm /usr/local/share/GeographicLib/egm96-5.pgm +ln -s /usr/local/share/GeographicLib/gravity/egm96.egm /usr/local/share/GeographicLib/egm96.egm +ln -s /usr/local/share/GeographicLib/magnetic/emm2015.wmm /usr/local/share/GeographicLib/emm2015.wmm export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib # Manually install MAVROS from source From da3e9dca6cffdbdb900b6eeeba63c5aeed052674 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 18:12:31 +0900 Subject: [PATCH 25/45] fix geographiclib path --- extras/mavros-ubuntu-install.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index bc18e876..9ddbb205 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -12,10 +12,7 @@ mkdir -p GeographicLib/BUILD && cd GeographicLib/BUILD || exit geographiclib-get-geoids egm96-5 geographiclib-get-gravity egm96 geographiclib-get-magnetic emm2015 -ln -s /usr/local/share/GeographicLib/geoids/egm96-5.pgm /usr/local/share/GeographicLib/egm96-5.pgm -ln -s /usr/local/share/GeographicLib/gravity/egm96.egm /usr/local/share/GeographicLib/egm96.egm -ln -s /usr/local/share/GeographicLib/magnetic/emm2015.wmm /usr/local/share/GeographicLib/emm2015.wmm -export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib +export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids # Manually install MAVROS from source export MAVROS_RELEASE=ros2 From f91e807850937bd5d0ffcaa94cf0a2de4dac99d2 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Tue, 10 Sep 2024 19:20:03 +0900 Subject: [PATCH 26/45] minor typo --- .docker/jazzy.arm64v8.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index d3cc521f..dcab8895 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -126,7 +126,7 @@ RUN rosdep init && \ # hadolint ignore=DL3027 RUN apt update && apt --fix-broken install && \ - rosdep update && rosdep install -iy --from-paths . && \ + rosdep update && rosdep install -iy --from-paths . && \ rm -rf /var/lib/apt/lists/ WORKDIR $ROS_UNDERLAY/.. From 564300ffe0bd30dd38d8b5b9d57976bb86461b91 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 11 Sep 2024 10:14:57 +0900 Subject: [PATCH 27/45] use current branch name --- .github/workflows/docker-amd64.yml | 2 +- .github/workflows/docker-arm64v8.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-amd64.yml b/.github/workflows/docker-amd64.yml index c3f1d3fc..dbedda4e 100644 --- a/.github/workflows/docker-amd64.yml +++ b/.github/workflows/docker-amd64.yml @@ -12,7 +12,7 @@ on: env: IMAGE_NAME: ${{ github.repository }} ROS_DISTRO: jazzy - BRANCH: ros2 + BRANCH: ${{ github.ref_name }} jobs: build-and-push-to-docker-hub: diff --git a/.github/workflows/docker-arm64v8.yml b/.github/workflows/docker-arm64v8.yml index 206a682b..0740523b 100644 --- a/.github/workflows/docker-arm64v8.yml +++ b/.github/workflows/docker-arm64v8.yml @@ -12,7 +12,7 @@ on: env: IMAGE_NAME: ${{ github.repository }} ROS_DISTRO: jazzy - BRANCH: ros2 + BRANCH: ${{ github.ref_name }} jobs: build-and-push-to-docker-hub: From 77b15797d350997d17e031823cad90dbb898f287 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 11 Sep 2024 10:27:13 +0900 Subject: [PATCH 28/45] add geoid path --- .docker/jazzy.amd64.dockerfile | 3 +++ .docker/jazzy.arm64v8.dockerfile | 1 + 2 files changed, 4 insertions(+) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 9e8417d0..82f7adce 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -92,6 +92,8 @@ sed --in-place --expression \ sed --in-place --expression \ '$i source "/opt/mavros/install/setup.bash"' /ros_entrypoint.sh && \ sed --in-place --expression \ +'$i export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids' /ros_entrypoint.sh && \ +sed --in-place --expression \ '$i export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH' /ros_entrypoint.sh && \ @@ -107,6 +109,7 @@ USER $USER RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ + echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index dcab8895..ac7cef67 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -154,6 +154,7 @@ USER docker RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ + echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ From dcf50bdfc3dff3287f8b5dc74d648e7cc4082f52 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 12 Sep 2024 17:47:05 +0900 Subject: [PATCH 29/45] -j flag fix --- extras/ros-jazzy-binary-gz-harmonic-source-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/ros-jazzy-binary-gz-harmonic-source-install.sh b/extras/ros-jazzy-binary-gz-harmonic-source-install.sh index 7fb496fb..32b3a717 100644 --- a/extras/ros-jazzy-binary-gz-harmonic-source-install.sh +++ b/extras/ros-jazzy-binary-gz-harmonic-source-install.sh @@ -100,7 +100,7 @@ sudo apt -y install $(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' echo -e "\033[34mBuilding the project with colcon...\033[0m" cd /opt/gazebo || exit # Build gz-physics with limited cores to avoid memory issues -MAKEFLAGS="-j2" colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-up-to gz-physics7 +MAKEFLAGS="-j 2" colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-up-to gz-physics7 # Full build colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install From a026bee8a1657b9e6b52eb37efd249144757b2b2 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 15:22:46 +0900 Subject: [PATCH 30/45] fix ardupilot install path attempt --- .docker/jazzy.arm64v8.dockerfile | 12 +++---- extras/ardusub-ubuntu-install-local.sh | 47 ++++++++++++++++++++++++++ extras/mavros-ubuntu-install.sh | 4 ++- 3 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 extras/ardusub-ubuntu-install-local.sh diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index ac7cef67..6faf95c8 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -106,7 +106,7 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk && rm -rf /var/lib/apt/lists/ # Install Ardupilot - Ardusub ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ -extras/ardusub-ubuntu-install.sh install.sh +extras/ardusub-ubuntu-install-local.sh install.sh RUN bash install.sh # Install mavros ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ @@ -156,11 +156,11 @@ RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \ - echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" >> ~/.bashrc && \ + echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ + echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_RESOURCE_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/models:/home/$USER/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \ + echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown $USER:$USER ~/HOST; fi" >> ~/.bashrc && \ echo "\n\n" >> ~/.bashrc # Other environment variables diff --git a/extras/ardusub-ubuntu-install-local.sh b/extras/ardusub-ubuntu-install-local.sh new file mode 100644 index 00000000..24c96ec3 --- /dev/null +++ b/extras/ardusub-ubuntu-install-local.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Source Ros and Gazebo +# shellcheck source=/dev/null +source /opt/ros/jazzy/setup.bash +# shellcheck source=/dev/null +source /opt/gazebo/install/setup.bash + +export USER=docker + +# Really should do version pinning but Sub-4.5 is waaaay behind master +# (e.g. it doesn't know about "noble" yet) +export ARDUPILOT_RELEASE=master +mkdir -p "/home/$USER/ardupilot_dave" && cd "/home/$USER/ardupilot_dave" || exit +git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules + +# Install ArduSub dependencies +cd "/home/$USER/ardupilot_dave/ardupilot" || exit +export SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1 +# Do not install the STM development tools +export DO_AP_STM_ENV=0 +# Do not activate the Ardupilot venv by default +export DO_PYTHON_VENV_ENV=0 +Tools/environment_install/install-prereqs-ubuntu.sh -y + +# Build ArduSub +modules/waf/waf-light configure --board sitl \ + && modules/waf/waf-light build --target bin/ardusub + +# Clone ardupilot_gazebo code +cd "/home/$USER/ardupilot_dave" || exit +git clone https://github.com/ArduPilot/ardupilot_gazebo.git + +# Install ardupilot_gazebo plugin +# Check if the directory creation was successful +mkdir -p "/home/$USER/ardupilot_dave/ardupilot_gazebo/build" \ + && cd "/home/$USER/ardupilot_dave/ardupilot_gazebo/build" || exit +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 + +# Add results of ArduSub build +export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH +# Optional: add autotest to the PATH, helpful for running sim_vehicle.py +export PATH=/home/$USER/ardupilot_dave/ardupilot/Tools/autotest:\$PATH +# Add ardupilot_gazebo plugin +export GZ_SIM_SYSTEM_PLUGIN_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH +# Add ardupilot_gazebo models and worlds +export GZ_SIM_RESOURCE_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/models:/home/$USER/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index 9ddbb205..3cfc476f 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -22,7 +22,9 @@ vcs import --force --shallow --retry 0 \ --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src # Install MAVROS dependencies -apt update && apt install libasio-dev libtinyxml2-dev -y +apt update && apt install -y libasio-dev libtinyxml2-dev python3-dev \ + python3-opencv python3-wxgtk4.0 python3-pip python3-matplotlib python3-lxml python3-pygame +pip3 install PyYAML mavproxy --break-system-packages # Build MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release From 4950c7aa1111cbc1f48e0c71985f9208778b97e5 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 17:22:18 +0900 Subject: [PATCH 31/45] amd update --- .docker/jazzy.amd64.dockerfile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 82f7adce..d41691f2 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -102,17 +102,4 @@ sed --in-place --expression \ sed --in-place --expression \ '$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh - -# Set User as user -USER $USER -RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ - echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ - echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ - echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ - echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc - +'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh \ No newline at end of file From f533ff0f8fd3034b3235fcf8ec4b03493a092fe0 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 17:32:29 +0900 Subject: [PATCH 32/45] amd update --- .docker/jazzy.amd64.dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index d41691f2..5ad17a3d 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -82,7 +82,9 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \ # source entrypoint setup RUN touch /ros_entrypoint.sh && sed --in-place --expression \ - '$i source "/opt/dave_ws/install/setup.bash"' /ros_entrypoint.sh + '$i source "/opt/dave_ws/install/setup.bash"' /ros_entrypoint.sh \ + && sed --in-place --expression \ + '$i cd /root' /ros_entrypoint.sh # Source ROS and Gazebo RUN sed --in-place --expression \ From 254f3f820a6d6a16670d231f0790d785cd2da9ac Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 17:33:02 +0900 Subject: [PATCH 33/45] arm update --- .docker/jazzy.arm64v8.dockerfile | 51 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 6faf95c8..b62f8475 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -104,35 +104,11 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk libgz-sim8-dev rapidjson-dev libopencv-dev libasio-dev \ gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ && rm -rf /var/lib/apt/lists/ -# Install Ardupilot - Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ -extras/ardusub-ubuntu-install-local.sh install.sh -RUN bash install.sh # Install mavros ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ extras/mavros-ubuntu-install.sh install.sh RUN bash install.sh -# Set up Dave workspace -ENV ROS_UNDERLAY=/home/$USER/dave_ws/install -WORKDIR $ROS_UNDERLAY/../src - -ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ -extras/repos/dave.$ROS_DISTRO.repos /home/$USER/dave_ws/dave.repos -RUN vcs import --shallow --input "/home/$USER/dave_ws/dave.repos" - -RUN rosdep init && \ - rosdep update --rosdistro $ROS_DISTRO - -# hadolint ignore=DL3027 -RUN apt update && apt --fix-broken install && \ - rosdep update && rosdep install -iy --from-paths . && \ - rm -rf /var/lib/apt/lists/ - -WORKDIR $ROS_UNDERLAY/.. -RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \ - colcon build - # Download the background image from GitHub raw content URL # hadolint ignore=DL3047 RUN wget -O /usr/share/backgrounds/custom-background.png -q \ @@ -145,15 +121,36 @@ extras/background.png && \ cp /usr/share/backgrounds/warty-final-ubuntu.png \ /usr/share/backgrounds/ubuntu-wallpaper-d.png -# source entrypoint setup -RUN touch /ros_entrypoint.sh && sed --in-place --expression \ - '$i source "$ROS_UNDERLAY/setup.bash"' /ros_entrypoint.sh +# Install Ardupilot - Ardusub +USER docker +RUN wget -O /tmp/install.sh https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/ardusub-ubuntu-install-local.sh +RUN chmod +x /tmp/install.sh && bash /tmp/install.sh + +# Set up Dave workspace +ENV DAVE_UNDERLAY=/home/$USER/dave_ws +WORKDIR $DAVE_UNDERLAY/src +RUN wget -O /home/$USER/dave_ws/dave.repos -q https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ +extras/repos/dave.$ROS_DISTRO.repos +RUN vcs import --shallow --input "/home/$USER/dave_ws/dave.repos" + +RUN sudo rosdep init && \ + sudo rosdep update --rosdistro $ROS_DISTRO + +# hadolint ignore=DL3027 +RUN sudo apt update && sudo apt --fix-broken install && \ + sudo rosdep install --rosdistro $ROS_DISTRO -iy --from-paths . && \ + sudo rm -rf /var/lib/apt/lists/ + +# Build dave workspace +WORKDIR $DAVE_UNDERLAY +RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && colcon build # Set User as user USER docker RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ + echo "source $DAVE_UNDERLAY/install/setup.bash" >> ~/.bashrc && \ echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ From 35f05f33d3b41aa5a9371c0f802ffd9dafb163c3 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 15:22:46 +0900 Subject: [PATCH 34/45] fix ardupilot install path attempt --- .docker/jazzy.arm64v8.dockerfile | 12 +++---- extras/ardusub-ubuntu-install-local.sh | 47 ++++++++++++++++++++++++++ extras/mavros-ubuntu-install.sh | 4 ++- 3 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 extras/ardusub-ubuntu-install-local.sh diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index ac7cef67..6faf95c8 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -106,7 +106,7 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk && rm -rf /var/lib/apt/lists/ # Install Ardupilot - Ardusub ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ -extras/ardusub-ubuntu-install.sh install.sh +extras/ardusub-ubuntu-install-local.sh install.sh RUN bash install.sh # Install mavros ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ @@ -156,11 +156,11 @@ RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \ - echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" >> ~/.bashrc && \ + echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ + echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ + echo "export GZ_SIM_RESOURCE_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/models:/home/$USER/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \ + echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown $USER:$USER ~/HOST; fi" >> ~/.bashrc && \ echo "\n\n" >> ~/.bashrc # Other environment variables diff --git a/extras/ardusub-ubuntu-install-local.sh b/extras/ardusub-ubuntu-install-local.sh new file mode 100644 index 00000000..24c96ec3 --- /dev/null +++ b/extras/ardusub-ubuntu-install-local.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Source Ros and Gazebo +# shellcheck source=/dev/null +source /opt/ros/jazzy/setup.bash +# shellcheck source=/dev/null +source /opt/gazebo/install/setup.bash + +export USER=docker + +# Really should do version pinning but Sub-4.5 is waaaay behind master +# (e.g. it doesn't know about "noble" yet) +export ARDUPILOT_RELEASE=master +mkdir -p "/home/$USER/ardupilot_dave" && cd "/home/$USER/ardupilot_dave" || exit +git clone -b $ARDUPILOT_RELEASE https://github.com/ArduPilot/ardupilot.git --recurse-submodules + +# Install ArduSub dependencies +cd "/home/$USER/ardupilot_dave/ardupilot" || exit +export SKIP_AP_EXT_ENV=1 SKIP_AP_GRAPHIC_ENV=1 SKIP_AP_COV_ENV=1 SKIP_AP_GIT_CHECK=1 +# Do not install the STM development tools +export DO_AP_STM_ENV=0 +# Do not activate the Ardupilot venv by default +export DO_PYTHON_VENV_ENV=0 +Tools/environment_install/install-prereqs-ubuntu.sh -y + +# Build ArduSub +modules/waf/waf-light configure --board sitl \ + && modules/waf/waf-light build --target bin/ardusub + +# Clone ardupilot_gazebo code +cd "/home/$USER/ardupilot_dave" || exit +git clone https://github.com/ArduPilot/ardupilot_gazebo.git + +# Install ardupilot_gazebo plugin +# Check if the directory creation was successful +mkdir -p "/home/$USER/ardupilot_dave/ardupilot_gazebo/build" \ + && cd "/home/$USER/ardupilot_dave/ardupilot_gazebo/build" || exit +cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make -j2 + +# Add results of ArduSub build +export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH +# Optional: add autotest to the PATH, helpful for running sim_vehicle.py +export PATH=/home/$USER/ardupilot_dave/ardupilot/Tools/autotest:\$PATH +# Add ardupilot_gazebo plugin +export GZ_SIM_SYSTEM_PLUGIN_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH +# Add ardupilot_gazebo models and worlds +export GZ_SIM_RESOURCE_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/models:/home/$USER/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH \ No newline at end of file diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index 9ddbb205..3cfc476f 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -22,7 +22,9 @@ vcs import --force --shallow --retry 0 \ --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src # Install MAVROS dependencies -apt update && apt install libasio-dev libtinyxml2-dev -y +apt update && apt install -y libasio-dev libtinyxml2-dev python3-dev \ + python3-opencv python3-wxgtk4.0 python3-pip python3-matplotlib python3-lxml python3-pygame +pip3 install PyYAML mavproxy --break-system-packages # Build MAKEFLAGS="-j2" ROS_PYTHON_VERSION=3 colcon build --cmake-args -DCMAKE_MODULE_PATH=/usr/local/share/cmake/GeographicLib:\$CMAKE_MODULE_PATH -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release From a2c76dfee8d94f67d5360d509f5dffa634bbcd1e Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 17:22:18 +0900 Subject: [PATCH 35/45] amd update --- .docker/jazzy.amd64.dockerfile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 82f7adce..d41691f2 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -102,17 +102,4 @@ sed --in-place --expression \ sed --in-place --expression \ '$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh - -# Set User as user -USER $USER -RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ - echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ - echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ - echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ - echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ - echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc - +'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh \ No newline at end of file From efa4120f7ad1f3d905d100157993a03e3ae7aa24 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 17:32:29 +0900 Subject: [PATCH 36/45] amd update --- .docker/jazzy.amd64.dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index d41691f2..5ad17a3d 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -82,7 +82,9 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \ # source entrypoint setup RUN touch /ros_entrypoint.sh && sed --in-place --expression \ - '$i source "/opt/dave_ws/install/setup.bash"' /ros_entrypoint.sh + '$i source "/opt/dave_ws/install/setup.bash"' /ros_entrypoint.sh \ + && sed --in-place --expression \ + '$i cd /root' /ros_entrypoint.sh # Source ROS and Gazebo RUN sed --in-place --expression \ From 1919ca7050dbec9a83ddb3f5a2e1dcb469b6d253 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 18 Sep 2024 17:33:02 +0900 Subject: [PATCH 37/45] arm update --- .docker/jazzy.arm64v8.dockerfile | 51 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 6faf95c8..b62f8475 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -104,35 +104,11 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk libgz-sim8-dev rapidjson-dev libopencv-dev libasio-dev \ gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ && rm -rf /var/lib/apt/lists/ -# Install Ardupilot - Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ -extras/ardusub-ubuntu-install-local.sh install.sh -RUN bash install.sh # Install mavros ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ extras/mavros-ubuntu-install.sh install.sh RUN bash install.sh -# Set up Dave workspace -ENV ROS_UNDERLAY=/home/$USER/dave_ws/install -WORKDIR $ROS_UNDERLAY/../src - -ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ -extras/repos/dave.$ROS_DISTRO.repos /home/$USER/dave_ws/dave.repos -RUN vcs import --shallow --input "/home/$USER/dave_ws/dave.repos" - -RUN rosdep init && \ - rosdep update --rosdistro $ROS_DISTRO - -# hadolint ignore=DL3027 -RUN apt update && apt --fix-broken install && \ - rosdep update && rosdep install -iy --from-paths . && \ - rm -rf /var/lib/apt/lists/ - -WORKDIR $ROS_UNDERLAY/.. -RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \ - colcon build - # Download the background image from GitHub raw content URL # hadolint ignore=DL3047 RUN wget -O /usr/share/backgrounds/custom-background.png -q \ @@ -145,15 +121,36 @@ extras/background.png && \ cp /usr/share/backgrounds/warty-final-ubuntu.png \ /usr/share/backgrounds/ubuntu-wallpaper-d.png -# source entrypoint setup -RUN touch /ros_entrypoint.sh && sed --in-place --expression \ - '$i source "$ROS_UNDERLAY/setup.bash"' /ros_entrypoint.sh +# Install Ardupilot - Ardusub +USER docker +RUN wget -O /tmp/install.sh https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/ardusub-ubuntu-install-local.sh +RUN chmod +x /tmp/install.sh && bash /tmp/install.sh + +# Set up Dave workspace +ENV DAVE_UNDERLAY=/home/$USER/dave_ws +WORKDIR $DAVE_UNDERLAY/src +RUN wget -O /home/$USER/dave_ws/dave.repos -q https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ +extras/repos/dave.$ROS_DISTRO.repos +RUN vcs import --shallow --input "/home/$USER/dave_ws/dave.repos" + +RUN sudo rosdep init && \ + sudo rosdep update --rosdistro $ROS_DISTRO + +# hadolint ignore=DL3027 +RUN sudo apt update && sudo apt --fix-broken install && \ + sudo rosdep install --rosdistro $ROS_DISTRO -iy --from-paths . && \ + sudo rm -rf /var/lib/apt/lists/ + +# Build dave workspace +WORKDIR $DAVE_UNDERLAY +RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && colcon build # Set User as user USER docker RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \ echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \ + echo "source $DAVE_UNDERLAY/install/setup.bash" >> ~/.bashrc && \ echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ From 485ccc059a484c61cd964e2ebbaa8d2899f0a77e Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 12 Sep 2024 17:47:05 +0900 Subject: [PATCH 38/45] -j flag fix --- extras/ros-jazzy-binary-gz-harmonic-source-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/ros-jazzy-binary-gz-harmonic-source-install.sh b/extras/ros-jazzy-binary-gz-harmonic-source-install.sh index 7fb496fb..32b3a717 100644 --- a/extras/ros-jazzy-binary-gz-harmonic-source-install.sh +++ b/extras/ros-jazzy-binary-gz-harmonic-source-install.sh @@ -100,7 +100,7 @@ sudo apt -y install $(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' echo -e "\033[34mBuilding the project with colcon...\033[0m" cd /opt/gazebo || exit # Build gz-physics with limited cores to avoid memory issues -MAKEFLAGS="-j2" colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-up-to gz-physics7 +MAKEFLAGS="-j 2" colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install --packages-up-to gz-physics7 # Full build colcon build --cmake-args -DBUILD_TESTING=OFF --merge-install From e7c0879fcde65b159d75e43541672e6dd4824ca6 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 19 Sep 2024 07:32:07 +0900 Subject: [PATCH 39/45] fix rosdep --- .docker/jazzy.arm64v8.dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index b62f8475..b3321221 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -133,12 +133,10 @@ RUN wget -O /home/$USER/dave_ws/dave.repos -q https://raw.githubusercontent.com/ extras/repos/dave.$ROS_DISTRO.repos RUN vcs import --shallow --input "/home/$USER/dave_ws/dave.repos" -RUN sudo rosdep init && \ - sudo rosdep update --rosdistro $ROS_DISTRO - # hadolint ignore=DL3027 RUN sudo apt update && sudo apt --fix-broken install && \ - sudo rosdep install --rosdistro $ROS_DISTRO -iy --from-paths . && \ + sudo rosdep init && rosdep update --rosdistro $ROS_DISTRO && \ + rosdep install --rosdistro $ROS_DISTRO -iy --from-paths . && \ sudo rm -rf /var/lib/apt/lists/ # Build dave workspace From 7829b0136622e76563ee7e71363365bfb12690a4 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 19 Sep 2024 08:42:11 +0900 Subject: [PATCH 40/45] add ascii art for arm rdp --- .docker/jazzy.arm64v8.dockerfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index b3321221..5743d211 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -164,13 +164,24 @@ RUN echo "export XDG_RUNTIME_DIR=~/.xdg_log" >> ~/.bashrc && \ # Create and write the welcome message to a new file RUN mkdir -p /home/docker/.config/autostart && \ + printf '\033[1;37m =====\n' >> ~/.hi && \ + printf ' ____ ___ _______ _ _ _ \n' >> ~/.hi && \ + printf ' | _ \ / \ \ / | ____| / \ __ _ _ _ __ _| |_(_) ___ \n' >> ~/.hi && \ + printf ' | | | |/ _ \ \ / /| _| / _ \ / _` | | | |/ _` | __| |/ __|\n' >> ~/.hi && \ + printf ' | |_| / ___ \ V / | |___ / ___ | (_| | |_| | (_| | |_| | (__ \n' >> ~/.hi && \ + printf ' |____/_/ \_\_/ |_____| /_/ \_\__, |\__,_|\__,_|\__|_|\___|\n' >> ~/.hi && \ + printf ' __ ___ _ _ _____ _ \n' >> ~/.hi && \ + printf ' \ \ / (_)_ __| |_ _ _ __ _| | | ____|_ ____ _(_)_ __ \n' >> ~/.hi && \ + printf ' \ \ / /| | `__| __| | | |/ _` | | | _| | `_ \ \ / | | `__| \n' >> ~/.hi && \ + printf ' \ V / | | | | |_| |_| | (_| | | | |___| | | \ V /| | |_ \n' >> ~/.hi && \ + printf ' \_/ |_|_| \__|\__,_|\__,_|_| |_____|_| |_|\_/ |_|_(_) \n\033[0m' >> ~/.hi && \ printf '\033[1;32m\n =====\n\033[0m' >> ~/.hi && \ - printf "\\033[1;32m 👋 Hi! This is Docker virtual environment\n\\033[0m" \ + printf "\\033[1;32m 👋 Hi! This is Docker virtual environment for DAVE\n\\033[0m" \ >> ~/.hi && \ - printf "\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic (w ardusub)\n\n\n\\033[0m" \ + printf "\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic (w ardupilot(ardusub) + mavros)\n\n\n\\033[0m" \ >> ~/.hi -# Remove sudo message + # Remove sudo message RUN touch /home/docker/.sudo_as_admin_successful # Autostart terminal From 18a2c941a5c0ee8883565138516463060cb6a47e Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 19 Sep 2024 08:46:02 +0900 Subject: [PATCH 41/45] testing ascii art for amd --- .docker/jazzy.amd64.dockerfile | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 5ad17a3d..6701c7fb 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -104,4 +104,32 @@ sed --in-place --expression \ sed --in-place --expression \ '$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh \ No newline at end of file +'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\''\033[1;37m =====\n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' ____ ___ _______ _ _ _ \n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' | _ \\ / \\ \\ / | ____| / \\ __ _ _ _ __ _| |_(_) ___ \n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' | | | |/ _ \\ \\ / /| _| / _ \\ / _` | | | |/ _` | __| |/ __|\n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' | |_| / ___ \\ V / | |___ / ___ \\ (_| | |_| | (_| | |_| | (__ \n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' |____/_/ \\_\\_/ |_____| /_/ \\_\\__, |\\__,_|\\__,_|\\__|_|\\___|\n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' __ ___ _ _ _____ _ \n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' \\ \\ / (_)_ __| |_ _ _ __ _| | | ____|_ ____ _(_)_ __ \n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' \\ \\ / /| | `__| __| | | |/ _` | | | _| | `_ \\ \\ / | | `__| \n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' \\ V / | | | | |_| |_| | (_| | | | |___| | | \\ V /| | |_ \n'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\'' \\_/ |_|_| \\__|\\__,_|\\__,_|_| |_____|_| |_|\\_/ |_|_(_) \n\033[0m'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\''\033[1;32m\n =====\n\033[0m'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\''\\033[1;32m 👋 Hi! This is Docker virtual environment for DAVE\n\\033[0m'\'' ' /ros_entrypoint.sh && \ +sed --in-place --expression \ +'$i printf '\''\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic (w ardupilot(ardusub) + mavros)\n\n\n\\033[0m'\'' ' /ros_entrypoint.sh \ No newline at end of file From 3f69b2bab7ed11e3c38463d1a27cd5a3577b5a4b Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 19 Sep 2024 08:54:30 +0900 Subject: [PATCH 42/45] amd image ascii art and coloring --- .docker/jazzy.amd64.dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index 6701c7fb..d2cf4b2f 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -86,6 +86,8 @@ RUN touch /ros_entrypoint.sh && sed --in-place --expression \ && sed --in-place --expression \ '$i cd /root' /ros_entrypoint.sh +RUN cp /home/docker/.bashrc ~/.bashrc + # Source ROS and Gazebo RUN sed --in-place --expression \ '$i source "/opt/ros/jazzy/setup.bash"' /ros_entrypoint.sh && \ @@ -106,7 +108,7 @@ sed --in-place --expression \ sed --in-place --expression \ '$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i printf '\''\033[1;37m =====\n'\'' ' /ros_entrypoint.sh && \ +'$i printf '\''\\033[1;37m \n=====\n'\'' ' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i printf '\'' ____ ___ _______ _ _ _ \n'\'' ' /ros_entrypoint.sh && \ sed --in-place --expression \ @@ -126,10 +128,10 @@ sed --in-place --expression \ sed --in-place --expression \ '$i printf '\'' \\ V / | | | | |_| |_| | (_| | | | |___| | | \\ V /| | |_ \n'\'' ' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i printf '\'' \\_/ |_|_| \\__|\\__,_|\\__,_|_| |_____|_| |_|\\_/ |_|_(_) \n\033[0m'\'' ' /ros_entrypoint.sh && \ +'$i printf '\'' \\_/ |_|_| \\__|\\__,_|\\__,_|_| |_____|_| |_|\\_/ |_|_(_) \n\\033[0m'\'' ' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i printf '\''\033[1;32m\n =====\n\033[0m'\'' ' /ros_entrypoint.sh && \ +'$i printf '\''\\033[1;32m\n =====\\033[0m\n'\'' ' /ros_entrypoint.sh && \ sed --in-place --expression \ '$i printf '\''\\033[1;32m 👋 Hi! This is Docker virtual environment for DAVE\n\\033[0m'\'' ' /ros_entrypoint.sh && \ sed --in-place --expression \ -'$i printf '\''\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic (w ardupilot(ardusub) + mavros)\n\n\n\\033[0m'\'' ' /ros_entrypoint.sh \ No newline at end of file +'$i printf '\''\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic (w ardupilot(ardusub) + mavros)\n\n\\033[0m'\'' ' /ros_entrypoint.sh \ No newline at end of file From 8c2f58dfd7f551d294f7c4462f964a2341f9a84c Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 19 Sep 2024 16:22:47 +0900 Subject: [PATCH 43/45] typo fix --- .docker/jazzy.arm64v8.dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index 5743d211..dbbc46ee 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -151,10 +151,10 @@ RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \ echo "source $DAVE_UNDERLAY/install/setup.bash" >> ~/.bashrc && \ echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \ echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \ - echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \ + echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \ echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \ - echo "export GZ_SIM_RESOURCE_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/models:/home/$USER/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \ + echo "export GZ_SIM_RESOURCE_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/models:/home/$USER/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \ echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown $USER:$USER ~/HOST; fi" >> ~/.bashrc && \ echo "\n\n" >> ~/.bashrc From b77235dac5655e5b1f8045f3c10456ec17820d98 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Thu, 19 Sep 2024 19:29:44 +0900 Subject: [PATCH 44/45] yaml fix for mavros-extras --- extras/repos/mavros.jazzy.repos | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/repos/mavros.jazzy.repos b/extras/repos/mavros.jazzy.repos index 098e6287..caa040a9 100644 --- a/extras/repos/mavros.jazzy.repos +++ b/extras/repos/mavros.jazzy.repos @@ -2,7 +2,7 @@ repositories: mavros: type: git url: https://github.com/mavlink/mavros.git - version: 2.8.0 + ref: 5884e2f5010cc811398d92eddede9b0c7454e68a mavlink: type: git From 98cc9a983b9b2b0a214342ef92e758db6c702b26 Mon Sep 17 00:00:00 2001 From: Woen-Sug Choi Date: Wed, 23 Oct 2024 17:20:34 +0900 Subject: [PATCH 45/45] finalize --- .docker/jazzy.amd64.dockerfile | 4 ++-- .docker/jazzy.arm64v8.dockerfile | 4 ++-- extras/mavros-ubuntu-install.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.docker/jazzy.amd64.dockerfile b/.docker/jazzy.amd64.dockerfile index d2cf4b2f..f0b7722c 100644 --- a/.docker/jazzy.amd64.dockerfile +++ b/.docker/jazzy.amd64.dockerfile @@ -54,11 +54,11 @@ extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh RUN bash install.sh # Install Ardupilot - Ardusub -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ extras/ardusub-ubuntu-install.sh install.sh RUN bash install.sh # Install mavros -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ extras/mavros-ubuntu-install.sh install.sh RUN bash install.sh diff --git a/.docker/jazzy.arm64v8.dockerfile b/.docker/jazzy.arm64v8.dockerfile index dbbc46ee..77ad5abe 100644 --- a/.docker/jazzy.arm64v8.dockerfile +++ b/.docker/jazzy.arm64v8.dockerfile @@ -105,7 +105,7 @@ RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pk gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \ && rm -rf /var/lib/apt/lists/ # Install mavros -ADD https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/\ +ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\ extras/mavros-ubuntu-install.sh install.sh RUN bash install.sh @@ -123,7 +123,7 @@ extras/background.png && \ # Install Ardupilot - Ardusub USER docker -RUN wget -O /tmp/install.sh https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/ardusub-ubuntu-install-local.sh +RUN wget -O /tmp/install.sh https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/extras/ardusub-ubuntu-install-local.sh RUN chmod +x /tmp/install.sh && bash /tmp/install.sh # Set up Dave workspace diff --git a/extras/mavros-ubuntu-install.sh b/extras/mavros-ubuntu-install.sh index 3cfc476f..4a21fd26 100644 --- a/extras/mavros-ubuntu-install.sh +++ b/extras/mavros-ubuntu-install.sh @@ -19,7 +19,7 @@ export MAVROS_RELEASE=ros2 export MAVLINK_RELEASE=release/rolling/mavlink mkdir -p "/opt/mavros/src" && cd "/opt/mavros" || exit vcs import --force --shallow --retry 0 \ - --input https://raw.githubusercontent.com/IOES-Lab/dave/ardusub_install/extras/repos/mavros.jazzy.repos src + --input https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/extras/repos/mavros.jazzy.repos src # Install MAVROS dependencies apt update && apt install -y libasio-dev libtinyxml2-dev python3-dev \