Skip to content

Commit

Permalink
Move Nav2 CI to 24.04 / Rolling (ros-navigation#4298)
Browse files Browse the repository at this point in the history
* Fix devcontainer

* fix

* .

* .

* .

* fix

* pr comments

* bust cache

* test with docker image

* Revert "test with docker image"

This reverts commit 17b434e.

* fixes

* fixes

* remove comment

* Update URI for new GitHub org and GHCR repo

* replace fix

* replace fix

* ignore maybe uninitialized error

* inline comment

* fix linting

* Add comments

* fix bt test

* fix nav2 test

* fix waypoint follower test

* More improvements towards Jazzy migration

* fix more tests

* do a few more

* last for the day

* fix remaining BT tests

* fixing last test issues

* change linting image

* comment out tests needing gazebo

* break the cache cuz why not

* fix dynamic param test

* revert changes to test_bt_utils

* fix dyn param

* comment out turtlebot3_gazebo

* test with spin_all

* Update Dockerfile

Signed-off-by: Steve Macenski <[email protected]>

* Update .circleci/config.yml

Signed-off-by: Steve Macenski <[email protected]>

---------

Signed-off-by: Steve Macenski <[email protected]>
Co-authored-by: Ruffin <[email protected]>
Co-authored-by: Steve Macenski <[email protected]>
  • Loading branch information
3 people authored and Marc-Morcos committed Jul 4, 2024
1 parent 0bc66df commit 00d4f2a
Show file tree
Hide file tree
Showing 44 changed files with 163 additions and 69 deletions.
15 changes: 6 additions & 9 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 >>-v21\
- "<< parameters.key >>-v23\
-{{ arch }}\
-{{ .Branch }}\
-{{ .Environment.CIRCLE_PR_NUMBER }}\
-{{ checksum \"<< parameters.workspace >>/lockfile.txt\" }}"
- "<< parameters.key >>-v21\
- "<< parameters.key >>-v23\
-{{ arch }}\
-main\
-<no value>\
Expand All @@ -58,7 +58,7 @@ _commands:
steps:
- save_cache:
name: Save Cache << parameters.key >>
key: "<< parameters.key >>-v21\
key: "<< parameters.key >>-v23\
-{{ arch }}\
-{{ .Branch }}\
-{{ .Environment.CIRCLE_PR_NUMBER }}\
Expand All @@ -82,6 +82,7 @@ _commands:
- run:
name: Install Dependencies | << parameters.workspace >>
working_directory: << parameters.workspace >>
# Remove/Replace turtlebot3_gazebo and gazebo_ros_pkgs from --skip-keys after https://github.com/ros-navigation/navigation2/pull/3634
command: |
. << parameters.underlay >>/install/setup.sh
AMENT_PREFIX_PATH=$(echo "$AMENT_PREFIX_PATH" | \
Expand All @@ -96,11 +97,6 @@ _commands:
(echo vcs_export && cat) >> lockfile.txt
sha256sum $PWD/lockfile.txt >> lockfile.txt
# Temp: Rolling transition to 24.04 leaves rosdep in 22.04 in the lurch
# This replaces main rosdep index with the last prior to release: Feb 28, 2024
sed -i "s|ros\/rosdistro\/master|ros\/rosdistro\/rolling\/2024-02-28|" /etc/ros/rosdep/sources.list.d/20-default.list
export ROSDISTRO_INDEX_URL=https://raw.githubusercontent.com/ros/rosdistro/rolling/2024-02-28/index-v4.yaml
apt-get update
rosdep update --rosdistro $ROS_DISTRO
dependencies=$(
Expand All @@ -109,6 +105,7 @@ _commands:
--ignore-src \
--skip-keys " \
slam_toolbox \
turtlebot3_gazebo \
" \
--verbose | \
awk '$1 ~ /^resolution\:/' | \
Expand Down Expand Up @@ -487,7 +484,7 @@ _environments:
executors:
release_exec:
docker:
- image: ghcr.io/ros-planning/navigation2:main
- image: ghcr.io/ros-navigation/navigation2:main
resource_class: large
working_directory: /opt/overlay_ws
environment:
Expand Down
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"build": {
"dockerfile": "../Dockerfile",
"context": "..",
"target": "visualizer",
"cacheFrom": "ghcr.io/ros-planning/navigation2:main"
"target": "dever",
"cacheFrom": "ghcr.io/ros-navigation/navigation2:main"
},
"runArgs": [
"--name=nav2"
// "--cap-add=SYS_PTRACE", // enable debugging, e.g. gdb
// "--ipc=host", // shared memory transport with host, e.g. rviz GUIs
// "--network=host", // network access to host interfaces, e.g. eth0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest
image: rostooling/setup-ros-docker:ubuntu-noble-ros-rolling-ros-base-latest
strategy:
fail-fast: false
matrix:
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ RUN apt-get update && \
ros-$ROS_DISTRO-rmw-fastrtps-cpp \
ros-$ROS_DISTRO-rmw-connextdds \
ros-$ROS_DISTRO-rmw-cyclonedds-cpp \
&& pip3 install \
&& pip3 install --break-system-packages \
fastcov \
git+https://github.com/ruffsl/colcon-cache.git@a937541bfc496c7a267db7ee9d6cceca61e470ca \
git+https://github.com/ruffsl/colcon-clean.git@a7f1074d1ebc1a54a6508625b117974f2672f2a9 \
Expand Down Expand Up @@ -96,11 +96,14 @@ ARG OVERLAY_WS
ENV OVERLAY_WS $OVERLAY_WS
WORKDIR $OVERLAY_WS
COPY --from=cacher /tmp/$OVERLAY_WS ./

# Remove/Replace turtlebot3_gazebo and gazebo_ros_pkgs from --skip-keys after https://github.com/ros-navigation/navigation2/pull/3634
RUN . $UNDERLAY_WS/install/setup.sh && \
apt-get update && rosdep install -q -y \
--from-paths src \
--skip-keys " \
slam_toolbox \
turtlebot3_gazebo \
"\
--ignore-src \
&& rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -145,7 +148,7 @@ RUN apt-get update && \
bash-completion \
gdb \
wget && \
pip3 install \
pip3 install --break-system-packages \
bottle \
glances

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For detailed instructions on how to:
- [Configure](https://docs.nav2.org/configuration/index.html)
- [Navigation Plugins](https://docs.nav2.org/plugins/index.html)
- [Migration Guides](https://docs.nav2.org/migration/index.html)
- [Container Images for Building Nav2](https://github.com/orgs/ros-planning/packages/container/package/navigation2)
- [Container Images for Building Nav2](https://github.com/orgs/ros-navigation/packages/container/package/navigation2)
- [Contribute](https://docs.nav2.org/development_guides/involvement_docs/index.html)

Please visit our [documentation site](https://docs.nav2.org/). [Please visit our community Slack here](https://join.slack.com/t/navigation2/shared_invite/zt-hu52lnnq-cKYjuhTY~sEMbZXL8p9tOw) (if this link does not work, please contact maintainers to reactivate).
Expand Down
2 changes: 2 additions & 0 deletions nav2_behavior_tree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ find_package(nav2_util REQUIRED)

nav2_package()

add_compile_options(-Wno-shadow) # Delete after https://github.com/BehaviorTree/BehaviorTree.CPP/issues/811 is released

include_directories(
include
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class BtActionNode : public BT::ActionNodeBase
};
send_goal_options.feedback_callback =
[this](typename rclcpp_action::ClientGoalHandle<ActionT>::SharedPtr,
const std::shared_ptr<const typename ActionT::Feedback> feedback) {
const std::shared_ptr<const typename ActionT::Feedback> feedback) {
feedback_ = feedback;
emitWakeUpSignal();
};
Expand Down
2 changes: 1 addition & 1 deletion nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ inline BT::NodeStatus GoalUpdater::tick()

getInput("input_goal", goal);

callback_group_executor_.spin_some();
callback_group_executor_.spin_all(std::chrono::milliseconds(50));

if (last_goal_received_.header.stamp != rclcpp::Time(0)) {
auto last_goal_received_time = rclcpp::Time(last_goal_received_.header.stamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class DistanceTraveledConditionTestFixture : public nav2_behavior_tree::Behavior
{
config_->input_ports["global_frame"] = "map";
config_->input_ports["robot_base_frame"] = "base_link";
config_->input_ports["distance"] = 1.0;
bt_node_ = std::make_shared<nav2_behavior_tree::DistanceTraveledCondition>(
"distance_traveled", *config_);
}
Expand Down Expand Up @@ -89,6 +90,5 @@ int main(int argc, char ** argv)

// shutdown ROS
rclcpp::shutdown();

return all_successful;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class GloballyUpdatedGoalConditionTestFixture : public nav2_behavior_tree::Behav
public:
void SetUp()
{
config_->input_ports["goals"] = "";
config_->input_ports["goal"] = "";
bt_node_ = std::make_shared<nav2_behavior_tree::GloballyUpdatedGoalCondition>(
"globally_updated_goal", *config_);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class GoalUpdatedConditionTestFixture : public nav2_behavior_tree::BehaviorTreeT
public:
void SetUp()
{
config_->input_ports["goals"] = "";
config_->input_ports["goal"] = "";
bt_node_ = std::make_shared<nav2_behavior_tree::GoalUpdatedCondition>(
"goal_updated", *config_);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class InitialPoseReceivedConditionTestFixture : public nav2_behavior_tree::Behav
public:
void SetUp()
{
config_->input_ports["initial_pose_received"] = false;
bt_node_ = std::make_shared<nav2_behavior_tree::InitialPoseReceived>("TestNode", *config_);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
#include <set>

#include "geometry_msgs/msg/pose_stamped.hpp"
#include "nav_msgs/msg/path.hpp"
#include "nav2_util/robot_utils.hpp"

#include "utils/test_behavior_tree_fixture.hpp"
#include "nav2_behavior_tree/plugins/condition/path_expiring_timer_condition.hpp"
#include "nav2_behavior_tree/bt_utils.hpp"

using namespace std::chrono; // NOLINT
using namespace std::chrono_literals; // NOLINT
Expand All @@ -33,6 +35,9 @@ class PathExpiringTimerConditionTestFixture : public nav2_behavior_tree::Behavio
{
node_ = std::make_shared<rclcpp::Node>("test_path_expiring_condition");
config_ = new BT::NodeConfiguration();
config_->input_ports["seconds"] = 1.0;
config_->input_ports["path"] = "";

config_->blackboard = BT::Blackboard::create();
config_->blackboard->set("node", node_);
bt_node_ = std::make_shared<nav2_behavior_tree::PathExpiringTimerCondition>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TimeExpiredConditionTestFixture : public nav2_behavior_tree::BehaviorTreeT
public:
void SetUp()
{
config_->input_ports["seconds"] = 1.0;
bt_node_ = std::make_shared<nav2_behavior_tree::TimeExpiredCondition>(
"time_expired", *config_);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class RecoveryNodeTestFixture : public nav2_behavior_tree::BehaviorTreeTestFixtu
public:
void SetUp() override
{
config_->input_ports["number_of_retries"] = 1;
bt_node_ = std::make_shared<nav2_behavior_tree::RecoveryNode>(
"recovery_node", *config_);
first_child_ = std::make_shared<RecoveryDummy>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DistanceControllerTestFixture : public nav2_behavior_tree::BehaviorTreeTes
public:
void SetUp()
{
config_->input_ports["distance"] = 1.0;
config_->input_ports["global_frame"] = "map";
config_->input_ports["robot_base_frame"] = "base_link";
bt_node_ = std::make_shared<nav2_behavior_tree::DistanceController>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class GoalUpdatedControllerTestFixture : public nav2_behavior_tree::BehaviorTree
poses1.push_back(goal1);
config_->blackboard->set("goal", goal1);
config_->blackboard->set("goals", poses1);

config_->input_ports["goals"] = "";
config_->input_ports["goal"] = "";
bt_node_ = std::make_shared<nav2_behavior_tree::GoalUpdatedController>(
"goal_updated_controller", *config_);
dummy_node_ = std::make_shared<nav2_behavior_tree::DummyNode>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class RateControllerTestFixture : public nav2_behavior_tree::BehaviorTreeTestFix
public:
void SetUp()
{
config_->input_ports["hz"] = 10.0;
bt_node_ = std::make_shared<nav2_behavior_tree::RateController>(
"rate_controller", *config_);
dummy_node_ = std::make_shared<nav2_behavior_tree::DummyNode>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class SpeedControllerTestFixture : public nav2_behavior_tree::BehaviorTreeTestFi
std::vector<geometry_msgs::msg::PoseStamped> fake_poses;
config_->blackboard->set("goals", fake_poses); // NOLINT

config_->input_ports["min_rate"] = 0.1;
config_->input_ports["max_rate"] = 1.0;
config_->input_ports["min_speed"] = 0.0;
config_->input_ports["max_speed"] = 0.5;
config_->input_ports["goals"] = "";
config_->input_ports["goal"] = "";

bt_node_ = std::make_shared<nav2_behavior_tree::SpeedController>("speed_controller", *config_);
dummy_node_ = std::make_shared<nav2_behavior_tree::DummyNode>();
bt_node_->setChild(dummy_node_.get());
Expand Down
3 changes: 2 additions & 1 deletion nav2_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
<exec_depend>navigation2</exec_depend>
<exec_depend>nav2_common</exec_depend>
<exec_depend>slam_toolbox</exec_depend>
<exec_depend>turtlebot3_gazebo</exec_depend>
<!-- Replace after https://github.com/ros-navigation/navigation2/pull/3634 -->
<!-- <exec_depend>turtlebot3_gazebo</exec_depend> -->

<test_depend>ament_lint_common</test_depend>
<test_depend>ament_lint_auto</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1503,9 +1503,9 @@ TEST_F(Tester, testCollisionPointsMarkers)
ASSERT_TRUE(waitCollisionPointsMarker(500ms));
ASSERT_EQ(collision_points_marker_msg_->markers[0].points.size(), 0u);

publishCmdVel(0.5, 0.2, 0.1);
publishScan(0.5, curr_time);
ASSERT_TRUE(waitData(0.5, 500ms, curr_time));
publishCmdVel(0.5, 0.2, 0.1);
ASSERT_TRUE(waitCollisionPointsMarker(500ms));
ASSERT_NE(collision_points_marker_msg_->markers[0].points.size(), 0u);
// Stop Collision Monitor node
Expand Down
4 changes: 2 additions & 2 deletions nav2_constrained_smoother/test/test_constrained_smoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class SmootherTest : public ::testing::Test
int cusp_i_ = -1;
QualityCriterion3 mvmt_smoothness_criterion_ =
[this](int i, const Eigen::Vector3d & prev_p, const Eigen::Vector3d & p,
const Eigen::Vector3d & next_p) {
const Eigen::Vector3d & next_p) {
Eigen::Vector2d prev_mvmt = p.block<2, 1>(0, 0) - prev_p.block<2, 1>(0, 0);
Eigen::Vector2d next_mvmt = next_p.block<2, 1>(0, 0) - p.block<2, 1>(0, 0);
if (i == cusp_i_) {
Expand Down Expand Up @@ -986,7 +986,7 @@ TEST_F(SmootherTest, testingDownsamplingUpsampling)
int cusp_i_out = 6; // for upsampled path
QualityCriterion3 mvmt_smoothness_criterion_out =
[&cusp_i_out](int i, const Eigen::Vector3d & prev_p, const Eigen::Vector3d & p,
const Eigen::Vector3d & next_p) {
const Eigen::Vector3d & next_p) {
Eigen::Vector2d prev_mvmt = p.block<2, 1>(0, 0) - prev_p.block<2, 1>(0, 0);
Eigen::Vector2d next_mvmt = next_p.block<2, 1>(0, 0) - p.block<2, 1>(0, 0);
if (i == cusp_i_out) {
Expand Down
6 changes: 4 additions & 2 deletions nav2_costmap_2d/src/footprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ bool makeFootprintFromString(
RCLCPP_ERROR(
rclcpp::get_logger(
"nav2_costmap_2d"),
"You must specify at least three points for the robot footprint, reverting to previous footprint."); //NOLINT
"You must specify at least three points for the robot footprint,"
" reverting to previous footprint.");
return false;
}
footprint.reserve(vvf.size());
Expand All @@ -209,7 +210,8 @@ bool makeFootprintFromString(
RCLCPP_ERROR(
rclcpp::get_logger(
"nav2_costmap_2d"),
"Points in the footprint specification must be pairs of numbers. Found a point with %d numbers.", //NOLINT
"Points in the footprint specification must be pairs of numbers."
" Found a point with %d numbers.",
static_cast<int>(vvf[i].size()));
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion nav2_costmap_2d/test/integration/costmap_tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ void CostmapTester::compareCells(
RCLCPP_ERROR(
rclcpp::get_logger(
"costmap_tester"),
"Cell cost (%d, %d): %d, neighbor cost (%d, %d): %d, expected lowest cost: %d, cell distance: %.2f, furthest valid distance: %.2f", // NOLINT
"Cell cost (%d, %d): %d, neighbor cost (%d, %d): %d, expected lowest cost:"
" %d, cell distance: %.2f, furthest valid distance: %.2f",
x, y, cell_cost, nx, ny, neighbor_cost, expected_lowest_cost,
cell_distance, furthest_valid_distance);
RCLCPP_ERROR(
Expand Down
10 changes: 6 additions & 4 deletions nav2_costmap_2d/test/integration/dyn_params_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ TEST(DynParamTestNode, testDynParamsSet)
costmap->on_activate(rclcpp_lifecycle::State());

auto parameter_client = std::make_shared<rclcpp::AsyncParametersClient>(
node->shared_from_this(),
"/test_costmap/test_costmap",
rmw_qos_profile_parameters);
costmap->get_node_base_interface(), costmap->get_node_topics_interface(),
costmap->get_node_graph_interface(),
costmap->get_node_services_interface());

auto results1 = parameter_client->set_parameters_atomically(
{
rclcpp::Parameter("robot_radius", 1.234),
Expand All @@ -83,7 +84,8 @@ TEST(DynParamTestNode, testDynParamsSet)
rclcpp::Parameter("robot_base_frame", "wrong_test_frame"),
});

rclcpp::spin_some(costmap->get_node_base_interface());
rclcpp::spin_all(node->get_node_base_interface(), std::chrono::milliseconds(50));
rclcpp::spin_all(costmap->get_node_base_interface(), std::chrono::milliseconds(50));

EXPECT_EQ(costmap->get_parameter("robot_radius").as_double(), 1.234);
EXPECT_EQ(costmap->get_parameter("footprint_padding").as_double(), 2.345);
Expand Down
6 changes: 4 additions & 2 deletions nav2_map_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ find_package(std_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(nav2_util REQUIRED)
find_package(GRAPHICSMAGICKCPP REQUIRED)
find_package(yaml-cpp REQUIRED)

nav2_package()

Expand Down Expand Up @@ -118,7 +119,8 @@ target_include_directories(${map_io_library_name} SYSTEM PRIVATE
${GRAPHICSMAGICKCPP_INCLUDE_DIRS})

target_link_libraries(${map_io_library_name}
${GRAPHICSMAGICKCPP_LIBRARIES})
${GRAPHICSMAGICKCPP_LIBRARIES}
yaml-cpp::yaml-cpp)

if(WIN32)
target_compile_definitions(${map_io_library_name} PRIVATE
Expand Down Expand Up @@ -160,5 +162,5 @@ ament_export_libraries(
${library_name}
${map_io_library_name}
)
ament_export_dependencies(${map_io_dependencies} ${map_server_dependencies})
ament_export_dependencies(${map_io_dependencies} ${map_server_dependencies} yaml-cpp)
ament_package()
Loading

0 comments on commit 00d4f2a

Please sign in to comment.