Skip to content
Open
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
12 changes: 6 additions & 6 deletions nav2_amcl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.20)
Comment thread
SteveMacenski marked this conversation as resolved.
project(nav2_amcl)

find_package(ament_cmake REQUIRED)
Expand Down Expand Up @@ -104,20 +104,20 @@ target_include_directories(${library_name}
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
target_link_libraries(${library_name} PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
message_filters::message_filters
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
${sensor_msgs_TARGETS}
${std_srvs_TARGETS}
sensor_msgs::sensor_msgs
std_srvs::std_srvs
pluginlib::pluginlib
sensors_lib
rclcpp::rclcpp
rclcpp_lifecycle::rclcpp_lifecycle
${nav_msgs_TARGETS}
nav_msgs::nav_msgs
tf2_ros::tf2_ros
tf2::tf2
${nav2_msgs_TARGETS}
nav2_msgs::nav2_msgs
)
target_link_libraries(${library_name} PRIVATE
rclcpp_components::component
Expand Down
24 changes: 12 additions & 12 deletions nav2_behavior_tree/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.20)
project(nav2_behavior_tree CXX)

find_package(ament_cmake REQUIRED)
Expand Down Expand Up @@ -32,17 +32,17 @@ target_include_directories(${library_name}
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
target_link_libraries(${library_name} PUBLIC
${action_msgs_TARGETS}
action_msgs::action_msgs
behaviortree_cpp::behaviortree_cpp
${geometry_msgs_TARGETS}
${nav_msgs_TARGETS}
${nav2_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav_msgs::nav_msgs
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
rclcpp::rclcpp
rclcpp_action::rclcpp_action
rclcpp_lifecycle::rclcpp_lifecycle
${sensor_msgs_TARGETS}
sensor_msgs::sensor_msgs
tf2::tf2
tf2_ros::tf2_ros
nav2_ros_common::nav2_ros_common
Expand Down Expand Up @@ -283,18 +283,18 @@ foreach(bt_plugin ${plugin_libs})
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
target_link_libraries(${bt_plugin} PUBLIC
behaviortree_cpp::behaviortree_cpp
${geometry_msgs_TARGETS}
${nav_msgs_TARGETS}
${nav2_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav_msgs::nav_msgs
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
rclcpp::rclcpp
rclcpp_action::rclcpp_action
rclcpp_lifecycle::rclcpp_lifecycle
${sensor_msgs_TARGETS}
sensor_msgs::sensor_msgs
tf2::tf2
tf2_ros::tf2_ros
${std_msgs_TARGETS}
${std_srvs_TARGETS}
std_msgs::std_msgs
std_srvs::std_srvs
nav2_ros_common::nav2_ros_common
)
target_compile_definitions(${bt_plugin} PRIVATE BT_PLUGIN_EXPORT)
Expand Down
2 changes: 1 addition & 1 deletion nav2_behavior_tree/plugins/action/follow_path_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void FollowPathAction::on_wait_for_result(
getInput("path", new_path);

// Check if it is not same with the current one
if (goal_.path != new_path && new_path != nav_msgs::msg::Path()) {
if (goal_.path != new_path && !new_path.poses.empty()) {
Comment thread
SteveMacenski marked this conversation as resolved.

@SteveMacenski SteveMacenski Jun 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are actually not the same thing since there is a possibility to have an empty, but "populated" path with no poses. Checking the constructor is to check if there was never a new path in the first place, not simply that its empty.

I know this was to fix a compilation issue, but perhaps we could just change this to:

nav_msgs::msg::Path initialized_path;
if (goal_.path != new_path && new_path != initialized_path) {

I however, don't actually feel that strongly about it. Its just a potential subtle bug that could happen in some situations I'm trying to avoid.

// the action server on the next loop iteration
goal_.path = new_path;
goal_updated_ = true;
Expand Down
6 changes: 3 additions & 3 deletions nav2_behavior_tree/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
nav2_add_gtest(test_bt_utils test_bt_utils.cpp)
target_link_libraries(test_bt_utils
${library_name}
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
)

nav2_add_gtest(test_json_utils test_json_utils.cpp)
target_link_libraries(test_json_utils
${library_name}
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
)

nav2_add_gtest(test_loop_rate test_loop_rate.cpp)
Expand All @@ -19,7 +19,7 @@ target_link_libraries(test_loop_rate
function(plugin_add_test target filename plugin)
nav2_add_gtest(${target} ${filename})
target_link_libraries(${target}
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_util::nav2_util_core
behaviortree_cpp::behaviortree_cpp
${library_name}
Expand Down
2 changes: 1 addition & 1 deletion nav2_behavior_tree/test/plugins/action/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
find_package(test_msgs REQUIRED)

nav2_add_gtest(test_bt_action_node test_bt_action_node.cpp)
target_link_libraries(test_bt_action_node rclcpp::rclcpp ${test_msgs_TARGETS} rclcpp_action::rclcpp_action ${library_name})
target_link_libraries(test_bt_action_node rclcpp::rclcpp test_msgs::test_msgs rclcpp_action::rclcpp_action ${library_name})

plugin_add_test(test_action_spin_action test_spin_action.cpp nav2_spin_action_bt_node)

Expand Down
24 changes: 12 additions & 12 deletions nav2_behaviors/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.20)
project(nav2_behaviors)

find_package(ament_cmake REQUIRED)
Expand Down Expand Up @@ -34,11 +34,11 @@ target_include_directories(nav2_spin_behavior
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(nav2_spin_behavior PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_core::nav2_core
nav2_costmap_2d::nav2_costmap_2d_client
nav2_costmap_2d::nav2_costmap_2d_core
${nav2_msgs_TARGETS}
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
rclcpp::rclcpp
Expand All @@ -60,10 +60,10 @@ target_include_directories(nav2_wait_behavior
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(nav2_wait_behavior PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_core::nav2_core
nav2_costmap_2d::nav2_costmap_2d_core
${nav2_msgs_TARGETS}
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
rclcpp::rclcpp
Expand All @@ -81,10 +81,10 @@ target_include_directories(nav2_drive_on_heading_behavior
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(nav2_drive_on_heading_behavior PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_core::nav2_core
nav2_costmap_2d::nav2_costmap_2d_core
${nav2_msgs_TARGETS}
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
rclcpp::rclcpp
Expand All @@ -105,10 +105,10 @@ target_include_directories(nav2_back_up_behavior
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(nav2_back_up_behavior PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_core::nav2_core
nav2_costmap_2d::nav2_costmap_2d_core
${nav2_msgs_TARGETS}
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
rclcpp::rclcpp
Expand All @@ -129,15 +129,15 @@ target_include_directories(nav2_assisted_teleop_behavior
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(nav2_assisted_teleop_behavior PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_core::nav2_core
nav2_costmap_2d::nav2_costmap_2d_core
${nav2_msgs_TARGETS}
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
rclcpp::rclcpp
rclcpp_lifecycle::rclcpp_lifecycle
${std_msgs_TARGETS}
std_msgs::std_msgs
tf2::tf2
tf2_ros::tf2_ros
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ class DriveOnHeading : public TimedBehavior<ActionT>
std::string error_msg;
if (command->target.y != 0.0 || command->target.z != 0.0) {
error_msg = "DrivingOnHeading in Y and Z not supported, will only move in X.";
RCLCPP_INFO(this->logger_, error_msg.c_str());
RCLCPP_INFO(this->logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, ActionT::Result::INVALID_INPUT, error_msg};
}

// Ensure that both the speed and direction have the same sign
if (!((command->target.x > 0.0) == (command->speed > 0.0)) ) {
error_msg = "Speed and command sign did not match";
RCLCPP_ERROR(this->logger_, error_msg.c_str());
RCLCPP_ERROR(this->logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, ActionT::Result::INVALID_INPUT, error_msg};
}

Expand All @@ -89,7 +89,7 @@ class DriveOnHeading : public TimedBehavior<ActionT>
this->transform_tolerance_))
{
error_msg = "Initial robot pose is not available.";
RCLCPP_ERROR(this->logger_, error_msg.c_str());
RCLCPP_ERROR(this->logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, ActionT::Result::TF_ERROR, error_msg};
}

Expand All @@ -107,7 +107,7 @@ class DriveOnHeading : public TimedBehavior<ActionT>
this->stopRobot();
std::string error_msg =
"Exceeded time allowance before reaching the DriveOnHeading goal - Exiting DriveOnHeading";
RCLCPP_WARN(this->logger_, error_msg.c_str());
RCLCPP_WARN(this->logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, ActionT::Result::TIMEOUT, error_msg};
}

Expand All @@ -117,7 +117,7 @@ class DriveOnHeading : public TimedBehavior<ActionT>
this->transform_tolerance_))
{
std::string error_msg = "Current robot pose is not available.";
RCLCPP_ERROR(this->logger_, error_msg.c_str());
RCLCPP_ERROR(this->logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, ActionT::Result::TF_ERROR, error_msg};
}

Expand Down Expand Up @@ -168,7 +168,7 @@ class DriveOnHeading : public TimedBehavior<ActionT>
if (!isCollisionFree(distance, cmd_vel->twist, pose2d)) {
this->stopRobot();
std::string error_msg = "Collision Ahead - Exiting DriveOnHeading";
RCLCPP_WARN(this->logger_, error_msg.c_str());
RCLCPP_WARN(this->logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, ActionT::Result::COLLISION_AHEAD, error_msg};
}

Expand Down
2 changes: 1 addition & 1 deletion nav2_behaviors/include/nav2_behaviors/timed_behavior.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class TimedBehavior : public nav2_core::Behavior
case Status::FAILED:
result->error_code = on_cycle_update_result.error_code;
result->error_msg = behavior_name_ + " failed:" + on_cycle_update_result.error_msg;
RCLCPP_WARN(logger_, result->error_msg.c_str());
RCLCPP_WARN(logger_, "%s", result->error_msg.c_str());
result->total_elapsed_time = clock_->now() - start_time;
onActionCompletion(result);
action_server_->terminate_current(result);
Expand Down
4 changes: 2 additions & 2 deletions nav2_behaviors/plugins/back_up.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ResultStatus BackUp::onRun(const std::shared_ptr<const BackUpAction::Goal> comma
{
if (command->target.y != 0.0 || command->target.z != 0.0) {
std::string error_msg = "Backing up in Y and Z not supported, will only move in X.";
RCLCPP_INFO(logger_, error_msg.c_str());
RCLCPP_INFO(logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, BackUpActionResult::INVALID_INPUT, error_msg};
}

Expand All @@ -38,7 +38,7 @@ ResultStatus BackUp::onRun(const std::shared_ptr<const BackUpAction::Goal> comma
transform_tolerance_))
{
std::string error_msg = "Initial robot pose is not available.";
RCLCPP_ERROR(logger_, error_msg.c_str());
RCLCPP_ERROR(logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, BackUpActionResult::TF_ERROR, error_msg};
}

Expand Down
8 changes: 4 additions & 4 deletions nav2_behaviors/plugins/spin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ResultStatus Spin::onRun(const std::shared_ptr<const SpinActionGoal> command)
transform_tolerance_))
{
std::string error_msg = "Current robot pose is not available.";
RCLCPP_ERROR(logger_, error_msg.c_str());
RCLCPP_ERROR(logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, SpinActionResult::TF_ERROR, error_msg};
}

Expand All @@ -88,7 +88,7 @@ ResultStatus Spin::onCycleUpdate()
if (time_remaining.seconds() < 0.0 && command_time_allowance_.seconds() > 0.0) {
stopRobot();
std::string error_msg = "Exceeded time allowance before reaching the Spin goal - Exiting Spin";
RCLCPP_WARN(logger_, error_msg.c_str());
RCLCPP_WARN(logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, SpinActionResult::TIMEOUT, error_msg};
}

Expand All @@ -98,7 +98,7 @@ ResultStatus Spin::onCycleUpdate()
transform_tolerance_))
{
std::string error_msg = "Current robot pose is not available.";
RCLCPP_ERROR(logger_, error_msg.c_str());
RCLCPP_ERROR(logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, SpinActionResult::TF_ERROR, error_msg};
}

Expand Down Expand Up @@ -134,7 +134,7 @@ ResultStatus Spin::onCycleUpdate()
if (!isCollisionFree(relative_yaw_, cmd_vel->twist, pose)) {
stopRobot();
std::string error_msg = "Collision Ahead - Exiting Spin";
RCLCPP_WARN(logger_, error_msg.c_str());
RCLCPP_WARN(logger_, "%s", error_msg.c_str());
return ResultStatus{Status::FAILED, SpinActionResult::COLLISION_AHEAD, error_msg};
}

Expand Down
2 changes: 1 addition & 1 deletion nav2_behaviors/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nav2_add_gtest(test_behaviors
test_behaviors.cpp
)
target_link_libraries(test_behaviors rclcpp::rclcpp rclcpp_action::rclcpp_action ${nav2_msgs_TARGETS} ${library_name})
target_link_libraries(test_behaviors rclcpp::rclcpp rclcpp_action::rclcpp_action nav2_msgs::nav2_msgs ${library_name})
2 changes: 1 addition & 1 deletion nav2_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.20)
project(nav2_bringup)

find_package(ament_cmake REQUIRED)
Expand Down
9 changes: 7 additions & 2 deletions nav2_bringup/launch/bringup_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,14 @@ def generate_launch_description() -> LaunchDescription:
name=container_name,
namespace=namespace,
package='rclcpp_components',
executable='component_container_isolated',
executable='component_container',
parameters=[configured_params, {'autostart': autostart}],
arguments=['--ros-args', '--log-level', log_level],
# event executor + isolated + thread num = 1
arguments=['--isolated', '--executor-type', 'events-cbg',
'--ros-args', '--log-level', log_level, '-p', 'thread_num:=1'],
# single threaded + isolated
# arguments=['--isolated', '--executor-type', 'single-threaded',
# '--ros-args', '--log-level', log_level],
Comment on lines +174 to +179

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously some of this commentary would need to be removed (temporarily) until we actually do migrate to the events executor in another PR?

remappings=remappings,
output='screen',
),
Expand Down
14 changes: 7 additions & 7 deletions nav2_bt_navigator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.20)
project(nav2_bt_navigator)

find_package(ament_cmake REQUIRED)
Expand Down Expand Up @@ -69,12 +69,12 @@ target_include_directories(nav2_navigate_to_pose_navigator
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(nav2_navigate_to_pose_navigator PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_core::nav2_core
${nav2_msgs_TARGETS}
nav2_msgs::nav2_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
${nav_msgs_TARGETS}
nav_msgs::nav_msgs
rclcpp::rclcpp
rclcpp_action::rclcpp_action
)
Expand All @@ -92,10 +92,10 @@ target_include_directories(nav2_navigate_through_poses
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
)
target_link_libraries(nav2_navigate_through_poses PUBLIC
${geometry_msgs_TARGETS}
geometry_msgs::geometry_msgs
nav2_core::nav2_core
${nav2_msgs_TARGETS}
${nav_msgs_TARGETS}
nav2_msgs::nav2_msgs
nav_msgs::nav_msgs
nav2_util::nav2_util_core
nav2_ros_common::nav2_ros_common
rclcpp::rclcpp
Expand Down
Loading
Loading