19 Commits
Author SHA1 Message Date
Matt Spencer c9144028f8 Initial fix of the lidar upgrade to Lyrical. Not yet tested. 2026-10-19 18:34:11 +01:00
Matt Spencer 46f7cbb8b5 Migrate to ROS2 Lyrical for all non-lidar packages
- Switch base image / repos file / rosdep distro from jazzy to lyrical
  (ros:lyrical is built on Ubuntu resolute/26.04).
- Vendor transport_drivers (serial_driver/io_context/udp_driver) since
  lyrical apt packages for them are not yet published; patch removes
  the now-gone ament_target_dependencies() macro.
- Fix ament_target_dependencies() removal across agv_pro_base,
  agv_pro_hardware, agv_pro_rviz_plugins, and slam_gmapping by switching
  to target_link_libraries() with namespaced imported targets (or raw
  *_LIBRARIES/*_INCLUDE_DIRS variables for packages with no modern
  target: serial_driver, ASIO).
- Migrate agv_pro_rviz_plugins from Qt5 to Qt6.
- Fix Boost 1.90 dropping libboost-system-dev: use header-only
  Boost::boost instead of a system component.
- Rename boost::asio::io_service -> io_context and
  mutable_buffers_1 -> mutable_buffer (Asio API removal) in
  agv_pro_hardware and agv_pro_base.
- Update tf2/message_filters includes from removed .h shims to .hpp,
  and fix message_filters::Subscriber's QoS constructor signature.
- Regenerate rosdep-packages.txt for lyrical; skip cartographer_ros/
  orbbec_camera in rosdep install (exec_depend-only, not yet published
  as ros-lyrical-* apt packages -- tracked in TODO.md).
- Lidar packages (fast_lio, livox_*, lslidar_*, point_lio,
  unitree_lidar_*) are deferred; their patches are present but not
  verified yet under lyrical.

Verified: full docker build succeeds with colcon build reporting all
23 non-lidar/transport packages finished, 0 failed.
2026-10-19 17:48:21 +01:00
Matt Spencer bbcb753c94 Fix merge regression: restore iproute2 install and base-image upgrade step in Dockerfile
These were unintentionally dropped during the jazzy_mecanum_control merge when
a whole-file 'git checkout --theirs Dockerfile' was used to resolve a conflict
that only affected the colcon build cmake-args line. iproute2 provides the
`ip` binary that agv_pro_hardware/AgvProHardwareInterface and
agv_pro_bringup/can_power_on.py need at runtime to bring up the CAN interface.
2026-10-13 17:00:00 +00:00
Matt Spencer 8d9b4006f4 Merge branch 'merge-test-sim-control' into merge-test-final
# Conflicts:
#	.devcontainer/jazzy/Dockerfile.jazzy
#	patches/livox_ros_driver2.patch
#	patches/livox_sdk.patch
#	patches/unilidar_sdk2.patch
2026-10-13 16:38:22 +00:00
Matt Spencer 412e8e3078 Merge remote-tracking branch 'origin/jazzy_mecanum_control' into merge-test-sim-control
# Conflicts:
#	Dockerfile
#	patches/livox_ros_driver2.patch
#	patches/livox_sdk.patch
#	patches/unilidar_sdk2.patch
2026-10-13 16:37:02 +00:00
Matt Spencer 577453a553 Fix patch application in container. 2026-07-17 14:43:49 +00:00
Matt Spencer b0dfa63fb7 Update the livox patches. 2026-07-17 14:43:49 +00:00
Matt Spencer 2e7eba5fc4 Get fast_lio cmake execute the git submodule init 2026-07-17 14:43:49 +00:00
Matt Spencer 54f71524f5 Patch to add symlinks to livox_ros_driver2 2026-07-17 14:43:49 +00:00
Matt Spencer aae2455b68 Fix unilidar_sdk2 for jazzy colcon build 2026-07-17 14:43:49 +00:00
Matt Spencer a553dcce5c Fix fast_lio for jazzy build 2026-07-17 14:43:49 +00:00
Matt Spencer 24c330df91 Fix patch application in container. 2026-07-17 14:38:53 +00:00
Matt Spencer 2fffa0edb8 Update the livox patches. 2026-07-17 11:36:53 +00:00
Matt Spencer 6ca2d063d6 Get fast_lio cmake execute the git submodule init 2026-07-17 10:42:40 +00:00
Matt Spencer a9234a90be Patch to add symlinks to livox_ros_driver2 2026-07-17 10:23:25 +00:00
Matt Spencer b439d420df Fix unilidar_sdk2 for jazzy colcon build 2026-07-17 10:05:14 +00:00
Matt Spencer b3553348a0 Fix fast_lio for jazzy build 2026-07-17 09:34:33 +00:00
Matt Spencer c5c0ed092a Add the ARG TARGETARCH to the deploy image build 2026-07-16 07:24:34 +00:00
Matt Spencer f8beede100 Create better caching of rosdep dependencies
For both  devcontainer and deployable container.
Also add ability to use docker from inside the devcontainer.
2026-07-16 07:12:48 +00:00
28 changed files with 828 additions and 183 deletions

No files matched your search

+15 -18
View File
@@ -1,4 +1,3 @@
# syntax=docker/dockerfile:1.7-labs
FROM osrf/ros:jazzy-desktop-full FROM osrf/ros:jazzy-desktop-full
ARG USERNAME=USERNAME ARG USERNAME=USERNAME
ARG USER_UID=1000 ARG USER_UID=1000
@@ -20,15 +19,13 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Make sure the base image is completely up to date # Make sure the base image is completely up to date
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ RUN apt-get update \
apt-get update \
&& apt-get upgrade -y \ && apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# C++ development tools # C++ development tools
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ RUN apt-get update \
apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
build-essential \ build-essential \
cmake \ cmake \
@@ -40,8 +37,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGE
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Python development tools # Python development tools
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ RUN apt-get update \
apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
python3-pip \ python3-pip \
python3-dev \ python3-dev \
@@ -52,20 +48,21 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGE
python3-vcstool \ python3-vcstool \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Copy boilerplate project config into workspace so it can be parsed by rosdep. # system deps from frozen rosdep manifest — no rosdep at build or startup
# This will be obscured by the volume mount or the workspace in the devcontainer # NOTE: There should be a check in your CI that this file is up to date.
# Don't include all sources, because the rosdep will re-process on any file change # Something like:
COPY --parents src/**/package.xml src/**/COLCON_IGNORE src/ # ./scripts/freeze-rosdep.sh && git diff --exit-code rosdep-packages.txt
COPY rosdep-packages.txt /tmp/rosdep-packages.txt
# The --mount=type=cache option caches the apt packages with buildkit
# The id-apt-cache-${TARGETARCH} option allows for separate caches for different architectures
# this enables parallel builds for different architectures without cache conflicts
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \
apt-get update \ rm -f /etc/apt/apt.conf.d/docker-clean \
&& rosdep update --rosdistro $ROS_DISTRO \ && apt-get update \
&& rosdep install --from-paths src --ignore-src -y \ && xargs -r -a /tmp/rosdep-packages.txt apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN apt-get update \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \
apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
+1 -1
View File
@@ -8,7 +8,7 @@ log/
__pycache__/ __pycache__/
firmware_dumps/ firmware_dumps/
# src/upstream is fetched fresh by `vcs import` during the Docker build (see # src/upstream is fetched fresh by `vcs import` during the Docker build (see
# upstream.jazzy.repos). Without this, COPY src ./src/ would ship whatever # upstream.lyrical.repos). Without this, COPY src ./src/ would ship whatever
# upstream checkout happens to already exist in the local dev container # upstream checkout happens to already exist in the local dev container
# (possibly already patched, possibly stale) *before* vcs import runs, and # (possibly already patched, possibly stale) *before* vcs import runs, and
# vcs import updates existing repos in place rather than cloning fresh -- # vcs import updates existing repos in place rather than cloning fresh --
+1 -1
View File
@@ -6,6 +6,6 @@ install/
log/ log/
/CMakeLists.txt /CMakeLists.txt
__pycache__/ __pycache__/
# Ignore upstream as it is installedls by the upstream.jazzy.repos # Ignore upstream as it is installedls by the upstream.lyrical.repos
src/upstream src/upstream
firmware_dumps/ firmware_dumps/
+28 -26
View File
@@ -1,4 +1,4 @@
FROM ros:jazzy FROM ros:lyrical
# Create the workspace and copy all source directories into it # Create the workspace and copy all source directories into it
WORKDIR /ros2_ws WORKDIR /ros2_ws
@@ -6,30 +6,16 @@ ARG TARGETARCH
COPY src ./src/ COPY src ./src/
COPY patches ./patches/ COPY patches ./patches/
COPY upstream.jazzy.repos ./upstream.jazzy.repos COPY upstream.lyrical.repos ./upstream.lyrical.repos
# Import all upstream repostories # Import all upstream repostories
RUN mkdir -p src/upstream && vcs import ./src/upstream < ./upstream.jazzy.repos RUN mkdir -p src/upstream && vcs import ./src/upstream < ./upstream.lyrical.repos
# Apply patches to upstream # Apply patches to upstream
RUN ./patches/apply_patches.sh RUN ./patches/apply_patches.sh
# system deps from frozen rosdep manifest — no rosdep at build or startup
# NOTE: There should be a check in your CI that this file is up to date.
# Something like:
# ./scripts/freeze-rosdep.sh && git diff --exit-code rosdep-packages.txt
# COPY rosdep-packages.txt /tmp/rosdep-packages.txt
# The --mount=type=cache option caches the apt packages with buildkit
# The id-apt-cache-${TARGETARCH} option allows for separate caches for different architectures
# this enables parallel builds for different architectures without cache conflicts
# RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \
# rm -f /etc/apt/apt.conf.d/docker-clean \
# && apt-get update \
# && xargs -r -a /tmp/rosdep-packages.txt apt-get install -y --no-install-recommends \
# && rm -rf /var/lib/apt/lists/*
# Make sure the base image is completely up to date # Make sure the base image is completely up to date
# ros:jazzy ships /etc/apt/apt.conf.d/docker-clean which purges downloaded .debs; # ros:lyrical ships /etc/apt/apt.conf.d/docker-clean which purges downloaded .debs;
# remove it so the --mount=type=cache on /var/cache/apt actually retains archives. # remove it so the --mount=type=cache on /var/cache/apt actually retains archives.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \
rm -f /etc/apt/apt.conf.d/docker-clean \ rm -f /etc/apt/apt.conf.d/docker-clean \
@@ -37,6 +23,20 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGE
&& apt-get upgrade -y \ && apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# system deps from frozen rosdep manifest — no rosdep at build or startup
# NOTE: There should be a check in your CI that this file is up to date.
# Something like:
# ./scripts/freeze-rosdep.sh && git diff --exit-code rosdep-packages.txt
COPY rosdep-packages.txt /tmp/rosdep-packages.txt
# The --mount=type=cache option caches the apt packages with buildkit
# The id-apt-cache-${TARGETARCH} option allows for separate caches for different architectures
# this enables parallel builds for different architectures without cache conflicts
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \
rm -f /etc/apt/apt.conf.d/docker-clean \
&& apt-get update \
&& xargs -r -a /tmp/rosdep-packages.txt apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# iproute2 provides `ip`, used by agv_pro_hardware/AgvProHardwareInterface and # iproute2 provides `ip`, used by agv_pro_hardware/AgvProHardwareInterface and
# agv_pro_bringup's can_power_on.py to bring up the wheel CAN interface at runtime. # agv_pro_bringup's can_power_on.py to bring up the wheel CAN interface at runtime.
# Not a ROS package so rosdep won't pull it in -- install it explicitly. # Not a ROS package so rosdep won't pull it in -- install it explicitly.
@@ -46,22 +46,24 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGE
&& apt-get install -y --no-install-recommends iproute2 \ && apt-get install -y --no-install-recommends iproute2 \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install dependencies with rosdep # Install dependencies with rosdep
# This will catch anything that wasn't installed via .deb's from the frozen rosdep manifest. # This will catch anything that wasn't installed via .deb's from the frozen rosdep manifest.
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \ # cartographer_ros/orbbec_camera are skipped: both are exec_depend-only (not needed to
rm -f /etc/apt/apt.conf.d/docker-clean && \ # build) and aren't published as ros-lyrical-* apt packages yet -- see TODO.md.
apt-get update && \ RUN apt-get update && \
rosdep update && \ rosdep update && \
rosdep install --from-paths src --ignore-src -r -y && \ rosdep install --from-paths src --ignore-src -r -y \
--skip-keys "cartographer_ros orbbec_camera" && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Build the workspace with symlink install # Build the workspace with symlink install
# livox_sdk is now an ament_cmake package built by colcon (no manual /usr/local install needed). # livox_sdk is now an ament_cmake package built by colcon (no manual /usr/local install needed).
RUN . /opt/ros/jazzy/setup.sh && \ RUN . /opt/ros/lyrical/setup.sh && \
colcon build --symlink-install colcon build --symlink-install \
--cmake-args -DROS_EDITION=ROS2 -DDISTRO_ROS=lyrical
# Source the overlay on container startup # Source the overlay on container startup
RUN echo "source /opt/ros/jazzy/setup.bash" >> /root/.bashrc && \ RUN echo "source /opt/ros/lyrical/setup.bash" >> /root/.bashrc && \
echo "source /ros2_ws/install/setup.bash" >> /root/.bashrc echo "source /ros2_ws/install/setup.bash" >> /root/.bashrc
CMD ["bash"] CMD ["bash"]
+3 -3
View File
@@ -8,8 +8,8 @@ ROS2 packages for AGV_Pro
> Software environment for Jetson Orin Nano > Software environment for Jetson Orin Nano
``` ```
ubuntu 22.04 ubuntu 24.04
ros2 humble ros2 lyrical
``` ```
# Installation # Installation
@@ -70,7 +70,7 @@ colcon build
``` ```
- `agv_pro_can` — wheels are controlled directly over CAN using the RobStride private - `agv_pro_can` — wheels are controlled directly over CAN using the RobStride private
protocol instead of serial, via the community [`robstride_ros2`](https://github.com/s2015-turtle/robstride_ros2) protocol instead of serial, via the community [`robstride_ros2`](https://github.com/s2015-turtle/robstride_ros2)
`ros2_control` driver (built from source, see `upstream.jazzy.repos`). IMU/voltage/digital-IO/LED `ros2_control` driver (built from source, see `upstream.lyrical.repos`). IMU/voltage/digital-IO/LED
remain on the serial base controller (`/dev/agvpro_controller`), unchanged. This replaces an remain on the serial base controller (`/dev/agvpro_controller`), unchanged. This replaces an
earlier CANopen-based attempt (`agv_pro_canopen_config`/`ros2_canopen`) that was never earlier CANopen-based attempt (`agv_pro_canopen_config`/`ros2_canopen`) that was never
confirmed against real hardware and has been removed — real, direction-confirmed CAN confirmed against real hardware and has been removed — real, direction-confirmed CAN
+77 -1
View File
@@ -1,5 +1,81 @@
# TODO # TODO
## ROS 2 Lyrical migration (`lyrical` branch)
Everything except the lidar stack has been moved to build against `ros:lyrical`
(Dockerfile, `upstream.lyrical.repos`, `rosdep-packages.txt`). The following upstream
packages are temporarily excluded from the colcon build via a `COLCON_IGNORE` marker
(captured in their respective `patches/*.patch` so it survives a fresh `vcs import`),
pending a dedicated pass to get them building under Lyrical:
- ~~`FAST_LIO` (`patches/fast_lio.patch`)~~ re-enabled, builds clean under lyrical
(`ament_target_dependencies()` guarded with `if(COMMAND ...)` + modern namespaced
targets; `tf2_ros/transform_broadcaster.h` → `.hpp`; added missing `tf2_ros` depend;
dropped unused `pcl_ros`/`rclcpp_components` link targets which don't export a
simple umbrella target under lyrical).
- ~~`livox_ros_driver2` (`patches/livox_ros_driver2.patch`)~~ re-enabled, builds clean
under lyrical (extended its existing `DISTRO_ROS STREQUAL "humble" OR "jazzy"`
modern-rosidl-typesupport guard to also match `"lyrical"`).
- ~~`livox_sdk` (`patches/livox_sdk.patch`)~~ re-enabled, builds clean under lyrical
(needed `cmake_minimum_required` bumped from 3.0 to 3.5 in several sub-CMakeLists —
CMake 4.2 fully removed compatibility with versions below 3.5).
- ~~`Lslidar_ROS2_driver` (`patches/lslidar_ros2_driver.patch`, new)~~ re-enabled,
builds clean under lyrical (`ament_target_dependencies` guarded with
`if(COMMAND...)` + modern namespaced targets in both the `lslidar_driver`
library and `lslidar_driver_node` executable; also needed `libpcap0.8-dev`
installed -- the package.xml's `libpcap` rosdep key resolves to it, but it
wasn't in `rosdep-packages.txt` yet since this package was previously
COLCON_IGNORE'd when that file was last frozen).
- ~~`point_lio_ros2` (`patches/point_lio_ros2.patch`, new)~~ re-enabled, builds clean
under lyrical (same `ament_target_dependencies`/modern-target-link pattern as
`FAST_LIO`; `tf2_ros/transform_broadcaster.h` \u2192 `.hpp` in 3 files; plus a new
fix not needed by `FAST_LIO`: added an explicit `find_package(PCL REQUIRED
COMPONENTS common io filters)` + `target_link_libraries(${PCL_LIBRARIES})`,
since this package never had its own PCL linkage and relied on legacy
`ament_target_dependencies` transitively pulling it in via `pcl_conversions`).
- ~~`unilidar_sdk2` (`patches/unilidar_sdk2.patch`)~~ re-enabled, builds clean under
lyrical (`unitree_lidar_ros2`'s `ament_target_dependencies` guarded with
`if(COMMAND...)` + modern namespaced targets; `unitree_lidar_sdk` only exports
legacy `ament_export_libraries()`/`ament_export_include_directories()` variables
(no namespaced target), so it's linked via explicit `${unitree_lidar_sdk_LIBRARIES}`/
`${unitree_lidar_sdk_INCLUDE_DIRS}`; `tf2_ros/transform_broadcaster.h` → `.hpp` and
`tf2/LinearMath/Quaternion.h` → `.hpp` in `unitree_lidar_ros2.h`). All 6 lidar
packages are now re-enabled and the full workspace builds clean (31/31 packages).
`agv_pro_bringup`'s `exec_depend` on `livox_ros_driver2`/`lslidar_driver` is left as-is —
rosdep's `--ignore-src` treats those as satisfied by the (ignored) local source packages,
so this doesn't block `rosdep install`. The `wheel_interface`/lidar-dependent launch
options simply won't have a built executable until the lidar packages are revisited.
`agv_pro_base` hard-depends on `serial_driver`/`io_context` (from the
`ros-drivers/transport_drivers` repo) at build time, but `ros-lyrical-serial-driver`/
`ros-lyrical-io-context` aren't published as apt packages yet (confirmed via
`apt-cache policy` in a real `ros:lyrical` container — index.ros.org lists them as
"released" for lyrical, but the actual .debs haven't synced to the mirror). Worked
around by vendoring `ros-drivers/transport_drivers` from source in
`upstream.lyrical.repos` instead of relying on the apt packages. It also needed a
CMake fix (`patches/transport_drivers.patch`): `ament_target_dependencies()` has been
removed entirely from Lyrical's `ament_cmake`, so the `ASIO` linkage (a non-ROS
dependency resolved via an old-style `Find<Pkg>.cmake` module, no modern imported
target) had to be replaced with manual `target_include_directories`/
`target_compile_definitions` using `${ASIO_INCLUDE_DIRS}`/`${ASIO_DEFINITIONS}`, and
the package's own test targets switched to linking modern namespaced targets
(`rclcpp::rclcpp`, `std_msgs::std_msgs__rosidl_typesupport_cpp`, etc.).
- [ ] Once `ros-lyrical-serial-driver`/`ros-lyrical-io-context` are actually published,
consider dropping the vendored `transport_drivers` in favor of the apt packages
again (re-run `./scripts/freeze-rosdep.sh` to confirm).
`ros-lyrical-cartographer-ros` (used by `agv_pro_bringup`) and `ros-lyrical-orbbec-camera`
(used by `agv_pro_slam`) are likewise not yet published as apt packages for lyrical. Both
are `exec_depend`-only (not needed to build), so they were simply removed from
`rosdep-packages.txt` — same treatment as the lidar exec_depends. The corresponding
launch options (cartographer-based mapping, Orbbec RGBD input) won't have a runnable
package installed in the image until these are published upstream.
- [ ] Re-add `ros-lyrical-cartographer-ros`/`ros-lyrical-orbbec-camera` to
`rosdep-packages.txt` once they're actually installable via apt.
Need to patch src/upstream/slam_gmapping/include/slam_gmapping/slam_gmapping.h Need to patch src/upstream/slam_gmapping/include/slam_gmapping/slam_gmapping.h
#include "tf2_geometry_msgs/tf2_geometry_msgs.h" #include "tf2_geometry_msgs/tf2_geometry_msgs.h"
@@ -33,7 +109,7 @@ package, after empirically confirming real CAN communication with the wheel driv
- [ ] Confirm `can_timeout_ticks` (currently the package default, 4000 ticks = 200 ms) is an - [ ] Confirm `can_timeout_ticks` (currently the package default, 4000 ticks = 200 ms) is an
appropriate watchdog window for this platform. appropriate watchdog window for this platform.
- [ ] Build-test: `colcon build` will build `robstride_ros2` and `ros2_socketcan` from - [ ] Build-test: `colcon build` will build `robstride_ros2` and `ros2_socketcan` from
source per `upstream.jazzy.repos` — not yet exercised in this workspace. source per `upstream.lyrical.repos` — not yet exercised in this workspace.
- [ ] End-to-end test: confirm `ros2 launch agv_pro_bringup agv_pro_bringup.launch.py - [ ] End-to-end test: confirm `ros2 launch agv_pro_bringup agv_pro_bringup.launch.py
wheel_interface:=can` actually drives all four wheels through the full wheel_interface:=can` actually drives all four wheels through the full
`ros2_control`/`mecanum_drive_controller` stack (only ad-hoc Python/CAN scripts have `ros2_control`/`mecanum_drive_controller` stack (only ad-hoc Python/CAN scripts have
+3
View File
@@ -27,5 +27,8 @@ apply_patch_once() {
apply_patch_once "$ROOT_DIR/src/upstream/FAST_LIO" "$PATCH_DIR/fast_lio.patch" apply_patch_once "$ROOT_DIR/src/upstream/FAST_LIO" "$PATCH_DIR/fast_lio.patch"
apply_patch_once "$ROOT_DIR/src/upstream/livox_sdk" "$PATCH_DIR/livox_sdk.patch" apply_patch_once "$ROOT_DIR/src/upstream/livox_sdk" "$PATCH_DIR/livox_sdk.patch"
apply_patch_once "$ROOT_DIR/src/upstream/livox_ros_driver2" "$PATCH_DIR/livox_ros_driver2.patch" apply_patch_once "$ROOT_DIR/src/upstream/livox_ros_driver2" "$PATCH_DIR/livox_ros_driver2.patch"
apply_patch_once "$ROOT_DIR/src/upstream/Lslidar_ROS2_driver" "$PATCH_DIR/lslidar_ros2_driver.patch"
apply_patch_once "$ROOT_DIR/src/upstream/point_lio_ros2" "$PATCH_DIR/point_lio_ros2.patch"
apply_patch_once "$ROOT_DIR/src/upstream/slam_gmapping" "$PATCH_DIR/slam_gmapping.patch" apply_patch_once "$ROOT_DIR/src/upstream/slam_gmapping" "$PATCH_DIR/slam_gmapping.patch"
apply_patch_once "$ROOT_DIR/src/upstream/unilidar_sdk2" "$PATCH_DIR/unilidar_sdk2.patch" apply_patch_once "$ROOT_DIR/src/upstream/unilidar_sdk2" "$PATCH_DIR/unilidar_sdk2.patch"
apply_patch_once "$ROOT_DIR/src/upstream/transport_drivers" "$PATCH_DIR/transport_drivers.patch"
+66 -1
View File
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index be3040b..3176847 100644 index be3040b..263c61c 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -5,17 +5,39 @@ if(NOT CMAKE_BUILD_TYPE) @@ -5,17 +5,39 @@ if(NOT CMAKE_BUILD_TYPE)
@@ -47,3 +47,68 @@ index be3040b..3176847 100644
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
message("Current CPU archtecture: ${CMAKE_SYSTEM_PROCESSOR}") message("Current CPU archtecture: ${CMAKE_SYSTEM_PROCESSOR}")
@@ -59,6 +81,7 @@ find_package(std_srvs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(pcl_ros REQUIRED)
find_package(pcl_conversions REQUIRED)
+find_package(tf2_ros REQUIRED)
find_package(livox_ros_driver2 REQUIRED)
find_package(rosidl_default_generators REQUIRED)
@@ -73,6 +96,7 @@ set(dependencies
visualization_msgs
pcl_ros
pcl_conversions
+ tf2_ros
livox_ros_driver2
)
@@ -113,7 +137,22 @@ else()
target_link_libraries(fastlio_mapping ${cpp_typesupport_target})
endif()
-ament_target_dependencies(fastlio_mapping ${dependencies})
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(fastlio_mapping ${dependencies})
+else()
+ target_link_libraries(fastlio_mapping
+ rclcpp::rclcpp
+ geometry_msgs::geometry_msgs
+ nav_msgs::nav_msgs
+ sensor_msgs::sensor_msgs
+ std_msgs::std_msgs
+ std_srvs::std_srvs
+ visualization_msgs::visualization_msgs
+ pcl_conversions::pcl_conversions
+ tf2_ros::tf2_ros
+ livox_ros_driver2::livox_ros_driver2
+ )
+endif()
# ---------------- Install --------------- #
install(TARGETS fastlio_mapping
diff --git a/package.xml b/package.xml
index 8c39e18..b64f06c 100644
--- a/package.xml
+++ b/package.xml
@@ -25,6 +25,7 @@
<depend>sensor_msgs</depend>
<depend>common_interfaces</depend>
<depend>tf2</depend>
+ <depend>tf2_ros</depend>
<depend>pcl_ros</depend>
<depend>pcl_conversions</depend>
<depend>livox_ros_driver2</depend>
diff --git a/src/laserMapping.cpp b/src/laserMapping.cpp
index e5d9950..9c437a1 100644
--- a/src/laserMapping.cpp
+++ b/src/laserMapping.cpp
@@ -56,7 +56,7 @@
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <sensor_msgs/msg/imu.hpp>
#include <std_srvs/srv/trigger.hpp>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <geometry_msgs/msg/vector3.hpp>
#include <livox_ros_driver2/msg/custom_msg.hpp>
+11 -2
View File
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7344d08..3d531a9 100644 index 7344d08..28e3de8 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
+++ b/CMakeLists.txt +++ b/CMakeLists.txt
@@ -1,3 +1,9 @@ @@ -1,3 +1,9 @@
@@ -25,6 +25,15 @@ index 7344d08..3d531a9 100644
# Default to C99 # Default to C99
if(NOT CMAKE_C_STANDARD) if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD 99)
@@ -282,7 +294,7 @@ else(ROS_EDITION STREQUAL "ROS2")
target_include_directories(${PROJECT_NAME} PRIVATE ${livox_sdk_INCLUDE_DIRS})
# get include directories of custom msg headers
- if(DISTRO_ROS STREQUAL "humble" OR DISTRO_ROS STREQUAL "jazzy")
+ if(DISTRO_ROS STREQUAL "humble" OR DISTRO_ROS STREQUAL "jazzy" OR DISTRO_ROS STREQUAL "lyrical")
rosidl_get_typesupport_target(cpp_typesupport_target
${LIVOX_INTERFACES} "rosidl_typesupport_cpp")
target_link_libraries(${PROJECT_NAME} "${cpp_typesupport_target}")
diff --git a/launch b/launch diff --git a/launch b/launch
new file mode 120000 new file mode 120000
index 0000000..163fb01 index 0000000..163fb01
@@ -35,7 +44,7 @@ index 0000000..163fb01
\ No newline at end of file \ No newline at end of file
diff --git a/package.xml b/package.xml diff --git a/package.xml b/package.xml
new file mode 100644 new file mode 100644
index 0000000..0000000 index 0000000..c66785b
--- /dev/null --- /dev/null
+++ b/package.xml +++ b/package.xml
@@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
+102 -1
View File
@@ -1,3 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05f84c5..4fb6f31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,9 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
project(livox_sdk2)
+find_package(ament_cmake REQUIRED)
+
set(CMAKE_CXX_STANDARD 11)
message(STATUS "main project dir: " ${PROJECT_SOURCE_DIR})
@@ -18,3 +20,9 @@ endif(UNIX)
add_subdirectory(sdk_core)
add_subdirectory(samples)
+
+# Export the installed headers/libraries so ament packages (e.g. livox_ros_driver2)
+# find the SDK from the colcon install space via CMAKE_PREFIX_PATH.
+ament_export_include_directories(include)
+ament_export_libraries(livox_lidar_sdk_shared)
+ament_package()
diff --git a/package.xml b/package.xml diff --git a/package.xml b/package.xml
new file mode 100644 new file mode 100644
index 0000000..ffdf3ce index 0000000..ffdf3ce
@@ -22,10 +47,86 @@ index 0000000..ffdf3ce
+ <build_type>ament_cmake</build_type> + <build_type>ament_cmake</build_type>
+ </export> + </export>
+</package> +</package>
diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt
index 77c05c7..14e2572 100644
--- a/samples/CMakeLists.txt
+++ b/samples/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
project(livox_sdk2)
diff --git a/samples/debug_point_cloud/CMakeLists.txt b/samples/debug_point_cloud/CMakeLists.txt
index c94f254..a4ccce7 100644
--- a/samples/debug_point_cloud/CMakeLists.txt
+++ b/samples/debug_point_cloud/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME debug_point_cloud)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/lidar_cmd_observer/CMakeLists.txt b/samples/lidar_cmd_observer/CMakeLists.txt
index 503ff6f..347d17e 100644
--- a/samples/lidar_cmd_observer/CMakeLists.txt
+++ b/samples/lidar_cmd_observer/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME lidar_cmd_observer)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/livox_lidar_quick_start/CMakeLists.txt b/samples/livox_lidar_quick_start/CMakeLists.txt
index 3f17580..ebc39f9 100644
--- a/samples/livox_lidar_quick_start/CMakeLists.txt
+++ b/samples/livox_lidar_quick_start/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME livox_lidar_quick_start)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/livox_lidar_rmc_time_sync/CMakeLists.txt b/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
index c976087..fcdcaf8 100644
--- a/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
+++ b/samples/livox_lidar_rmc_time_sync/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME livox_lidar_rmc_time_sync)
if (WIN32)
diff --git a/samples/logger/CMakeLists.txt b/samples/logger/CMakeLists.txt
index 72b625b..252bf4b 100644
--- a/samples/logger/CMakeLists.txt
+++ b/samples/logger/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME logger)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/samples/multi_lidars_upgrade/CMakeLists.txt b/samples/multi_lidars_upgrade/CMakeLists.txt
index 74f08d6..4b8dfa9 100644
--- a/samples/multi_lidars_upgrade/CMakeLists.txt
+++ b/samples/multi_lidars_upgrade/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(DEMO_NAME multi_lidars_upgrade)
add_executable(${DEMO_NAME} main.cpp)
diff --git a/sdk_core/CMakeLists.txt b/sdk_core/CMakeLists.txt diff --git a/sdk_core/CMakeLists.txt b/sdk_core/CMakeLists.txt
index 15e960d..aa9e08a 100644 index 15e960d..98173f8 100644
--- a/sdk_core/CMakeLists.txt --- a/sdk_core/CMakeLists.txt
+++ b/sdk_core/CMakeLists.txt +++ b/sdk_core/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.5)
set(SDK_LIBRARY_STATIC livox_lidar_sdk_static)
set(SDK_LIBRARY_SHARED livox_lidar_sdk_shared)
@@ -142,3 +142,11 @@ install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED} @@ -142,3 +142,11 @@ install(TARGETS ${SDK_LIBRARY_STATIC} ${SDK_LIBRARY_SHARED}
PUBLIC_HEADER DESTINATION include PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib ARCHIVE DESTINATION lib
+75
View File
@@ -0,0 +1,75 @@
diff --git a/lslidar_driver/CMakeLists.txt b/lslidar_driver/CMakeLists.txt
index 20836be..e8f3fdd 100644
--- a/lslidar_driver/CMakeLists.txt
+++ b/lslidar_driver/CMakeLists.txt
@@ -64,15 +64,27 @@ target_link_libraries(lslidar_driver
${YAML_CPP_LIBRARIES}
)
-ament_target_dependencies(lslidar_driver
- rclcpp
- sensor_msgs
- std_msgs
- lslidar_msgs
- ament_index_cpp
- pcl_conversions
- Eigen3
-)
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(lslidar_driver
+ rclcpp
+ sensor_msgs
+ std_msgs
+ lslidar_msgs
+ ament_index_cpp
+ pcl_conversions
+ Eigen3
+ )
+else()
+ target_link_libraries(lslidar_driver
+ rclcpp::rclcpp
+ sensor_msgs::sensor_msgs
+ std_msgs::std_msgs
+ lslidar_msgs::lslidar_msgs
+ ament_index_cpp::ament_index_cpp
+ pcl_conversions::pcl_conversions
+ Eigen3::Eigen
+ )
+endif()
add_executable(lslidar_driver_node src/lslidar_driver_node.cpp)
target_link_libraries(lslidar_driver_node
@@ -80,14 +92,25 @@ target_link_libraries(lslidar_driver_node
${Boost_LIBRARIES}
)
-ament_target_dependencies(lslidar_driver_node
- rclcpp
- sensor_msgs
- std_msgs
- lslidar_msgs
- ament_index_cpp
- pcl_conversions
-)
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(lslidar_driver_node
+ rclcpp
+ sensor_msgs
+ std_msgs
+ lslidar_msgs
+ ament_index_cpp
+ pcl_conversions
+ )
+else()
+ target_link_libraries(lslidar_driver_node
+ rclcpp::rclcpp
+ sensor_msgs::sensor_msgs
+ std_msgs::std_msgs
+ lslidar_msgs::lslidar_msgs
+ ament_index_cpp::ament_index_cpp
+ pcl_conversions::pcl_conversions
+ )
+endif()
install(TARGETS
lslidar_driver
+101
View File
@@ -0,0 +1,101 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 75e0b30..5375a4a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,27 +61,44 @@ endif()
find_package(PythonLibs REQUIRED) # Consider using Pybind11 for ROS2
find_path(MATPLOTLIB_CPP_INCLUDE_DIRS "matplotlibcpp.h")
+find_package(PCL REQUIRED COMPONENTS common io filters)
+
include_directories(
include
${EIGEN3_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
+ ${PCL_INCLUDE_DIRS}
)
+link_directories(${PCL_LIBRARY_DIRS})
+add_definitions(${PCL_DEFINITIONS})
# Declare a ROS2 executable
add_executable(pointlio_mapping src/laserMapping.cpp include/ikd-Tree/ikd_Tree.cpp src/parameters.cpp src/preprocess.cpp src/Estimator.cpp)
-ament_target_dependencies(pointlio_mapping
- rclcpp
- rclpy
- geometry_msgs
- nav_msgs
- sensor_msgs
- pcl_ros
- pcl_conversions
- tf2_ros
- visualization_msgs
- # livox_ros_driver2
-)
-target_link_libraries(pointlio_mapping ${PYTHON_LIBRARIES})
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(pointlio_mapping
+ rclcpp
+ rclpy
+ geometry_msgs
+ nav_msgs
+ sensor_msgs
+ pcl_ros
+ pcl_conversions
+ tf2_ros
+ visualization_msgs
+ # livox_ros_driver2
+ )
+else()
+ target_link_libraries(pointlio_mapping
+ rclcpp::rclcpp
+ geometry_msgs::geometry_msgs
+ nav_msgs::nav_msgs
+ sensor_msgs::sensor_msgs
+ pcl_conversions::pcl_conversions
+ tf2_ros::tf2_ros
+ visualization_msgs::visualization_msgs
+ )
+endif()
+target_link_libraries(pointlio_mapping ${PYTHON_LIBRARIES} ${PCL_LIBRARIES})
target_include_directories(pointlio_mapping PRIVATE ${PYTHON_INCLUDE_DIRS})
# Install the executable
diff --git a/include/common_lib.h b/include/common_lib.h
index a3ef8e5..96beb41 100644
--- a/include/common_lib.h
+++ b/include/common_lib.h
@@ -7,7 +7,7 @@
#include <pcl/point_cloud.h>
#include <sensor_msgs/msg/imu.hpp>
#include <nav_msgs/msg/odometry.hpp>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <deque>
using namespace std;
using namespace Eigen;
diff --git a/src/IMU_Processing.hpp b/src/IMU_Processing.hpp
index 898a451..1a7a0a7 100644
--- a/src/IMU_Processing.hpp
+++ b/src/IMU_Processing.hpp
@@ -16,7 +16,7 @@
#include <nav_msgs/msg/odometry.hpp>
#include <pcl/common/transforms.h>
#include <pcl/kdtree/kdtree_flann.h>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <pcl_conversions/pcl_conversions.h>
#include <sensor_msgs/msg/imu.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
diff --git a/src/laserMapping.cpp b/src/laserMapping.cpp
index b6d5f4a..2d5bebc 100644
--- a/src/laserMapping.cpp
+++ b/src/laserMapping.cpp
@@ -19,7 +19,7 @@
#include <pcl/filters/voxel_grid.h>
#include <pcl/io/pcd_io.h>
#include <sensor_msgs/msg/point_cloud2.hpp>
-#include <tf2_ros/transform_broadcaster.h>
+#include <tf2_ros/transform_broadcaster.hpp>
#include <geometry_msgs/msg/vector3.hpp>
// #include <livox_ros_driver2/msg/custom_msg.hpp>
+52 -3
View File
@@ -1,8 +1,38 @@
diff --git a/slam_gmapping/CMakeLists.txt b/slam_gmapping/CMakeLists.txt
index d0115c0..40d9df2 100644
--- a/slam_gmapping/CMakeLists.txt
+++ b/slam_gmapping/CMakeLists.txt
@@ -44,15 +44,16 @@ include_directories(include)
add_executable(slam_gmapping src/slam_gmapping.cpp)
-ament_target_dependencies(slam_gmapping
- rclcpp
- tf2
- tf2_ros
- message_filters
- sensor_msgs
- nav_msgs
- tf2_geometry_msgs
- openslam_gmapping)
+target_include_directories(slam_gmapping PUBLIC ${openslam_gmapping_INCLUDE_DIRS})
+target_link_libraries(slam_gmapping
+ rclcpp::rclcpp
+ tf2::tf2
+ tf2_ros::tf2_ros
+ message_filters::message_filters
+ sensor_msgs::sensor_msgs
+ nav_msgs::nav_msgs
+ tf2_geometry_msgs::tf2_geometry_msgs
+ ${openslam_gmapping_LIBRARIES})
install(TARGETS slam_gmapping
DESTINATION lib/${PROJECT_NAME})
diff --git a/slam_gmapping/include/slam_gmapping/slam_gmapping.h b/slam_gmapping/include/slam_gmapping/slam_gmapping.h diff --git a/slam_gmapping/include/slam_gmapping/slam_gmapping.h b/slam_gmapping/include/slam_gmapping/slam_gmapping.h
index 1ee2e5c..204ca85 100644 index 1ee2e5c..b43f738 100644
--- a/slam_gmapping/include/slam_gmapping/slam_gmapping.h --- a/slam_gmapping/include/slam_gmapping/slam_gmapping.h
+++ b/slam_gmapping/include/slam_gmapping/slam_gmapping.h +++ b/slam_gmapping/include/slam_gmapping/slam_gmapping.h
@@ -35,7 +35,7 @@ @@ -35,11 +35,11 @@
#include "geometry_msgs/msg/pose.hpp" #include "geometry_msgs/msg/pose.hpp"
#include "geometry_msgs/msg/pose_stamped.hpp" #include "geometry_msgs/msg/pose_stamped.hpp"
#include "geometry_msgs/msg/transform_stamped.hpp" #include "geometry_msgs/msg/transform_stamped.hpp"
@@ -10,4 +40,23 @@ index 1ee2e5c..204ca85 100644
+#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" +#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
#include "tf2_ros/transform_listener.h" #include "tf2_ros/transform_listener.h"
#include "tf2_ros/transform_broadcaster.h" #include "tf2_ros/transform_broadcaster.h"
#include "tf2/utils.h" -#include "tf2/utils.h"
-#include "message_filters/subscriber.h"
+#include "tf2/utils.hpp"
+#include "message_filters/subscriber.hpp"
#include "tf2_ros/message_filter.h"
#include "gmapping/gridfastslam/gridslamprocessor.h"
diff --git a/slam_gmapping/src/slam_gmapping.cpp b/slam_gmapping/src/slam_gmapping.cpp
index 8500f8e..2b47c76 100644
--- a/slam_gmapping/src/slam_gmapping.cpp
+++ b/slam_gmapping/src/slam_gmapping.cpp
@@ -102,7 +102,7 @@ void SlamGmapping::startLiveSlam() {
sst_ = this->create_publisher<nav_msgs::msg::OccupancyGrid>("map", rclcpp::SystemDefaultsQoS());
sstm_ = this->create_publisher<nav_msgs::msg::MapMetaData>("map_metadata", rclcpp::SystemDefaultsQoS());
scan_filter_sub_ = std::make_shared<message_filters::Subscriber<sensor_msgs::msg::LaserScan>>
- (node_, "scan", rclcpp::SensorDataQoS().get_rmw_qos_profile());
+ (node_, "scan", rclcpp::SensorDataQoS());
// sub_ = this->create_subscription<sensor_msgs::msg::LaserScan>(
// "scan", rclcpp::SensorDataQoS(),
// std::bind(&SlamGmapping::laserCallback, this, std::placeholders::_1));
+120
View File
@@ -0,0 +1,120 @@
diff --git a/io_context/CMakeLists.txt b/io_context/CMakeLists.txt
index 3c04653..4f7226f 100644
--- a/io_context/CMakeLists.txt
+++ b/io_context/CMakeLists.txt
@@ -38,7 +38,8 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
src/io_context.cpp
src/msg_converters/std_msgs.cpp
)
-ament_target_dependencies(${PROJECT_NAME} "ASIO")
+target_include_directories(${PROJECT_NAME} PUBLIC ${ASIO_INCLUDE_DIRS})
+target_compile_definitions(${PROJECT_NAME} PUBLIC ${ASIO_DEFINITIONS})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
@@ -48,7 +49,9 @@ if(BUILD_TESTING)
ament_add_gtest(${TEST_UDP_DRIVER_EXE}
test/${name}.cpp)
- ament_target_dependencies(${TEST_UDP_DRIVER_EXE} std_msgs udp_msgs "ASIO")
+ target_link_libraries(${TEST_UDP_DRIVER_EXE} std_msgs::std_msgs__rosidl_typesupport_cpp udp_msgs::udp_msgs__rosidl_typesupport_cpp)
+ target_include_directories(${TEST_UDP_DRIVER_EXE} PRIVATE ${ASIO_INCLUDE_DIRS})
+ target_compile_definitions(${TEST_UDP_DRIVER_EXE} PRIVATE ${ASIO_DEFINITIONS})
target_include_directories(${TEST_UDP_DRIVER_EXE} PRIVATE include)
target_link_libraries(${TEST_UDP_DRIVER_EXE} ${PROJECT_NAME})
diff --git a/serial_driver/CMakeLists.txt b/serial_driver/CMakeLists.txt
index 9055ace..2d4d1bd 100644
--- a/serial_driver/CMakeLists.txt
+++ b/serial_driver/CMakeLists.txt
@@ -38,7 +38,8 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
src/serial_driver.cpp
)
-ament_target_dependencies(${PROJECT_NAME} "ASIO")
+target_include_directories(${PROJECT_NAME} PUBLIC ${ASIO_INCLUDE_DIRS})
+target_compile_definitions(${PROJECT_NAME} PUBLIC ${ASIO_DEFINITIONS})
ament_auto_add_library(${PROJECT_NAME}_nodes SHARED
src/serial_bridge_node.cpp
@@ -50,7 +51,8 @@ rclcpp_components_register_node(${PROJECT_NAME}_nodes
)
target_link_libraries(${PROJECT_NAME}_nodes ${PROJECT_NAME})
-ament_target_dependencies(${PROJECT_NAME}_nodes "ASIO")
+target_include_directories(${PROJECT_NAME}_nodes PUBLIC ${ASIO_INCLUDE_DIRS})
+target_compile_definitions(${PROJECT_NAME}_nodes PUBLIC ${ASIO_DEFINITIONS})
if(BUILD_TESTING)
find_package(ament_lint_auto)
@@ -68,12 +70,9 @@ if(BUILD_TESTING)
ament_add_gtest(${TEST_SERIAL_DRIVER_EXE}
test/${name}.cpp
)
- ament_target_dependencies(${TEST_SERIAL_DRIVER_EXE}
- rclcpp
- lifecycle_msgs
- ASIO
- )
- target_include_directories(${TEST_SERIAL_DRIVER_EXE} PRIVATE include)
+ target_link_libraries(${TEST_SERIAL_DRIVER_EXE} rclcpp::rclcpp lifecycle_msgs::lifecycle_msgs__rosidl_typesupport_cpp)
+ target_include_directories(${TEST_SERIAL_DRIVER_EXE} PRIVATE include ${ASIO_INCLUDE_DIRS})
+ target_compile_definitions(${TEST_SERIAL_DRIVER_EXE} PRIVATE ${ASIO_DEFINITIONS})
target_link_libraries(${TEST_SERIAL_DRIVER_EXE} ${PROJECT_NAME} ${PROJECT_NAME_NODES})
endforeach()
endif()
diff --git a/udp_driver/CMakeLists.txt b/udp_driver/CMakeLists.txt
index f78d262..cf8abd8 100644
--- a/udp_driver/CMakeLists.txt
+++ b/udp_driver/CMakeLists.txt
@@ -38,13 +38,15 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
src/udp_socket.cpp
src/udp_driver.cpp
)
-ament_target_dependencies(${PROJECT_NAME} "ASIO")
+target_include_directories(${PROJECT_NAME} PUBLIC ${ASIO_INCLUDE_DIRS})
+target_compile_definitions(${PROJECT_NAME} PUBLIC ${ASIO_DEFINITIONS})
ament_auto_add_library(${PROJECT_NAME}_nodes SHARED
src/udp_receiver_node.cpp
src/udp_sender_node.cpp
)
-ament_target_dependencies(${PROJECT_NAME}_nodes "ASIO")
+target_include_directories(${PROJECT_NAME}_nodes PUBLIC ${ASIO_INCLUDE_DIRS})
+target_compile_definitions(${PROJECT_NAME}_nodes PUBLIC ${ASIO_DEFINITIONS})
target_link_libraries(${PROJECT_NAME}_nodes ${PROJECT_NAME})
rclcpp_components_register_node(${PROJECT_NAME}_nodes
@@ -62,7 +64,8 @@ ament_auto_add_executable(udp_bridge_node_exe
)
target_link_libraries(udp_bridge_node_exe ${PROJECT_NAME} ${PROJECT_NAME}_nodes)
-ament_target_dependencies(udp_bridge_node_exe ASIO)
+target_include_directories(udp_bridge_node_exe PUBLIC ${ASIO_INCLUDE_DIRS})
+target_compile_definitions(udp_bridge_node_exe PUBLIC ${ASIO_DEFINITIONS})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
@@ -80,14 +83,14 @@ if(BUILD_TESTING)
ament_add_gtest(${TEST_UDP_DRIVER_EXE}
test/${name}.cpp)
- ament_target_dependencies(${TEST_UDP_DRIVER_EXE}
- rclcpp
- std_msgs
- udp_msgs
- lifecycle_msgs
- ASIO)
-
- target_include_directories(${TEST_UDP_DRIVER_EXE} PRIVATE include)
+ target_link_libraries(${TEST_UDP_DRIVER_EXE}
+ rclcpp::rclcpp
+ std_msgs::std_msgs__rosidl_typesupport_cpp
+ udp_msgs::udp_msgs__rosidl_typesupport_cpp
+ lifecycle_msgs::lifecycle_msgs__rosidl_typesupport_cpp)
+
+ target_include_directories(${TEST_UDP_DRIVER_EXE} PRIVATE include ${ASIO_INCLUDE_DIRS})
+ target_compile_definitions(${TEST_UDP_DRIVER_EXE} PRIVATE ${ASIO_DEFINITIONS})
target_link_libraries(${TEST_UDP_DRIVER_EXE} ${PROJECT_NAME} ${PROJECT_NAME}_nodes)
endforeach()
endif()
+51 -10
View File
@@ -2,10 +2,10 @@ diff --git a/unitree_lidar_ros/src/unitree_lidar_ros/COLCON_IGNORE b/unitree_lid
new file mode 100644 new file mode 100644
index 0000000..e69de29 index 0000000..e69de29
diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt b/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt b/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt
index 041ef0d..dd57d47 100644 index 041ef0d..7014678 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt --- a/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt
+++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt +++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/CMakeLists.txt
@@ -23,16 +23,15 @@ find_package(pcl_conversions REQUIRED) @@ -23,16 +23,16 @@ find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED) find_package(PCL REQUIRED)
find_package(tf2_ros REQUIRED) find_package(tf2_ros REQUIRED)
find_package(sensor_msgs REQUIRED) find_package(sensor_msgs REQUIRED)
@@ -15,6 +15,7 @@ index 041ef0d..dd57d47 100644
${PCL_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS}
include include
- ../../../unitree_lidar_sdk/include - ../../../unitree_lidar_sdk/include
+ ${unitree_lidar_sdk_INCLUDE_DIRS}
) )
link_directories( link_directories(
@@ -23,22 +24,62 @@ index 041ef0d..dd57d47 100644
) )
add_definitions(${PCL_DEFINITIONS}) add_definitions(${PCL_DEFINITIONS})
@@ -42,7 +41,6 @@ add_executable(unitree_lidar_ros2_node src/unitree_lidar_ros2_node.cpp) @@ -42,17 +42,31 @@ add_executable(unitree_lidar_ros2_node src/unitree_lidar_ros2_node.cpp)
target_link_libraries( unitree_lidar_ros2_node target_link_libraries( unitree_lidar_ros2_node
${Boost_SYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${PCL_LIBRARIES} ${PCL_LIBRARIES}
- libunilidar_sdk2.a - libunilidar_sdk2.a
+ # unitree_lidar_sdk only exports legacy ament_export_libraries()/
+ # ament_export_include_directories() variables, not a namespaced CMake
+ # target, so it must be linked via ${unitree_lidar_sdk_LIBRARIES}.
+ ${unitree_lidar_sdk_LIBRARIES}
) )
ament_target_dependencies( -ament_target_dependencies(
@@ -52,6 +50,7 @@ ament_target_dependencies( - unitree_lidar_ros2_node
geometry_msgs - rclcpp std_msgs
tf2_ros - sensor_msgs
pcl_conversions - geometry_msgs
+ unitree_lidar_sdk - tf2_ros
) - pcl_conversions
-)
+if(COMMAND ament_target_dependencies)
+ ament_target_dependencies(
+ unitree_lidar_ros2_node
+ rclcpp std_msgs
+ sensor_msgs
+ geometry_msgs
+ tf2_ros
+ pcl_conversions
+ )
+else()
+ target_link_libraries(unitree_lidar_ros2_node
+ rclcpp::rclcpp
+ std_msgs::std_msgs
+ sensor_msgs::sensor_msgs
+ geometry_msgs::geometry_msgs
+ tf2_ros::tf2_ros
+ pcl_conversions::pcl_conversions
+ )
+endif()
install(TARGETS install(TARGETS
unitree_lidar_ros2_node
diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h b/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h
index 29c094c..5159909 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h
+++ b/unitree_lidar_ros2/src/unitree_lidar_ros2/include/unitree_lidar_ros2.h
@@ -25,8 +25,8 @@
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/time.hpp"
-#include "tf2_ros/transform_broadcaster.h"
-#include "tf2/LinearMath/Quaternion.h"
+#include "tf2_ros/transform_broadcaster.hpp"
+#include "tf2/LinearMath/Quaternion.hpp"
#include "geometry_msgs/msg/transform_stamped.hpp"
// SDK
diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml diff --git a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml b/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
index 74539aa..8b186d8 100644 index 74539aa..8b186d8 100644
--- a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml --- a/unitree_lidar_ros2/src/unitree_lidar_ros2/package.xml
+63 -68
View File
@@ -1,73 +1,68 @@
git git
libapr1-dev libaprutil1-dev libapr1-dev
libaprutil1-dev
libasio-dev
libboost-all-dev libboost-all-dev
libboost-dev
libpcap0.8-dev libpcap0.8-dev
libpcl-apps1.14 libpcl-common1.14 libpcl-features1.14 libpcl-filters1.14 libpcl-io1.14 libpcl-kdtree1.14 libpcl-keypoints1.14 libpcl-ml1.14 libpcl-octree1.14 libpcl-outofcore1.14 libpcl-people1.14 libpcl-recognition1.14 libpcl-registration1.14 libpcl-sample-consensus1.14 libpcl-search1.14 libpcl-segmentation1.14 libpcl-stereo1.14 libpcl-surface1.14 libpcl-tracking1.14 libpcl-visualization1.14 libpcl-apps1.15
libpcl-common1.15
libpcl-dev libpcl-dev
libqt5core5t64 libpcl-features1.15
libqt5gui5t64 libpcl-filters1.15
libqt5opengl5t64 libpcl-io1.15
libqt5widgets5t64 libpcl-kdtree1.15
libpcl-keypoints1.15
libpcl-ml1.15
libpcl-octree1.15
libpcl-outofcore1.15
libpcl-people1.15
libpcl-recognition1.15
libpcl-registration1.15
libpcl-sample-consensus1.15
libpcl-search1.15
libpcl-segmentation1.15
libpcl-stereo1.15
libpcl-surface1.15
libpcl-tracking1.15
libpcl-visualization1.15
libqt6core6t64
libqt6gui6
libqt6opengl6
libqt6widgets6
python3-pytest python3-pytest
qtbase5-dev qt6-base-dev
ros-jazzy-ament-cmake ros-lyrical-ament-cmake-black
ros-jazzy-ament-cmake-auto ros-lyrical-ament-cmake-clang-format
ros-jazzy-ament-cmake-black ros-lyrical-ament-cmake-clang-tidy
ros-jazzy-ament-cmake-clang-format ros-lyrical-can-msgs
ros-jazzy-ament-cmake-clang-tidy ros-lyrical-controller-manager
ros-jazzy-ament-cmake-copyright ros-lyrical-forward-command-controller
ros-jazzy-ament-cmake-xmllint ros-lyrical-gz-ros2-control
ros-jazzy-ament-copyright ros-lyrical-hardware-interface
ros-jazzy-ament-flake8 ros-lyrical-joint-state-broadcaster
ros-jazzy-ament-index-cpp ros-lyrical-joint-state-publisher
ros-jazzy-ament-lint-auto ros-lyrical-laser-filters
ros-jazzy-ament-lint-common ros-lyrical-mecanum-drive-controller
ros-jazzy-ament-pep257 ros-lyrical-nav2-bringup
ros-jazzy-asio-cmake-module ros-lyrical-nav2-simple-commander
ros-jazzy-builtin-interfaces ros-lyrical-pcl-conversions
ros-jazzy-cartographer-ros ros-lyrical-pcl-ros
ros-jazzy-common-interfaces ros-lyrical-resource-retriever
ros-jazzy-controller-manager ros-lyrical-ros2-control
ros-jazzy-diff-drive-controller ros-lyrical-ros-gz-bridge
ros-jazzy-geometry-msgs ros-lyrical-ros-gz-sim
ros-jazzy-io-context ros-lyrical-rtabmap-demos
ros-jazzy-joint-state-broadcaster ros-lyrical-rtabmap-slam
ros-jazzy-joint-state-publisher ros-lyrical-rtabmap-sync
ros-jazzy-message-filters ros-lyrical-rtabmap-util
ros-jazzy-nav-msgs ros-lyrical-rtabmap-viz
ros-jazzy-nav2-bringup ros-lyrical-rviz2
ros-jazzy-nav2-simple-commander ros-lyrical-rviz-common
ros-jazzy-orbbec-camera ros-lyrical-rviz-default-plugins
ros-jazzy-pcl-conversions ros-lyrical-rviz-ogre-vendor
ros-jazzy-pcl-ros ros-lyrical-rviz-rendering
ros-jazzy-pluginlib ros-lyrical-slam-toolbox
ros-jazzy-rcl-interfaces ros-lyrical-teleop-twist-keyboard
ros-jazzy-rclcpp ros-lyrical-udp-msgs
ros-jazzy-rclcpp-components ros-lyrical-xacro
ros-jazzy-rclpy
ros-jazzy-rcutils
ros-jazzy-resource-retriever
ros-jazzy-robot-state-publisher
ros-jazzy-ros2-control
ros-jazzy-rosbag2
ros-jazzy-rosidl-default-generators
ros-jazzy-rosidl-default-runtime
ros-jazzy-rtabmap-demos
ros-jazzy-rtabmap-slam
ros-jazzy-rtabmap-sync
ros-jazzy-rtabmap-util
ros-jazzy-rtabmap-viz
ros-jazzy-rviz-common
ros-jazzy-rviz-default-plugins
ros-jazzy-rviz-ogre-vendor
ros-jazzy-rviz-rendering
ros-jazzy-rviz2
ros-jazzy-sensor-msgs
ros-jazzy-serial-driver
ros-jazzy-std-msgs
ros-jazzy-teleop-twist-keyboard
ros-jazzy-tf2
ros-jazzy-tf2-geometry-msgs
ros-jazzy-tf2-ros
ros-jazzy-visualization-msgs
ros-jazzy-xacro
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
ROS_DISTRO="${ROS_DISTRO:-jazzy}" ROS_DISTRO="${ROS_DISTRO:-lyrical}"
rosdep update --rosdistro "$ROS_DISTRO" >/dev/null 2>&1 || true rosdep update --rosdistro "$ROS_DISTRO" >/dev/null 2>&1 || true
rosdep keys --from-paths src --ignore-src --rosdistro "$ROS_DISTRO" 2>/dev/null \ rosdep keys --from-paths src --ignore-src --rosdistro "$ROS_DISTRO" 2>/dev/null \
| xargs rosdep resolve --rosdistro "$ROS_DISTRO" 2>/dev/null \ | xargs rosdep resolve --rosdistro "$ROS_DISTRO" 2>/dev/null \
+2 -2
View File
@@ -3,7 +3,7 @@
# setup_upstream.sh — fetch the upstream sources agv_pro_ros2 depends on # setup_upstream.sh — fetch the upstream sources agv_pro_ros2 depends on
# and apply any required patches. # and apply any required patches.
# #
# Sources are declared in upstream.jazzy.repos and cloned under src/upstream/. # Sources are declared in upstream.lyrical.repos and cloned under src/upstream/.
# Patches in patches/ are applied idempotently (already-applied patches are # Patches in patches/ are applied idempotently (already-applied patches are
# silently skipped). # silently skipped).
# #
@@ -28,7 +28,7 @@ for repo_dir in src/upstream/*/; do
fi fi
done done
vcs import src/upstream < upstream.jazzy.repos vcs import src/upstream < upstream.lyrical.repos
echo "[setup_upstream] applying patches ..." echo "[setup_upstream] applying patches ..."
bash patches/apply_patches.sh bash patches/apply_patches.sh
@@ -29,21 +29,24 @@ add_executable(agv_pro_node
target_include_directories(agv_pro_node PUBLIC target_include_directories(agv_pro_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>) $<INSTALL_INTERFACE:include>
${serial_driver_INCLUDE_DIRS})
target_compile_features(agv_pro_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 target_compile_features(agv_pro_node PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
ament_target_dependencies(agv_pro_node # serial_driver only exports legacy ament_export_libraries variables, no
rclcpp # namespaced CMake target, so it must be linked via ${serial_driver_LIBRARIES}.
tf2 target_link_libraries(agv_pro_node
tf2_ros rclcpp::rclcpp
tf2_geometry_msgs tf2::tf2
std_msgs tf2_ros::tf2_ros
sensor_msgs tf2_geometry_msgs::tf2_geometry_msgs
geometry_msgs std_msgs::std_msgs
serial_driver sensor_msgs::sensor_msgs
nav_msgs geometry_msgs::geometry_msgs
agv_pro_msgs ${serial_driver_LIBRARIES}
nav_msgs::nav_msgs
agv_pro_msgs::agv_pro_msgs
) )
install(TARGETS agv_pro_node install(TARGETS agv_pro_node
@@ -11,7 +11,7 @@
#include <std_msgs/msg/float32.hpp> #include <std_msgs/msg/float32.hpp>
#include <sensor_msgs/msg/imu.hpp> #include <sensor_msgs/msg/imu.hpp>
#include <tf2_ros/transform_broadcaster.h> #include <tf2_ros/transform_broadcaster.h>
#include <tf2/LinearMath/Quaternion.h> #include <tf2/LinearMath/Quaternion.hpp>
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp> #include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <agv_pro_msgs/srv/set_digital_output.hpp> #include <agv_pro_msgs/srv/set_digital_output.hpp>
#include <agv_pro_msgs/srv/get_digital_input.hpp> #include <agv_pro_msgs/srv/get_digital_input.hpp>
@@ -208,7 +208,7 @@ private:
const std::shared_ptr<agv_pro_msgs::srv::SetLedMode::Request> request, const std::shared_ptr<agv_pro_msgs::srv::SetLedMode::Request> request,
std::shared_ptr<agv_pro_msgs::srv::SetLedMode::Response> response); std::shared_ptr<agv_pro_msgs::srv::SetLedMode::Response> response);
boost::asio::io_service io_; boost::asio::io_context io_;
std::unique_ptr<boost::asio::serial_port> serial_port_; std::unique_ptr<boost::asio::serial_port> serial_port_;
std::string frame_id_of_odometry_; std::string frame_id_of_odometry_;
@@ -67,7 +67,7 @@ std::vector<uint8_t> AGV_PRO::read_serial_response(
rclcpp::Duration timeout = rclcpp::Duration::from_seconds(timeout_sec); rclcpp::Duration timeout = rclcpp::Duration::from_seconds(timeout_sec);
while ((this->now() - start_time) < timeout) { while ((this->now() - start_time) < timeout) {
boost::asio::mutable_buffers_1 buf(&byte, 1); boost::asio::mutable_buffer buf(&byte, 1);
boost::system::error_code ec; boost::system::error_code ec;
size_t n = serial_port_->read_some(buf, ec); size_t n = serial_port_->read_some(buf, ec);
if (ec) { if (ec) {
@@ -95,7 +95,7 @@ std::vector<uint8_t> AGV_PRO::read_serial_response(
size_t total_read = 0; size_t total_read = 0;
while (total_read < remain_len && (this->now() - start_time) < timeout) { while (total_read < remain_len && (this->now() - start_time) < timeout) {
boost::asio::mutable_buffers_1 buf(&remain_buf[total_read], remain_len - total_read); boost::asio::mutable_buffer buf(&remain_buf[total_read], remain_len - total_read);
boost::system::error_code ec; boost::system::error_code ec;
size_t n = serial_port_->read_some(buf, ec); size_t n = serial_port_->read_some(buf, ec);
if (ec) { if (ec) {
@@ -13,7 +13,7 @@ find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED) find_package(std_msgs REQUIRED)
find_package(agv_pro_msgs REQUIRED) find_package(agv_pro_msgs REQUIRED)
find_package(tf2 REQUIRED) find_package(tf2 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system) find_package(Boost REQUIRED)
add_library(agv_pro_hardware SHARED add_library(agv_pro_hardware SHARED
src/agv_pro_hardware_interface.cpp src/agv_pro_hardware_interface.cpp
@@ -26,17 +26,17 @@ target_include_directories(agv_pro_hardware PUBLIC
target_compile_features(agv_pro_hardware PUBLIC c_std_99 cxx_std_17) target_compile_features(agv_pro_hardware PUBLIC c_std_99 cxx_std_17)
ament_target_dependencies(agv_pro_hardware target_link_libraries(agv_pro_hardware
rclcpp rclcpp::rclcpp
hardware_interface hardware_interface::hardware_interface
pluginlib pluginlib::pluginlib
sensor_msgs sensor_msgs::sensor_msgs
std_msgs std_msgs::std_msgs
agv_pro_msgs agv_pro_msgs::agv_pro_msgs
tf2 tf2::tf2
) )
target_link_libraries(agv_pro_hardware Boost::system) target_link_libraries(agv_pro_hardware Boost::boost)
pluginlib_export_plugin_description_file(hardware_interface agv_pro_hardware.xml) pluginlib_export_plugin_description_file(hardware_interface agv_pro_hardware.xml)
@@ -159,7 +159,7 @@ private:
size_t rr_idx_{3}; // physical Rear-Right size_t rr_idx_{3}; // physical Rear-Right
// ── Serial port ───────────────────────────────────────────────────────────── // ── Serial port ─────────────────────────────────────────────────────────────
boost::asio::io_service io_; boost::asio::io_context io_;
std::unique_ptr<boost::asio::serial_port> serial_port_; std::unique_ptr<boost::asio::serial_port> serial_port_;
// Protects all writes to the serial port (shared between write(), service // Protects all writes to the serial port (shared between write(), service
@@ -16,7 +16,7 @@
<depend>std_msgs</depend> <depend>std_msgs</depend>
<depend>agv_pro_msgs</depend> <depend>agv_pro_msgs</depend>
<depend>tf2</depend> <depend>tf2</depend>
<depend>libboost-dev</depend>
<export> <export>
<build_type>ament_cmake</build_type> <build_type>ament_cmake</build_type>
@@ -12,8 +12,8 @@
#include "pluginlib/class_list_macros.hpp" #include "pluginlib/class_list_macros.hpp"
#include "hardware_interface/types/hardware_interface_type_values.hpp" #include "hardware_interface/types/hardware_interface_type_values.hpp"
#include "tf2/LinearMath/Quaternion.h" #include "tf2/LinearMath/Quaternion.hpp"
#include "tf2/utils.h" #include "tf2/utils.hpp"
PLUGINLIB_EXPORT_CLASS( PLUGINLIB_EXPORT_CLASS(
agv_pro_hardware::AgvProHardwareInterface, agv_pro_hardware::AgvProHardwareInterface,
@@ -9,14 +9,14 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic) add_compile_options(-Wall -Wextra -Wpedantic)
endif() endif()
# Qt5 boilerplate options from http://doc.qt.io/qt-5/cmake-manual.html # Qt6 boilerplate options from https://doc.qt.io/qt-6/cmake-manual.html
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package(ament_cmake REQUIRED) find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED) find_package(geometry_msgs REQUIRED)
find_package(pluginlib REQUIRED) find_package(pluginlib REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets) find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
find_package(rclcpp REQUIRED) find_package(rclcpp REQUIRED)
find_package(rviz_common REQUIRED) find_package(rviz_common REQUIRED)
find_package(rviz_default_plugins REQUIRED) find_package(rviz_default_plugins REQUIRED)
@@ -41,7 +41,7 @@ add_library(${library_name} SHARED
set(dependencies set(dependencies
geometry_msgs geometry_msgs
pluginlib pluginlib
Qt5 Qt6
rclcpp rclcpp
rviz_common rviz_common
rviz_default_plugins rviz_default_plugins
@@ -49,19 +49,23 @@ set(dependencies
rviz_rendering rviz_rendering
) )
ament_target_dependencies(${library_name} target_link_libraries(${library_name}
${dependencies} geometry_msgs::geometry_msgs
pluginlib::pluginlib
Qt6::Core
Qt6::Gui
Qt6::Widgets
rclcpp::rclcpp
rviz_common::rviz_common
rviz_default_plugins::rviz_default_plugins
rviz_rendering::rviz_rendering
) )
target_include_directories(${library_name} PUBLIC target_include_directories(${library_name} PUBLIC
${Qt5Widgets_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS}
${OGRE_INCLUDE_DIRS} ${OGRE_INCLUDE_DIRS}
) )
target_link_libraries(${library_name}
rviz_common::rviz_common
)
# Causes the visibility macros to use dllexport rather than dllimport, # Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it. # which is appropriate when building the dll but not consuming it.
target_compile_definitions(${library_name} PRIVATE "RVIZ_DEFAULT_PLUGINS_BUILDING_LIBRARY") target_compile_definitions(${library_name} PRIVATE "RVIZ_DEFAULT_PLUGINS_BUILDING_LIBRARY")
@@ -8,7 +8,7 @@
<license>Apache-2.0</license> <license>Apache-2.0</license>
<buildtool_depend>ament_cmake</buildtool_depend> <buildtool_depend>ament_cmake</buildtool_depend>
<build_depend>qtbase5-dev</build_depend> <build_depend>qt6-base-dev</build_depend>
<depend>geometry_msgs</depend> <depend>geometry_msgs</depend>
<depend>pluginlib</depend> <depend>pluginlib</depend>
@@ -19,10 +19,10 @@
<depend>rviz_ogre_vendor</depend> <depend>rviz_ogre_vendor</depend>
<depend>rviz_rendering</depend> <depend>rviz_rendering</depend>
<exec_depend>libqt5-core</exec_depend> <exec_depend>libqt6-core</exec_depend>
<exec_depend>libqt5-gui</exec_depend> <exec_depend>libqt6-gui</exec_depend>
<exec_depend>libqt5-opengl</exec_depend> <exec_depend>libqt6-opengl</exec_depend>
<exec_depend>libqt5-widgets</exec_depend> <exec_depend>libqt6-widgets</exec_depend>
<test_depend>ament_lint_common</test_depend> <test_depend>ament_lint_common</test_depend>
<test_depend>ament_lint_auto</test_depend> <test_depend>ament_lint_auto</test_depend>
@@ -39,4 +39,8 @@ repositories:
type: git type: git
url: https://github.com/unitreerobotics/unilidar_sdk2.git url: https://github.com/unitreerobotics/unilidar_sdk2.git
version: 0e3c51f512e6b8ff60b8c32f160b412cb48445c2 version: 0e3c51f512e6b8ff60b8c32f160b412cb48445c2
transport_drivers:
type: git
url: https://github.com/ros-drivers/transport_drivers.git
version: 0af598879560099b1069f9ad03d99f10684279ea