Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stereolabs/zed-ros2-wrapper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: foxy-v3.5
Choose a base ref
...
head repository: stereolabs/zed-ros2-wrapper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 43,996 additions and 6,440 deletions.
  1. 0 .ci/.gitkeep
  2. +44 −0 .ci/build_humble_bin.sh
  3. +23 −0 .ci/download_and_install_sdk.sh
  4. +76 −0 .ci/jetson_build_humble_src.sh
  5. +28 −0 .ci/jetson_download_and_install_sdk.sh
  6. +70 −0 .ci/run_build_in_humble.sh
  7. +36 −0 .ci/run_tests.sh
  8. +43 −0 .github/ISSUE_TEMPLATE/1_feature_request.yml
  9. +87 −0 .github/ISSUE_TEMPLATE/2_bug_report.yml
  10. +0 −35 .github/ISSUE_TEMPLATE/bug_report.md
  11. +12 −0 .github/ISSUE_TEMPLATE/config.yml
  12. +0 −20 .github/ISSUE_TEMPLATE/feature_request.md
  13. +0 −10 .github/ISSUE_TEMPLATE/question.md
  14. +23 −0 .github/workflows/stale_issues.yml
  15. +4 −3 .gitignore
  16. +350 −0 .gitlab-ci.yml
  17. +365 −0 CHANGELOG.rst
  18. +50 −0 CONTRIBUTING.md
  19. +251 −21 LICENSE
  20. +234 −84 README.md
  21. +140 −0 docker/Dockerfile.desktop-humble
  22. +115 −0 docker/Dockerfile.l4t-humble
  23. +144 −0 docker/README.md
  24. +74 −0 docker/desktop_build_dockerfile_from_sdk_ubuntu_and_cuda_version.sh
  25. +54 −0 docker/jetson_build_dockerfile_from_sdk_and_l4T_version.sh
  26. +26 −0 docker/ros_entrypoint.sh
  27. +26 −0 docker/ros_entrypoint_jetson.sh
  28. BIN images/Picto+STEREOLABS_Black.jpg
  29. BIN images/sim_rviz.jpg
  30. BIN images/zed_shelves.jpg
  31. +0 −34 last_changes.md
  32. +0 −39 zed_components/.gitignore
  33. +163 −52 zed_components/CMakeLists.txt
  34. +30 −19 zed_components/package.xml
  35. +0 −68 zed_components/src/include/visibility_control.h
  36. +61 −0 zed_components/src/include/visibility_control.hpp
  37. +39 −0 zed_components/src/tools/include/gnss_replay.hpp
  38. +24,653 −0 zed_components/src/tools/include/json.hpp
  39. +162 −0 zed_components/src/tools/include/sl_logging.hpp
  40. +0 −181 zed_components/src/tools/include/sl_tools.h
  41. +172 −0 zed_components/src/tools/include/sl_tools.hpp
  42. +51 −0 zed_components/src/tools/include/sl_win_avg.hpp
  43. +323 −0 zed_components/src/tools/src/gnss_replay.cpp
  44. +535 −322 zed_components/src/tools/src/sl_tools.cpp
  45. +71 −0 zed_components/src/tools/src/sl_win_avg.cpp
  46. +71 −0 zed_components/src/zed_camera/include/cost_traversability.hpp
  47. +243 −0 zed_components/src/zed_camera/include/sl_types.hpp
  48. +903 −577 zed_components/src/zed_camera/include/zed_camera_component.hpp
  49. +442 −0 zed_components/src/zed_camera/include/zed_camera_one_component.hpp
  50. +193 −0 zed_components/src/zed_camera/src/cost_traversability.cpp
  51. +9,260 −3,550 zed_components/src/zed_camera/src/zed_camera_component.cpp
  52. +3,045 −0 zed_components/src/zed_camera/src/zed_camera_one_component.cpp
  53. +0 −50 zed_interfaces/CMakeLists.txt
  54. +0 −6 zed_interfaces/msg/BoundingBox2Df.msg
  55. +0 −6 zed_interfaces/msg/BoundingBox2Di.msg
  56. +0 −8 zed_interfaces/msg/BoundingBox3D.msg
  57. +0 −1 zed_interfaces/msg/Keypoint2Df.msg
  58. +0 −1 zed_interfaces/msg/Keypoint2Di.msg
  59. +0 −1 zed_interfaces/msg/Keypoint3D.msg
  60. +0 −58 zed_interfaces/msg/Object.msg
  61. +0 −5 zed_interfaces/msg/ObjectsStamped.msg
  62. +0 −21 zed_interfaces/msg/Skeleton2D.msg
  63. +0 −21 zed_interfaces/msg/Skeleton3D.msg
  64. +0 −31 zed_interfaces/package.xml
  65. +0 −9 zed_interfaces/srv/SetPose.srv
  66. +0 −21 zed_interfaces/srv/StartSvoRec.srv
  67. +57 −4 zed_ros2/CMakeLists.txt
  68. +24 −22 zed_ros2/package.xml
  69. +0 −41 zed_wrapper/.gitignore
  70. +49 −74 zed_wrapper/CMakeLists.txt
  71. +0 −90 zed_wrapper/config/common.yaml
  72. +62 −0 zed_wrapper/config/common_mono.yaml
  73. +189 −0 zed_wrapper/config/common_stereo.yaml
  74. +20 −0 zed_wrapper/config/ffmpeg.yaml
  75. +27 −0 zed_wrapper/config/virtual.yaml
  76. +6 −6 zed_wrapper/config/zed.yaml
  77. +7 −34 zed_wrapper/config/zed2.yaml
  78. +6 −33 zed_wrapper/config/zed2i.yaml
  79. +6 −17 zed_wrapper/config/zedm.yaml
  80. +28 −0 zed_wrapper/config/zedx.yaml
  81. +28 −0 zed_wrapper/config/zedxm.yaml
  82. +14 −0 zed_wrapper/config/zedxone4k.yaml
  83. +10 −0 zed_wrapper/config/zedxonegs.yaml
  84. +0 −188 zed_wrapper/launch/include/zed_camera.launch.py
  85. +0 −107 zed_wrapper/launch/zed.launch.py
  86. +0 −107 zed_wrapper/launch/zed2.launch.py
  87. +0 −107 zed_wrapper/launch/zed2i.launch.py
  88. +412 −0 zed_wrapper/launch/zed_camera.launch.py
  89. +0 −107 zed_wrapper/launch/zedm.launch.py
  90. +40 −37 zed_wrapper/package.xml
  91. +0 −56 zed_wrapper/src/zed_wrapper.cpp
  92. +32 −19 zed_wrapper/urdf/include/materials.urdf.xacro
  93. BIN zed_wrapper/urdf/models/zed.stl
  94. BIN zed_wrapper/urdf/models/zed2.stl
  95. BIN zed_wrapper/urdf/models/zed2i.stl
  96. BIN zed_wrapper/urdf/models/zedm.stl
  97. +26 −137 zed_wrapper/urdf/zed_descr.urdf.xacro
  98. +261 −0 zed_wrapper/urdf/zed_macro.urdf.xacro
Empty file added .ci/.gitkeep
Empty file.
44 changes: 44 additions & 0 deletions .ci/build_humble_bin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash -ex

pwd_path="$(pwd)"
if [[ ${pwd_path:${#pwd_path}-3} == ".ci" ]] ; then cd .. && pwd_path="$(pwd)"; fi
ttk="===>"
WORKDIR=${pwd_path}
PROJ_NAME=${PWD##*/}

echo "${ttk} Root repository folder: ${WORKDIR}"
echo "${ttk} Repository name: ${PROJ_NAME}"

# Create the ROS 2 workspace
echo "${ttk} Create ROS2 workspace"
cd ..
WS_DIR="$(pwd)"/ros2_ws
rm -rf ${WS_DIR} # clean residual cache files
mkdir -p ${WS_DIR}/src
echo "${ttk} ROS2 Workspace: ${WS_DIR}"
cd ${WORKDIR}
cd ..
echo "cp -a ./${PROJ_NAME} ${WS_DIR}/src/"
cp -a ./${PROJ_NAME} ${WS_DIR}/src/

echo "${ttk} Check environment variables"
env | grep ROS

echo "${ttk} Update bin repositories"
apt-get update || true
apt-get upgrade --yes
rosdep update

echo "${ttk} Install ZED ROS2 Package dependencies"
cd ${WS_DIR}
rosdep install --from-paths src --ignore-src -r -y

echo "${ttk} Build the ZED ROS2 Package"
colcon build --cmake-args=-DCMAKE_BUILD_TYPE=Release --parallel-workers $(nproc)

echo "${ttk} Prepare 'install' artifact"
cd ${WS_DIR}
mkdir -p ${WORKDIR}/ros2_ws
cp -a ./install ${WORKDIR}/ros2_ws/

cd ${WORKDIR}
23 changes: 23 additions & 0 deletions .ci/download_and_install_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

UBUNTU_RELEASE_YEAR=$1
CUDA_MAJOR=$2
CUDA_MINOR=$3
ZED_SDK_MAJOR=$4
ZED_SDK_MINOR=$5

ttk="***>"

echo "Europe/Paris" > /etc/localtime ; echo "CUDA Version ${CUDA_MAJOR}.${CUDA_MINOR}.0" > /usr/local/cuda/version.txt

# Setup the ZED SDK
echo "${ttk} Installing ZED SDK v${ZED_SDK_MAJOR}.${ZED_SDK_MINOR} for Ubuntu ${UBUNTU_RELEASE_YEAR}.04 CUDA ${CUDA_MAJOR}.${CUDA_MINOR}"
apt-get update -y || true
apt-get install --no-install-recommends lsb-release wget less udev sudo build-essential cmake zstd python3 python3-pip libpng-dev libgomp1 -y && \
python3 -m pip install --upgrade pip; python3 -m pip install numpy opencv-python-headless && \
wget -q -O ZED_SDK_Linux_Ubuntu${UBUNTU_RELEASE_YEAR}.run https://download.stereolabs.com/zedsdk/${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}/cu${CUDA_MAJOR}${CUDA_MINOR%.*}/ubuntu${UBUNTU_RELEASE_YEAR} && \
chmod +x ZED_SDK_Linux_Ubuntu${UBUNTU_RELEASE_YEAR}.run ; ./ZED_SDK_Linux_Ubuntu${UBUNTU_RELEASE_YEAR}.run -- silent skip_tools skip_cuda skip_python skip_hub && \
ln -sf /lib/x86_64-linux-gnu/libusb-1.0.so.0 /usr/lib/x86_64-linux-gnu/libusb-1.0.so && \
rm ZED_SDK_Linux_Ubuntu${UBUNTU_RELEASE_YEAR}.run && \
rm -rf /var/lib/apt/lists/*
76 changes: 76 additions & 0 deletions .ci/jetson_build_humble_src.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash -ex

pwd_path="$(pwd)"
if [[ ${pwd_path:${#pwd_path}-3} == ".ci" ]] ; then cd .. && pwd_path="$(pwd)"; fi
ttk="===>"
WORKDIR=${pwd_path}
PROJ_NAME=${PWD##*/}

echo "${ttk} Root repository folder: ${WORKDIR}"
echo "${ttk} Repository name: ${PROJ_NAME}"
echo "${ttk} User: ${USER}"

# Set timezone
TZ=Europe/Paris
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone

# Create the ROS 2 workspace
echo "${ttk} Create ROS2 workspace"
cd ..
WS_DIR="$(pwd)"/ros2_ws
rm -rf ${WS_DIR} # clean residual cached files
mkdir -p ${WS_DIR}/src
echo "${ttk} ROS2 Workspace: ${WS_DIR}"

echo "${ttk} Check environment variables"
env | grep ROS

echo "${ttk} Install missing ZED ROS2 Package dependencies from the sources"
cd ${WS_DIR}/src
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 42D5A192B819C5DA
# xacro
XACRO_VERSION=2.0.8
wget https://github.com/ros/xacro/archive/refs/tags/${XACRO_VERSION}.tar.gz -O - | tar -xvz && mv xacro-${XACRO_VERSION} xacro
# Diagnostic
DIAGNOSTICS_VERSION=3.0.0
wget https://github.com/ros/diagnostics/archive/refs/tags/${DIAGNOSTICS_VERSION}.tar.gz -O - | tar -xvz && mv diagnostics-${DIAGNOSTICS_VERSION} diagnostics
# lint
AMENT_LINT_VERSION=0.12.7
wget https://github.com/ament/ament_lint/archive/refs/tags/${AMENT_LINT_VERSION}.tar.gz -O - | tar -xvz && mv ament_lint-${AMENT_LINT_VERSION} ament-lint
# Geographic Info
GEOGRAPHIC_INFO_VERSION=1.0.4
wget https://github.com/ros-geographic-info/geographic_info/archive/refs/tags/${GEOGRAPHIC_INFO_VERSION}.tar.gz -O - | tar -xvz && mv geographic_info-${GEOGRAPHIC_INFO_VERSION} geographic-info
cp -r geographic-info/geographic_msgs/ .
rm -rf geographic-info
# Robot Localization
ROBOT_LOCALIZATION_VERSION=3.4.2
wget https://github.com/cra-ros-pkg/robot_localization/archive/refs/tags/${ROBOT_LOCALIZATION_VERSION}.tar.gz -O - | tar -xvz && mv robot_localization-${ROBOT_LOCALIZATION_VERSION} robot-localization
# NMEA msgs
git clone https://github.com/ros-drivers/nmea_msgs.git --branch ros2
# Angles
git clone https://github.com/ros/angles.git --branch humble-devel

echo "${ttk} Copy the ZED ROS2 Package sources in the workspace"
cd ${WORKDIR}
cd ..
echo "cp -a ./${PROJ_NAME} ${WS_DIR}/src/"
cp -a ./${PROJ_NAME} ${WS_DIR}/src/

echo "${ttk} Check that all the dependencies are satisfied"
cd ${WS_DIR}
apt-get update -y || true && rosdep update
rosdep install --from-paths src --ignore-src -r -y

# force install cython to make sure all pacakges are clean
python3 -m pip install --force-reinstall cython

echo "${ttk} Build the ZED ROS2 Package and the dependencies"
cd ${WS_DIR}
colcon build --cmake-args ' -DCMAKE_BUILD_TYPE=Release' ' -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs' ' -DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined"' ' --no-warn-unused-cli' --parallel-workers $(nproc)

echo "${ttk} Prepare 'install' artifact"
cd ${WS_DIR}
mkdir -p ${WORKDIR}/ros2_ws
cp -a ./install ${WORKDIR}/ros2_ws/

cd ${WORKDIR}
28 changes: 28 additions & 0 deletions .ci/jetson_download_and_install_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
set -e

JETPACK_MAJOR=$1
JETPACK_MINOR=$2
L4T_MAJOR=$3
L4T_MINOR=$4
ZED_SDK_MAJOR=$5
ZED_SDK_MINOR=$6

ttk="***>"

echo "Europe/Paris" > /etc/timezone
echo "# R${L4T_MAJOR} (release), REVISION: ${L4T_MINOR}" > /etc/nv_tegra_release

#Install ZED SDK
echo "${ttk} Installing ZED SDK v${ZED_SDK_MAJOR}.${ZED_SDK_MINOR} for Jetpack ${JETPACK_MAJOR}.${JETPACK_MINOR} (L4T v${L4T_MAJOR}.${L4T_MINOR})"
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 42D5A192B819C5DA
apt-get update -y || true
apt-get install -y --no-install-recommends zstd wget less cmake curl gnupg2 \
build-essential python3 python3-pip python3-dev python3-setuptools libusb-1.0-0-dev -y && \
pip install protobuf && \
wget -q --no-check-certificate -O ZED_SDK_Linux_JP.run \
https://download.stereolabs.com/zedsdk/${ZED_SDK_MAJOR}.${ZED_SDK_MINOR}/l4t${L4T_MAJOR}.${L4T_MINOR}/jetsons && \
chmod +x ZED_SDK_Linux_JP.run ; ./ZED_SDK_Linux_JP.run silent skip_tools && \
rm -rf /usr/local/zed/resources/* && \
rm -rf ZED_SDK_Linux_JP.run && \
rm -rf /var/lib/apt/lists/*
70 changes: 70 additions & 0 deletions .ci/run_build_in_humble.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash -e

ZED_SDK_MAJOR=4
ZED_SDK_MINOR=1

# Retrieve CUDA version from environment variable CUDA_VERSION
CUDA_MAJOR=`echo ${CUDA_VERSION} | cut -d. -f1`
CUDA_MINOR=`echo ${CUDA_VERSION} | cut -d. -f2`

pwd_path="$(pwd)"
if [[ ${pwd_path:${#pwd_path}-3} == ".ci" ]] ; then cd .. && pwd_path="$(pwd)"; fi
ttk="---> "
ROOT_PATH=${pwd_path}
REPO_NAME=${PWD##*/}

echo "${ttk} Root repository folder: ${ROOT_PATH}"
echo "${ttk} Repository name: ${REPO_NAME}"
#echo "${ttk} User: ${USER}"

sudocmd=""
if [[ ! $(uname) == "MINGW"* ]]; then
LINUX_OS=1
if [[ ! ${CI_RUNNER_TAGS} == *"docker-builder"* ]]; then
sudocmd="sudo "
fi
fi

${sudocmd} chmod +x .ci/*.sh

#the . command.sh syntaxe allows env var to be accessible cross-scripts (needed for timers)

# Check Ubuntu version
ubuntu=$(lsb_release -r)
echo "${ttk} Ubuntu $ubuntu"
VER=$(cut -f2 <<< "$ubuntu")
echo "${ttk} Version: ${VER}"

# Build the node
cd "${ROOT_PATH}"
ARCH=$(uname -m)
echo "${ttk} Architecture: ${ARCH}"
if [[ $ARCH == "x86_64" ]]; then
if [[ $VER == "20.04" ]]; then
echo "${ttk} Install the ZED SDK for ${ARCH} under Ubuntu ${VER}"
. .ci/download_and_install_sdk.sh 20 ${CUDA_MAJOR} ${CUDA_MINOR} ${ZED_SDK_MAJOR} ${ZED_SDK_MINOR}
echo "${ttk} Build ROS2 Humble from the source."
. .ci/build_humble_src.sh
fi
if [[ $VER == "22.04" ]]; then
echo "${ttk} Install the ZED SDK for ${ARCH} under Ubuntu ${VER}"
. .ci/download_and_install_sdk.sh 22 ${CUDA_MAJOR} ${CUDA_MINOR} ${ZED_SDK_MAJOR} ${ZED_SDK_MINOR}
echo "${ttk} Install ROS2 Humble from the binaries."
. .ci/build_humble_bin.sh
fi
elif [[ $ARCH == "aarch64" ]]; then
if [[ $VER == "20.04" ]]; then
JP_MAJOR=5
JP_MINOR=0
L4T_MAJOR=35
L4T_MINOR=1
echo "${ttk} Install the ZED SDK for ${ARCH} under Ubuntu ${VER}"
. .ci/jetson_download_and_install_sdk.sh ${JP_MAJOR} ${JP_MINOR} ${L4T_MAJOR} ${L4T_MINOR} ${ZED_SDK_MAJOR} ${ZED_SDK_MINOR}
echo "${ttk} Build ROS2 Humble from the source."
. .ci/jetson_build_humble_src.sh
fi
else
echo "${ttk} Architecture ${ARCH} is not supported."
exit 1
fi
if [ $? -ne 0 ]; then echo "${ttk} ROS2 Node build failed" > "$pwd_path/failure.txt" ; cat "$pwd_path/failure.txt" ; exit 1 ; fi
36 changes: 36 additions & 0 deletions .ci/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -e

ttk='--->'
WORKDIR=$(pwd)

#echo "${ttk} WORKDIR (${WORKDIR})content"
#ls -lah ${WORKDIR}

echo "${ttk} Check artifact presence"
ls -lah ../ros2_ws/install

#ls -lah /builds/sl/ros2_ws/install/zed_msgs/share/zed_msgs/
#ls -lah /builds/sl/ros2_ws/install/zed_components/share/zed_components/
#ls -lah /builds/sl/ros2_ws/install/zed_wrapper/share/zed_wrapper/
#ls -lah /builds/sl/ros2_ws/install/zed_ros2/share/zed_ros2/

echo "${ttk} Initialize local ROS2 environment"
cd ${WORKDIR}
source ../ros2_ws/install/local_setup.bash
env | grep COLCON
env | grep ROS

echo "${ttk} Check ROS2 installation"
ros2 doctor -r

echo "${ttk} Check ZED ROS2 packages presence"
ros2 pkg list | grep zed

echo "${ttk} USB peripherals"
lsusb | grep 2b03

echo "${ttk} Test node running for 10 seconds"
timeout --signal=SIGTERM 10 ros2 launch zed_wrapper zed2.launch.py

exit 0
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/1_feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Feature request 🧭
description: Suggest an idea for this project.
labels: "feature_request"
body:
- type: markdown
attributes:
value: |
# Welcome 👋
Thanks for taking the time to fill out this feature request module.
Please fill out each section below. This info allows Stereolabs developers to correctly evaluate your request.
Useful Links:
- Documentation: https://www.stereolabs.com/docs/
- Stereolabs support: https://support.stereolabs.com/hc/en-us/
- type: checkboxes
attributes:
label: Preliminary Checks
description: Please make sure that you verify each checkbox and follow the instructions for them.
options:
- label: "This issue is not a duplicate. Before opening a new issue, please search existing issues."
required: true
- label: "This issue is not a question, bug report, or anything other than a feature request directly related to this project."
required: true
- type: textarea
attributes:
label: Proposal
description: "What would you like to have as a new feature?"
placeholder: "A clear and concise description of what you want to happen."
validations:
required: true
- type: textarea
attributes:
label: Use-Case
description: "How would this help you?"
placeholder: "Tell us more what you'd like to achieve."
validations:
required: false
- type: textarea
id: anything-else
attributes:
label: Anything else?
description: "Let us know if you have anything else to share"
Loading