Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b663955
initial unorganized prototype
SteveMacenski May 27, 2025
821004d
break out files and add doxygen
SteveMacenski May 27, 2025
1e1f939
Adding refactor for nav2_ros_common and new ROS interface factories
SteveMacenski Jun 20, 2025
6ac5217
fix merge conflicts
SteveMacenski Jun 20, 2025
957f27f
fixing CI - not sure how that got through merge conflicts
SteveMacenski Jun 20, 2025
626b363
Lifecycle publisher a missing test
SteveMacenski Jun 20, 2025
8794c03
system tests
SteveMacenski Jun 20, 2025
a4511b9
default
SteveMacenski Jun 20, 2025
08b419a
activating publishers
SteveMacenski Jun 21, 2025
f7f4cf2
temp disable allow param qos overrides
SteveMacenski Jun 21, 2025
d2efa25
API update for new constructor option
SteveMacenski Jun 21, 2025
4dce839
Supporting Jazzy and abstracting util
SteveMacenski Jun 23, 2025
594f225
Review round 1
SteveMacenski Jun 23, 2025
84e0c50
Adding Nav2 Publisher and Subscriber objects to later build upon
SteveMacenski Jun 23, 2025
fc1aa84
Adding additional ::SharedPtr for readability
SteveMacenski Jun 23, 2025
b138e1b
fix bug
SteveMacenski Jun 23, 2025
828d348
fixing Jazzy support
SteveMacenski Jun 23, 2025
171a7ea
missed one last spot
SteveMacenski Jun 23, 2025
a5a01e1
Adding migration instructions
SteveMacenski Jun 23, 2025
81fb49a
more context
SteveMacenski Jun 23, 2025
c5d2fcf
Adding migration context
SteveMacenski Jun 23, 2025
82a5b8e
precommit
SteveMacenski Jun 23, 2025
be9c6c1
adding missing dep
SteveMacenski Jun 24, 2025
57d3597
Updating system tess
SteveMacenski Jun 24, 2025
217d964
more
SteveMacenski Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ _commands:
- restore_cache:
name: Restore Cache << parameters.key >>
keys:
- "<< parameters.key >>-v35\
- "<< parameters.key >>-v36\
-{{ arch }}\
-{{ .Branch }}\
-{{ .Environment.CIRCLE_PR_NUMBER }}\
-{{ checksum \"<< parameters.workspace >>/lockfile.txt\" }}"
- "<< parameters.key >>-v35\
- "<< parameters.key >>-v36\
-{{ arch }}\
-main\
-<no value>\
Expand All @@ -58,7 +58,7 @@ _commands:
steps:
- save_cache:
name: Save Cache << parameters.key >>
key: "<< parameters.key >>-v35\
key: "<< parameters.key >>-v36\
-{{ arch }}\
-{{ .Branch }}\
-{{ .Environment.CIRCLE_PR_NUMBER }}\
Expand Down
20 changes: 14 additions & 6 deletions nav2_amcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ find_package(std_srvs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(nav2_ros_common REQUIRED)

nav2_package()

Expand All @@ -38,7 +39,8 @@ add_library(pf_lib SHARED
target_include_directories(pf_lib
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
"$<BUILD_INTERFACE:${nav2_ros_common_INCLUDE_DIRS}>")
if(HAVE_DRAND48)
target_compile_definitions(pf_lib PRIVATE "HAVE_DRAND48")
endif()
Expand All @@ -52,7 +54,8 @@ add_library(map_lib SHARED
target_include_directories(map_lib
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
"$<BUILD_INTERFACE:${nav2_ros_common_INCLUDE_DIRS}>")

add_library(motions_lib SHARED
src/motion_model/omni_motion_model.cpp
Expand All @@ -61,7 +64,8 @@ add_library(motions_lib SHARED
target_include_directories(motions_lib
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
"$<BUILD_INTERFACE:${nav2_ros_common_INCLUDE_DIRS}>")
target_link_libraries(motions_lib PUBLIC
pf_lib
pluginlib::pluginlib
Expand All @@ -77,7 +81,8 @@ add_library(sensors_lib SHARED
target_include_directories(sensors_lib
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
"$<BUILD_INTERFACE:${nav2_ros_common_INCLUDE_DIRS}>")
target_link_libraries(sensors_lib PUBLIC
pf_lib
map_lib
Expand All @@ -96,7 +101,8 @@ endif()
target_include_directories(${library_name}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
"$<BUILD_INTERFACE:${nav2_ros_common_INCLUDE_DIRS}>")
target_link_libraries(${library_name} PUBLIC
${geometry_msgs_TARGETS}
message_filters::message_filters
Expand All @@ -123,7 +129,8 @@ add_executable(${executable_name}
target_include_directories(${executable_name}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
"$<BUILD_INTERFACE:${nav2_ros_common_INCLUDE_DIRS}>")
target_link_libraries(${executable_name} PRIVATE
${library_name}
)
Expand Down Expand Up @@ -169,6 +176,7 @@ ament_export_dependencies(
std_srvs
tf2
tf2_ros
nav2_ros_common
)
ament_export_targets(${library_name})
pluginlib_export_plugin_description_file(nav2_amcl plugins.xml)
Expand Down
30 changes: 14 additions & 16 deletions nav2_amcl/include/nav2_amcl/amcl_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "rclcpp/version.h"

#include "geometry_msgs/msg/pose_stamped.hpp"
#include "nav2_util/lifecycle_node.hpp"
#include "nav2_ros_common/lifecycle_node.hpp"
#include "nav2_amcl/motion_model/motion_model.hpp"
#include "nav2_amcl/sensors/laser/laser.hpp"
#include "nav2_msgs/msg/particle.hpp"
Expand All @@ -42,7 +42,7 @@
#include "pluginlib/class_loader.hpp"
#include "rclcpp/node_options.hpp"
#include "sensor_msgs/msg/laser_scan.hpp"
#include "nav2_util/service_server.hpp"
#include "nav2_ros_common/service_server.hpp"
#include "std_srvs/srv/empty.hpp"
#include "tf2_ros/message_filter.h"
#include "tf2_ros/transform_broadcaster.h"
Expand All @@ -56,7 +56,7 @@ namespace nav2_amcl
* @class AmclNode
* @brief ROS wrapper for AMCL
*/
class AmclNode : public nav2_util::LifecycleNode
class AmclNode : public nav2::LifecycleNode
{
public:
/*
Expand All @@ -73,23 +73,23 @@ class AmclNode : public nav2_util::LifecycleNode
/*
* @brief Lifecycle configure
*/
nav2_util::CallbackReturn on_configure(const rclcpp_lifecycle::State & state) override;
nav2::CallbackReturn on_configure(const rclcpp_lifecycle::State & state) override;
/*
* @brief Lifecycle activate
*/
nav2_util::CallbackReturn on_activate(const rclcpp_lifecycle::State & state) override;
nav2::CallbackReturn on_activate(const rclcpp_lifecycle::State & state) override;
/*
* @brief Lifecycle deactivate
*/
nav2_util::CallbackReturn on_deactivate(const rclcpp_lifecycle::State & state) override;
nav2::CallbackReturn on_deactivate(const rclcpp_lifecycle::State & state) override;
/*
* @brief Lifecycle cleanup
*/
nav2_util::CallbackReturn on_cleanup(const rclcpp_lifecycle::State & state) override;
nav2::CallbackReturn on_cleanup(const rclcpp_lifecycle::State & state) override;
/*
* @brief Lifecycle shutdown
*/
nav2_util::CallbackReturn on_shutdown(const rclcpp_lifecycle::State & state) override;
nav2::CallbackReturn on_shutdown(const rclcpp_lifecycle::State & state) override;

/**
* @brief Callback executed when a parameter change is detected
Expand All @@ -109,7 +109,7 @@ class AmclNode : public nav2_util::LifecycleNode
// in order to isolate TF timer used in message filter.
rclcpp::CallbackGroup::SharedPtr callback_group_;
rclcpp::executors::SingleThreadedExecutor::SharedPtr executor_;
std::unique_ptr<nav2_util::NodeThread> executor_thread_;
std::unique_ptr<nav2::NodeThread> executor_thread_;

// Pose hypothesis
typedef struct
Expand Down Expand Up @@ -178,8 +178,9 @@ class AmclNode : public nav2_util::LifecycleNode
std::unique_ptr<message_filters::Subscriber<sensor_msgs::msg::LaserScan>> laser_scan_sub_;
#else
std::unique_ptr<message_filters::Subscriber<sensor_msgs::msg::LaserScan,
rclcpp_lifecycle::LifecycleNode>> laser_scan_sub_;
nav2::LifecycleNode>> laser_scan_sub_;
#endif

std::unique_ptr<tf2_ros::MessageFilter<sensor_msgs::msg::LaserScan>> laser_scan_filter_;
message_filters::Connection laser_scan_connection_;

Expand Down Expand Up @@ -208,8 +209,7 @@ class AmclNode : public nav2_util::LifecycleNode
* @brief Initialize state services
*/
void initServices();
nav2_util::ServiceServer<std_srvs::srv::Empty,
std::shared_ptr<nav2_util::LifecycleNode>>::SharedPtr global_loc_srv_;
nav2::ServiceServer<std_srvs::srv::Empty>::SharedPtr global_loc_srv_;
/*
* @brief Service callback for a global relocalization request
*/
Expand All @@ -219,8 +219,7 @@ class AmclNode : public nav2_util::LifecycleNode
std::shared_ptr<std_srvs::srv::Empty::Response> response);

// service server for providing an initial pose guess
nav2_util::ServiceServer<nav2_msgs::srv::SetInitialPose,
std::shared_ptr<nav2_util::LifecycleNode>>::SharedPtr initial_guess_srv_;
nav2::ServiceServer<nav2_msgs::srv::SetInitialPose>::SharedPtr initial_guess_srv_;
/*
* @brief Service callback for an initial pose guess request
*/
Expand All @@ -230,8 +229,7 @@ class AmclNode : public nav2_util::LifecycleNode
std::shared_ptr<nav2_msgs::srv::SetInitialPose::Response> response);

// Let amcl update samples without requiring motion
nav2_util::ServiceServer<std_srvs::srv::Empty,
std::shared_ptr<nav2_util::LifecycleNode>>::SharedPtr nomotion_update_srv_;
nav2::ServiceServer<std_srvs::srv::Empty>::SharedPtr nomotion_update_srv_;
/*
* @brief Request an AMCL update even though the robot hasn't moved
*/
Expand Down
1 change: 1 addition & 0 deletions nav2_amcl/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<depend>tf2</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tf2_ros</depend>
<depend>nav2_ros_common</depend>

<test_depend>ament_lint_common</test_depend>
<test_depend>ament_lint_auto</test_depend>
Expand Down
Loading
Loading