23 Commits
Author SHA1 Message Date
Matthew Spencer 900d2de8b6 Update can poier up script 2026-12-02 12:46:37 +00:00
Matthew Spencer 179606910a Make the serial POWER_ON handshake optional in can_power_on.py
The serial base controller no longer powers the wheel servos now that the
wheels are on the external USB-CAN adapter, so GET_POWER/POWER_ON guards
nothing. With an unresponsive ESP32 it cost ~70 s of timeouts on every boot
before the script gave up and assumed power anyway.

Add --serial-handshake {true,false} (default true, unchanged). With false,
the serial port is still opened once, bounded to 5 s, so DTR/RTS are cleared
before the CAN link comes up, then CAN is brought up immediately.
2026-11-05 13:28:32 +00:00
Matt Spencer e2285c46f0 Harden base bring-up against CH340 control-transfer timeouts
The CH340 behind /dev/agvpro_controller rejects USB control transfers for up
to ~60s after a host reboot (kernel: "failed to send control message: -110"),
surfacing as TimeoutError from the TIOCMSET ioctl that clears DTR/RTS. Since
clearing DTR/RTS is what releases the ESP32's reset line, a single failed
attempt leaves the ESP32 held in reset and all its sensors silent.

can_power_on.py:
- open_serial_when_ready(): retry the open with backoff (60s budget) instead
  of dying on the first timeout. open_serial() now closes the fd if setup
  fails partway.
- try_power_on(): report success only when servo power is actually confirmed.
  Previously every failure path returned True ("assuming powered"), so a
  GET_POWER status of 0 followed by an unanswered POWER_ON still counted as
  success and the stack continued with the wheels unpowered.
- Retry the handshake 5 times before falling back to the permissive
  behaviour, and log loudly when it does.
- Never let a dead serial port block CAN bring-up. The wheel drives are on
  CAN and are not powered by this board, so a dead ESP32 must only cost
  IMU/voltage/IO/LED -- never the ability to drive.
- bring_up_can(): set the link down first so it is idempotent. The bitrate
  cannot be set on an already-UP link, so any restart where the link was
  still up aborted the launch and crash-looped the base stack.

agv_pro_hardware_interface.cpp:
- disable_dtr_rts(): retry briefly (2s budget), then continue rather than
  give up instantly. This runs in on_activate after AgvProWheelsSystem is
  already active, so a long block here starves the wheel read cycle until it
  errors out and the controllers lose their interfaces -- hence the small
  budget. can_power_on.py has normally already released the ESP32 by then.
2026-10-26 07:22:04 -07:00
Matt Spencer 8b0d1c363d Update wheel configuration in URDF 2026-10-20 14:01:10 -07:00
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
30 changed files with 1021 additions and 252 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
+80 -3
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"
@@ -28,12 +104,13 @@ package, after empirically confirming real CAN communication with the wheel driv
to confirm it applies the same convention end-to-end. to confirm it applies the same convention end-to-end.
- [ ] Determine real `gear_ratio` (currently 1.0 placeholder) from the drivetrain so - [ ] Determine real `gear_ratio` (currently 1.0 placeholder) from the drivetrain so
commanded/measured velocity is in correct SI units at the wheel. commanded/measured velocity is in correct SI units at the wheel.
- [ ] Tune `kp`/`kd` velocity-mode gains (currently placeholder `kp=0.0 kd=0.8`) for the - [ ] Finish tuning `kp`/`kd` velocity-mode gains for the real mecanum drivetrain.
real mecanum drivetrain. `kp=0.0 kd=2.0` could not sustain a continuous in-place yaw against scrub friction;
`kd=3.5` is the next live-test value (RS01 maximum is 5.0).
- [ ] 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) {
@@ -15,6 +15,7 @@ stay in sync if the firmware protocol ever changes.
""" """
import argparse import argparse
import fcntl import fcntl
import json
import os import os
import re import re
import struct import struct
@@ -26,6 +27,16 @@ import time
CMD_POWER_ON = 0x10 CMD_POWER_ON = 0x10
CMD_GET_POWER = 0x12 CMD_GET_POWER = 0x12
# After a host reboot the CH340 rejects control transfers (TIOCMSET -> ETIMEDOUT,
# kernel logs "failed to send control message: -110") for up to ~60s while the
# ESP32 behind it is still coming up. Observed window was ~44s. Exceeding this
# budget is non-fatal -- see main().
SERIAL_READY_TIMEOUT = 60.0
POWER_ON_ATTEMPTS = 5
# Without the handshake the serial port is only opened to release the ESP32 reset line,
# so don't hold up CAN bring-up for the full post-reboot CH340 window.
NO_HANDSHAKE_SERIAL_TIMEOUT = 5.0
def crc16_ibm(data: bytes) -> int: def crc16_ibm(data: bytes) -> int:
crc = 0xFFFF crc = 0xFFFF
@@ -84,81 +95,151 @@ def read_response(fd: int, expected_header: bytes, payload_size: int, timeout: f
def open_serial(port_name: str) -> int: def open_serial(port_name: str) -> int:
fd = os.open(port_name, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) fd = os.open(port_name, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
attrs = termios.tcgetattr(fd) try:
# iflag, oflag, cflag, lflag, ispeed, ospeed, cc attrs = termios.tcgetattr(fd)
attrs[0] = 0 # iflag, oflag, cflag, lflag, ispeed, ospeed, cc
attrs[1] = 0 attrs[0] = 0
attrs[2] = termios.CS8 | termios.CREAD | termios.CLOCAL attrs[1] = 0
attrs[3] = 0 attrs[2] = termios.CS8 | termios.CREAD | termios.CLOCAL
attrs[4] = termios.B1000000 attrs[3] = 0
attrs[5] = termios.B1000000 attrs[4] = termios.B1000000
termios.tcsetattr(fd, termios.TCSANOW, attrs) attrs[5] = termios.B1000000
termios.tcflush(fd, termios.TCIOFLUSH) termios.tcsetattr(fd, termios.TCSANOW, attrs)
termios.tcflush(fd, termios.TCIOFLUSH)
# disable_dtr_rts(): release the ESP32 reset line # disable_dtr_rts(): release the ESP32 reset line
status = struct.unpack('i', fcntl.ioctl(fd, termios.TIOCMGET, struct.pack('i', 0)))[0] status = struct.unpack('i', fcntl.ioctl(fd, termios.TIOCMGET, struct.pack('i', 0)))[0]
status &= ~(termios.TIOCM_DTR | termios.TIOCM_RTS) status &= ~(termios.TIOCM_DTR | termios.TIOCM_RTS)
fcntl.ioctl(fd, termios.TIOCMSET, struct.pack('i', status)) fcntl.ioctl(fd, termios.TIOCMSET, struct.pack('i', status))
except Exception:
os.close(fd)
raise
return fd return fd
def open_serial_when_ready(port_name: str, timeout: float = SERIAL_READY_TIMEOUT) -> int:
deadline = time.time() + timeout
delay = 1.0
while True:
try:
return open_serial(port_name)
except (OSError, termios.error) as exc:
if time.time() >= deadline:
raise
print(f"WARNING: {port_name} not ready yet ({exc}); retrying in {delay:.0f}s",
file=sys.stderr)
time.sleep(delay)
delay = min(delay * 2.0, 5.0)
def try_power_on(fd: int) -> bool:
"""One GET_POWER/POWER_ON round trip. True only if power is actually confirmed."""
termios.tcflush(fd, termios.TCIFLUSH)
os.write(fd, build_frame(CMD_GET_POWER))
resp = read_response(fd, bytes([0xFE, 0xFE, 0x0B, CMD_GET_POWER]), 8, 12.0)
if len(resp) != 14:
print("WARNING: no response to GET_POWER query", file=sys.stderr)
return False
if struct.unpack('>H', resp[12:14])[0] != crc16_ibm(resp[:12]):
print("WARNING: CRC mismatch in GET_POWER response", file=sys.stderr)
return False
state = struct.unpack('b', resp[4:5])[0]
print(f"GET_POWER status: {state}")
if state != 0:
print(f"Motors already on (status={state})")
return True
on_cmd = build_frame(CMD_POWER_ON)
os.write(fd, on_cmd)
time.sleep(1.0)
# Mirrors C++ send_and_receive(): writes the command again right before
# reading the response (the firmware only replies to this second send).
os.write(fd, on_cmd)
on_resp = read_response(fd, bytes([0xFE, 0xFE, 0x0B, CMD_POWER_ON]), 8, 5.0)
if len(on_resp) != 14:
print("WARNING: no response to POWER_ON command", file=sys.stderr)
return False
if struct.unpack('>H', on_resp[12:14])[0] != crc16_ibm(on_resp[:12]):
print("WARNING: CRC mismatch in POWER_ON response", file=sys.stderr)
return False
ps = struct.unpack('b', on_resp[4:5])[0]
if ps == 1:
print("Motors powered on successfully")
return True
print(f"WARNING: firmware error code {ps}", file=sys.stderr)
return False
def power_on(port_name: str) -> bool: def power_on(port_name: str) -> bool:
# The serial base controller no longer controls servo power at all once the wheel # The serial base controller no longer controls servo power at all once the wheel
# CAN bus has been rewired to the external USB-CAN adapter, so this handshake isn't # CAN bus has been rewired to the external USB-CAN adapter, so this handshake isn't
# authoritative any more -- treat any failure/non-response as a warning and assume # authoritative any more -- after exhausting the retries below we still assume the
# the servos are already powered, rather than blocking CAN bring-up on it. # servos are powered rather than blocking CAN bring-up forever.
fd = open_serial(port_name) fd = open_serial_when_ready(port_name)
try: try:
print("Waiting 3s for ESP32 to initialise...") print("Waiting 3s for ESP32 to initialise...")
time.sleep(3.0) time.sleep(3.0)
os.write(fd, build_frame(CMD_GET_POWER)) for attempt in range(1, POWER_ON_ATTEMPTS + 1):
resp = read_response(fd, bytes([0xFE, 0xFE, 0x0B, CMD_GET_POWER]), 8, 12.0) print(f"Power-on handshake attempt {attempt}/{POWER_ON_ATTEMPTS}")
if len(resp) != 14: if try_power_on(fd):
print("WARNING: no response to GET_POWER query - assuming powered", file=sys.stderr) return True
return True time.sleep(2.0)
if struct.unpack('>H', resp[12:14])[0] != crc16_ibm(resp[:12]):
print("WARNING: CRC mismatch in GET_POWER response - assuming powered",
file=sys.stderr)
return True
state = struct.unpack('b', resp[4:5])[0]
print(f"GET_POWER status: {state}")
if state == 0: print(f"WARNING: servo power NOT confirmed after {POWER_ON_ATTEMPTS} attempts - "
on_cmd = build_frame(CMD_POWER_ON) "assuming powered; expect no wheel traffic if the base is really off",
os.write(fd, on_cmd) file=sys.stderr)
time.sleep(1.0)
# Mirrors C++ send_and_receive(): writes the command again right before
# reading the response (the firmware only replies to this second send).
os.write(fd, on_cmd)
on_resp = read_response(fd, bytes([0xFE, 0xFE, 0x0B, CMD_POWER_ON]), 8, 5.0)
if len(on_resp) != 14:
print("WARNING: no response to POWER_ON command - assuming powered",
file=sys.stderr)
return True
if struct.unpack('>H', on_resp[12:14])[0] != crc16_ibm(on_resp[:12]):
print("WARNING: CRC mismatch in POWER_ON response - assuming powered",
file=sys.stderr)
return True
ps = struct.unpack('b', on_resp[4:5])[0]
if ps == 1:
print("Motors powered on successfully")
return True
print(f"WARNING: firmware error code {ps} - assuming powered", file=sys.stderr)
return True
print(f"Motors already on (status={state})")
return True return True
finally: finally:
os.close(fd) os.close(fd)
def release_esp32_reset(port_name: str) -> None:
"""Clear DTR/RTS (via open_serial) before CAN comes up, without any handshake."""
try:
os.close(open_serial_when_ready(port_name, NO_HANDSHAKE_SERIAL_TIMEOUT))
except (OSError, termios.error) as exc:
print(f"WARNING: could not open {port_name} to release the ESP32 ({exc}); "
"continuing to CAN bring-up", file=sys.stderr)
def can_link_already_up(interface: str) -> bool:
"""True if the link is already UP at 1 Mbit/s in normal mode.
The interface may be shared with another controller (the arm's CANopen stack
on the same adapter); taking it down here would drop that traffic.
"""
result = subprocess.run(["ip", "-details", "-json", "link", "show", interface],
capture_output=True, text=True)
if result.returncode != 0:
return False
try:
link = json.loads(result.stdout)[0]
info = link["linkinfo"]["info_data"]
return ("UP" in link.get("flags", [])
and info.get("bittiming", {}).get("bitrate") == 1000000
and "LISTEN-ONLY" not in info.get("ctrlmode", [])
and info.get("state") not in ("BUS-OFF", "STOPPED"))
except (ValueError, KeyError, IndexError):
return False
def bring_up_can(interface: str) -> bool: def bring_up_can(interface: str) -> bool:
if not re.match(r"^[a-zA-Z0-9_]+$", interface): if not re.match(r"^[a-zA-Z0-9_]+$", interface):
print(f"ERROR: refusing unsafe interface name '{interface}'", file=sys.stderr) print(f"ERROR: refusing unsafe interface name '{interface}'", file=sys.stderr)
return False return False
if can_link_already_up(interface):
print(f"CAN interface '{interface}' is already up at 1 Mbit/s; leaving it as is")
return True
print(f"Bringing up CAN interface '{interface}'...") print(f"Bringing up CAN interface '{interface}'...")
try: try:
# The link is often still UP from a previous run of this container, and the
# bitrate can't be set on a live link -- so force it down first, exactly as
# can-arm-up.service does. Without this, every restart fails here and the
# launch file refuses to start the whole base stack.
subprocess.run(["ip", "link", "set", interface, "down"], check=False)
subprocess.run(["ip", "link", "set", interface, "txqueuelen", "1000"], check=True) subprocess.run(["ip", "link", "set", interface, "txqueuelen", "1000"], check=True)
subprocess.run( subprocess.run(
["ip", "link", "set", interface, "up", "type", "can", "bitrate", "1000000"], ["ip", "link", "set", interface, "up", "type", "can", "bitrate", "1000000"],
@@ -174,11 +255,24 @@ def main() -> None:
ap = argparse.ArgumentParser() ap = argparse.ArgumentParser()
ap.add_argument("--port-name", default="/dev/agvpro_controller") ap.add_argument("--port-name", default="/dev/agvpro_controller")
ap.add_argument("--can-interface-name", default="can0") ap.add_argument("--can-interface-name", default="can0")
ap.add_argument("--serial-handshake", choices=["true", "false"], default="true",
help="false skips GET_POWER/POWER_ON (the serial board no longer controls "
"servo power) and only releases the ESP32 reset line")
args = ap.parse_args() args = ap.parse_args()
if not power_on(args.port_name): if args.serial_handshake == "false":
print("FATAL: serial power-on failed", file=sys.stderr) release_esp32_reset(args.port_name)
sys.exit(1) sys.exit(0 if bring_up_can(args.can_interface_name) else 1)
# The wheel drives sit on CAN and are NOT powered by this serial board, so a dead
# ESP32 link must only cost the base its IMU/voltage/IO/LED -- never its ability to
# drive. Bring the CAN link up regardless.
try:
power_on(args.port_name)
except (OSError, termios.error) as exc:
print(f"WARNING: serial power-on unavailable ({exc}); continuing to CAN bring-up "
"-- wheels will still work, ESP32 sensors will not", file=sys.stderr)
if not bring_up_can(args.can_interface_name): if not bring_up_can(args.can_interface_name):
sys.exit(1) sys.exit(1)
sys.exit(0) sys.exit(0)
@@ -142,9 +142,10 @@
flipped to -1 so a positive command consistently means "forward" on every wheel. flipped to -1 so a positive command consistently means "forward" on every wheel.
This assumes robstride_ros2's `direction` negates both command and feedback This assumes robstride_ros2's `direction` negates both command and feedback
consistently; not yet live-validated by commanding a wheel and watching it spin. consistently; not yet live-validated by commanding a wheel and watching it spin.
kp/kd and command_velocity_min/max are placeholder starting gains/limits — tune for mecanum_drive_controller only commands velocity, so Kp is zeroed automatically by
the real mecanum drivetrain. mecanum_drive_controller only commands velocity, so Kp the driver in velocity mode. Kd=2.0 could not sustain in-place rotation against
is zeroed automatically by the driver in velocity mode (see robstride_ros2 README). mecanum scrub friction during a continuous -0.4 rad/s yaw test; use 3.5 as the next
bounded tuning step. RS01 permits Kd up to 5.0.
--> -->
<xacro:include filename="$(find robstride_ros2_control)/description/robstride_motor_profiles.xacro"/> <xacro:include filename="$(find robstride_ros2_control)/description/robstride_motor_profiles.xacro"/>
@@ -158,22 +159,22 @@
<param name="feedback_timeout_ms">8000</param> <param name="feedback_timeout_ms">8000</param>
</hardware> </hardware>
<joint name="${prefix}front_left_wheel_joint"> <joint name="${prefix}front_left_wheel_joint">
<xacro:robstride_rs01_params can_id="1" direction="-1" kp="0.0" kd="0.8" <xacro:robstride_rs01_params can_id="1" direction="-1" kp="0.0" kd="3.5"
command_velocity_min="-30.0" command_velocity_max="30.0"/> command_velocity_min="-30.0" command_velocity_max="30.0"/>
<xacro:robstride_joint_interfaces/> <xacro:robstride_joint_interfaces/>
</joint> </joint>
<joint name="${prefix}front_right_wheel_joint"> <joint name="${prefix}front_right_wheel_joint">
<xacro:robstride_rs01_params can_id="2" direction="1" kp="0.0" kd="0.8" <xacro:robstride_rs01_params can_id="2" direction="1" kp="0.0" kd="3.5"
command_velocity_min="-30.0" command_velocity_max="30.0"/> command_velocity_min="-30.0" command_velocity_max="30.0"/>
<xacro:robstride_joint_interfaces/> <xacro:robstride_joint_interfaces/>
</joint> </joint>
<joint name="${prefix}rear_left_wheel_joint"> <joint name="${prefix}rear_left_wheel_joint">
<xacro:robstride_rs01_params can_id="3" direction="-1" kp="0.0" kd="0.8" <xacro:robstride_rs01_params can_id="3" direction="-1" kp="0.0" kd="3.5"
command_velocity_min="-30.0" command_velocity_max="30.0"/> command_velocity_min="-30.0" command_velocity_max="30.0"/>
<xacro:robstride_joint_interfaces/> <xacro:robstride_joint_interfaces/>
</joint> </joint>
<joint name="${prefix}rear_right_wheel_joint"> <joint name="${prefix}rear_right_wheel_joint">
<xacro:robstride_rs01_params can_id="4" direction="1" kp="0.0" kd="0.8" <xacro:robstride_rs01_params can_id="4" direction="1" kp="0.0" kd="3.5"
command_velocity_min="-30.0" command_velocity_max="30.0"/> command_velocity_min="-30.0" command_velocity_max="30.0"/>
<xacro:robstride_joint_interfaces/> <xacro:robstride_joint_interfaces/>
</joint> </joint>
@@ -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>
@@ -3,17 +3,20 @@
#include <poll.h> #include <poll.h>
#include <termios.h> #include <termios.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <algorithm>
#include <chrono>
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
#include <iomanip> #include <iomanip>
#include <regex> #include <regex>
#include <sstream> #include <sstream>
#include <stdexcept> #include <stdexcept>
#include <thread>
#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,
@@ -129,14 +132,39 @@ void AgvProHardwareInterface::clear_serial_buffer(int fd)
} }
} }
// Clearing DTR/RTS is what releases the ESP32's reset line, and the CH340 sometimes
// rejects the ioctl (kernel: "failed to send control message: -110").
//
// This runs inside on_activate, AFTER AgvProWheelsSystem is already active, so blocking
// here starves the wheel read cycle until it errors and gets deactivated -- which
// releases the interfaces the controllers need and fails the whole base stack. Keep the
// budget small and give up rather than stall: can_power_on.py has already opened the port
// and cleared these lines moments earlier, so the ESP32 is normally out of reset anyway.
void AgvProHardwareInterface::disable_dtr_rts(int fd) void AgvProHardwareInterface::disable_dtr_rts(int fd)
{ {
int status; constexpr std::chrono::milliseconds kBudget{2000};
if (::ioctl(fd, TIOCMGET, &status) == 0) { const auto deadline = std::chrono::steady_clock::now() + kBudget;
status &= ~(TIOCM_DTR | TIOCM_RTS); auto delay = std::chrono::milliseconds(100);
if (::ioctl(fd, TIOCMSET, &status) != 0) {
RCLCPP_WARN(get_logger(), "Failed to clear DTR/RTS: %s", std::strerror(errno)); for (;;) {
int status;
if (::ioctl(fd, TIOCMGET, &status) == 0) {
status &= ~(TIOCM_DTR | TIOCM_RTS);
if (::ioctl(fd, TIOCMSET, &status) == 0) {
return;
}
} }
if (std::chrono::steady_clock::now() >= deadline) {
RCLCPP_WARN(get_logger(),
"Failed to clear DTR/RTS within %ld ms: %s -- continuing anyway; if the ESP32 was "
"not already released by can_power_on.py, its IMU/voltage/IO will be unavailable",
static_cast<long>(kBudget.count()), std::strerror(errno));
return;
}
std::this_thread::sleep_for(delay);
delay = std::min(delay * 2, std::chrono::milliseconds(400));
} }
} }
@@ -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