Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ jobs:
ros-humble-nav-msgs \
ros-humble-sensor-msgs \
ros-humble-visualization-msgs \
ros-humble-std-msgs \
ros-humble-geometry-msgs \
ros-humble-tf2-ros \
ros-humble-tf2-geometry-msgs \
ros-humble-rclcpp-action \
ros-humble-launch-testing \
ros-humble-launch-testing-ament-cmake \
ros-humble-launch-testing-ros \
ros-humble-ament-lint-auto \
ros-humble-ament-lint-common \
ros-humble-ament-cmake-gtest \
python3-pip
pip3 install --no-cache-dir setuptools
shell: bash
Expand Down
49 changes: 29 additions & 20 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,47 @@ on:
branches: [main]

jobs:
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format-14

- name: Check formatting
run: |
find src/ -name '*.cpp' -o -name '*.hpp' | \
xargs clang-format-14 --dry-run --Werror
shell: bash

ament-lint:
runs-on: ubuntu-22.04
container:
image: osrf/ros:humble-ros-base
steps:
- uses: actions/checkout@v4

- name: Install lint tools
- name: Install dependencies
run: |
apt-get update
apt-get install -y python3-colcon-common-extensions \
ros-humble-ament-lint-auto ros-humble-ament-lint-common
apt-get install -y --no-install-recommends \
python3-colcon-common-extensions \
build-essential cmake \
ros-humble-nav-msgs \
ros-humble-sensor-msgs \
ros-humble-visualization-msgs \
ros-humble-std-msgs \
ros-humble-geometry-msgs \
ros-humble-tf2-ros \
ros-humble-tf2-geometry-msgs \
ros-humble-rclcpp-action \
ros-humble-ament-lint-auto \
ros-humble-ament-lint-common \
ros-humble-ament-cmake-gtest \
ros-humble-launch-testing \
ros-humble-launch-testing-ament-cmake \
ros-humble-launch-testing-ros \
python3-pip
pip3 install --no-cache-dir setuptools flake8 pep257
shell: bash

- name: Build all packages
run: |
source /opt/ros/humble/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
shell: bash

- name: Build & lint
- name: Run lint tests
run: |
source /opt/ros/humble/setup.bash
colcon build
colcon test --packages-select smooth_nav_tests
source install/setup.bash
colcon test --packages-select smooth_nav_core
colcon test-result --verbose
shell: bash
6 changes: 6 additions & 0 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ros-humble-tf2-ros \
ros-humble-tf2-geometry-msgs \
ros-humble-nav-msgs \
ros-humble-sensor-msgs \
ros-humble-visualization-msgs \
ros-humble-launch-testing \
ros-humble-launch-testing-ament-cmake \
ros-humble-launch-testing-ros \
python3-colcon-common-extensions \
python3-rosdep \
python3-pip \
build-essential \
cmake \
gdb \
Expand All @@ -33,6 +36,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
&& rm -rf /var/lib/apt/lists/*

# ── Python dependencies ──────────────────────────────────────
RUN pip3 install --no-cache-dir setuptools

# ── TurtleBot3 model ─────────────────────────────────────────
ENV TURTLEBOT3_MODEL=burger

Expand Down
3 changes: 3 additions & 0 deletions src/smooth_nav_bringup/launch/demo.launch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""
Demo launch — runs the full pipeline with a waypoint client that automatically
calls smooth → generate → execute services/actions.
Expand Down
3 changes: 3 additions & 0 deletions src/smooth_nav_bringup/launch/smooth_nav.launch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""
Master bringup launch — starts everything needed for the smooth_nav demo.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env python3
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""
safety_watchdog_node.py — Real-world safety layer for smooth_nav.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env python3
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""
waypoint_client_node.py — End-to-end pipeline orchestrator for smooth_nav.

Expand Down
3 changes: 3 additions & 0 deletions src/smooth_nav_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ install(DIRECTORY

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# Skip linters that require specific formatting style
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_uncrustify_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

Expand Down
7 changes: 4 additions & 3 deletions src/smooth_nav_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Launch the trajectory tracker controller node.
"""
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""Launch the trajectory tracker controller node."""

from launch import LaunchDescription
from launch_ros.actions import Node
Expand Down
17 changes: 10 additions & 7 deletions src/smooth_nav_controller/src/trajectory_tracker_node.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2026 smooth_nav Authors
// SPDX-License-Identifier: Apache-2.0

/**
* @file trajectory_tracker_node.cpp
* @brief ROS 2 action server — tracks a trajectory using Pure Pursuit + PID.
Expand Down Expand Up @@ -31,6 +34,13 @@
* - Diagnostics for live tuning in rqt_plot / PlotJuggler.
*/

#include <cmath>
#include <memory>
#include <mutex>
#include <numeric>
#include <string>
#include <vector>

#include <rclcpp/rclcpp.hpp>
#include <rclcpp_action/rclcpp_action.hpp>
#include <geometry_msgs/msg/twist.hpp>
Expand All @@ -47,13 +57,6 @@
#include "smooth_nav_core/controller/pure_pursuit_controller.hpp"
#include "smooth_nav_core/math/types.hpp"

#include <memory>
#include <mutex>
#include <string>
#include <vector>
#include <cmath>
#include <numeric>

namespace smooth_nav_controller
{

Expand Down
7 changes: 4 additions & 3 deletions src/smooth_nav_description/launch/display.launch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Launch robot state publisher + RViz for smooth_nav visualization.
"""
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""Launch robot state publisher + RViz for smooth_nav visualization."""

from launch import LaunchDescription
from launch_ros.actions import Node
Expand Down
4 changes: 4 additions & 0 deletions src/smooth_nav_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ install(DIRECTORY
# ─── Testing ─────────────────────────────────────────────────────────────
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# Skip linters that require specific formatting style
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_uncrustify_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

Expand Down
7 changes: 4 additions & 3 deletions src/smooth_nav_ros/launch/smooth_nav_ros.launch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Launch file for smooth_nav_ros service nodes (path smoother + trajectory generator).
"""
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""Launch smooth_nav_ros service nodes (path smoother + trajectory generator)."""

from launch import LaunchDescription
from launch_ros.actions import Node
Expand Down
15 changes: 9 additions & 6 deletions src/smooth_nav_ros/src/path_smoother_node.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2026 smooth_nav Authors
// SPDX-License-Identifier: Apache-2.0

/**
* @file path_smoother_node.cpp
* @brief ROS 2 service node wrapping smooth_nav_core path smoothers.
Expand Down Expand Up @@ -33,6 +36,12 @@
* - Thread-safe service callback (mutex around smoother)
*/

#include <cmath>
#include <memory>
#include <mutex>
#include <string>
#include <vector>

#include <rclcpp/rclcpp.hpp>
#include <nav_msgs/msg/path.hpp>
#include <geometry_msgs/msg/pose_stamped.hpp>
Expand All @@ -45,12 +54,6 @@
#include "smooth_nav_core/path_smoother/smoother_factory.hpp"
#include "smooth_nav_core/path_smoother/bspline_smoother.hpp"

#include <memory>
#include <vector>
#include <string>
#include <cmath>
#include <mutex>

namespace smooth_nav_ros
{

Expand Down
15 changes: 9 additions & 6 deletions src/smooth_nav_ros/src/trajectory_generator_node.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2026 smooth_nav Authors
// SPDX-License-Identifier: Apache-2.0

/**
* @file trajectory_generator_node.cpp
* @brief ROS 2 service node — converts smoothed paths into time-parameterised trajectories.
Expand All @@ -21,6 +24,12 @@
* - Trajectory visualisation for debugging velocity profiles
*/

#include <cmath>
#include <memory>
#include <mutex>
#include <string>
#include <vector>

#include <rclcpp/rclcpp.hpp>
#include <nav_msgs/msg/path.hpp>
#include <geometry_msgs/msg/pose_stamped.hpp>
Expand All @@ -35,12 +44,6 @@
#include "smooth_nav_core/trajectory_generator/i_trajectory_generator.hpp"
#include "smooth_nav_core/math/types.hpp"

#include <memory>
#include <string>
#include <vector>
#include <cmath>
#include <mutex>

namespace smooth_nav_ros
{

Expand Down
3 changes: 3 additions & 0 deletions src/smooth_nav_simulation/launch/gazebo.launch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2026 smooth_nav Authors
# SPDX-License-Identifier: Apache-2.0

"""
Launch Gazebo with TurtleBot3 for smooth_nav simulation.

Expand Down
4 changes: 4 additions & 0 deletions src/smooth_nav_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ if(BUILD_TESTING)
find_package(nav_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)

# Skip linters that require specific formatting style
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_uncrustify_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()

# Integration test: path smoother service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
// Copyright 2026 smooth_nav Authors
// SPDX-License-Identifier: Apache-2.0

/**
* @file test_generator_service.cpp
* @brief Integration test — verifies the /trajectory_generator/generate_trajectory
* service responds correctly given a smoothed path.
*/

#include <chrono>
#include <cmath>

#include <gtest/gtest.h>
#include <rclcpp/rclcpp.hpp>

#include <smooth_nav_msgs/srv/generate_trajectory.hpp>
#include <smooth_nav_msgs/msg/smoothed_path.hpp>
#include <geometry_msgs/msg/point.hpp>
#include <chrono>
#include <cmath>

using namespace std::chrono_literals;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2026 smooth_nav Authors
// SPDX-License-Identifier: Apache-2.0

/**
* @file test_smoother_service.cpp
* @brief Integration test — verifies the /path_smoother/smooth_path service.
Expand All @@ -6,12 +9,14 @@
* response contains a valid smoothed path with more points than input.
*/

#include <chrono>
#include <memory>

#include <gtest/gtest.h>
#include <rclcpp/rclcpp.hpp>

#include <smooth_nav_msgs/srv/smooth_path.hpp>
#include <smooth_nav_msgs/msg/waypoint.hpp>
#include <chrono>
#include <memory>

using namespace std::chrono_literals;

Expand Down
9 changes: 7 additions & 2 deletions src/smooth_nav_tests/test/integration/test_tracker_action.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2026 smooth_nav Authors
// SPDX-License-Identifier: Apache-2.0

/**
* @file test_tracker_action.cpp
* @brief Integration test — verifies the ExecuteTrajectory action server.
Expand All @@ -6,15 +9,17 @@
* that feedback is received and the action completes.
*/

#include <chrono>
#include <cmath>

#include <gtest/gtest.h>
#include <rclcpp/rclcpp.hpp>
#include <rclcpp_action/rclcpp_action.hpp>

#include <smooth_nav_msgs/action/execute_trajectory.hpp>
#include <smooth_nav_msgs/msg/trajectory.hpp>
#include <smooth_nav_msgs/msg/trajectory_point.hpp>
#include <nav_msgs/msg/odometry.hpp>
#include <chrono>
#include <cmath>

using namespace std::chrono_literals;
using ExecuteTrajectory = smooth_nav_msgs::action::ExecuteTrajectory;
Expand Down
Loading