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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ _environments:
executors:
release_exec:
docker:
- image: ghcr.io/ros-navigation/navigation2:main
- image: ghcr.io/ros-navigation/navigation2:humble
resource_class: large
working_directory: /opt/overlay_ws
environment:
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dockerfile": "../Dockerfile",
"context": "..",
"target": "dever",
"cacheFrom": "ghcr.io/ros-navigation/navigation2:main"
"cacheFrom": "ghcr.io/ros-navigation/navigation2:humble"
},
"runArgs": [
"--name=nav2"
Expand Down
9 changes: 9 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ pull_request_rules:
branches:
- humble

- name: backport to humble_main at reviewers discretion
conditions:
- base=main
- "label=backport-humble-main"
actions:
backport:
branches:
- humble_main

- name: delete head branch after merge
conditions:
- merged
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/lint.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/update_ci_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- main
- jazzy
- humble
- humble_main
paths:
- '**/package.xml'
- '**/*.repos'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# docker build -t nav2:latest \
# --build-arg UNDERLAY_MIXINS \
# --build-arg OVERLAY_MIXINS ./
ARG FROM_IMAGE=ros:rolling
ARG FROM_IMAGE=ros:humble
ARG UNDERLAY_WS=/opt/underlay_ws
ARG OVERLAY_WS=/opt/overlay_ws

Expand Down
6 changes: 0 additions & 6 deletions nav2_amcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ install(DIRECTORY include/
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)

ament_lint_auto_find_test_dependencies()
endif()

ament_export_include_directories("include/${PROJECT_NAME}")
Expand Down
2 changes: 0 additions & 2 deletions nav2_behavior_tree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ install(FILES nav2_tree_nodes.xml DESTINATION share/${PROJECT_NAME})
install(FILES ${GENERATED_DIR}/plugins_list.hpp DESTINATION include/${PROJECT_NAME}/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)

ament_find_gtest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "nav2_msgs/action/navigate_to_pose.hpp"
#include "nav2_behavior_tree/bt_action_server.hpp"
#include "nav2_util/copy_all_parameter_values.hpp"
#include "nav2_util/node_utils.hpp"
#include "rcl_action/action_server.h"
#include "rclcpp_lifecycle/lifecycle_node.hpp"
Expand Down Expand Up @@ -164,7 +165,7 @@ bool BtActionServer<ActionT>::on_configure()
node, "robot_base_frame", rclcpp::ParameterValue(std::string("base_link")));
nav2_util::declare_parameter_if_not_declared(
node, "transform_tolerance", rclcpp::ParameterValue(0.1));
rclcpp::copy_all_parameter_values(node, client_node_);
nav2_util::copy_all_parameter_values(node, client_node_);

// set the timeout in seconds for the action server to discard goal handles if not finished
double action_server_result_timeout =
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 @@ -38,7 +38,7 @@ GoalUpdater::GoalUpdater(
initialize();

// Spin multiple times due to rclcpp regression in Jazzy requiring a 'warm up' spin
callback_group_executor_.spin_all(std::chrono::milliseconds(1));
callback_group_executor_.spin_some();
}

void GoalUpdater::initialize()
Expand Down
2 changes: 0 additions & 2 deletions nav2_behaviors/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ install(DIRECTORY plugins/
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)
find_package(rclcpp_action REQUIRED)

Expand Down
2 changes: 0 additions & 2 deletions nav2_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ install(DIRECTORY rviz DESTINATION share/${PROJECT_NAME})
install(DIRECTORY params DESTINATION share/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
4 changes: 2 additions & 2 deletions nav2_bringup/launch/bringup_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PythonExpression
from launch_ros.actions import Node, PushROSNamespace
from launch_ros.actions import Node, PushRosNamespace
from launch_ros.descriptions import ParameterFile
from nav2_common.launch import RewrittenYaml

Expand Down Expand Up @@ -132,7 +132,7 @@ def generate_launch_description() -> LaunchDescription:
# Specify the actions
bringup_cmd_group = GroupAction(
[
PushROSNamespace(namespace),
PushRosNamespace(namespace),
Node(
condition=IfCondition(use_composition),
name='nav2_container',
Expand Down
98 changes: 43 additions & 55 deletions nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,24 @@

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import (AppendEnvironmentVariable, DeclareLaunchArgument, ExecuteProcess,
ForEach, GroupAction, IncludeLaunchDescription, LogInfo,
OpaqueFunction, RegisterEventHandler)
from launch.actions import (
AppendEnvironmentVariable,
DeclareLaunchArgument,
ExecuteProcess,
GroupAction,
IncludeLaunchDescription,
LogInfo,
OpaqueFunction,
RegisterEventHandler,
)
from launch.conditions import IfCondition
from launch.event_handlers import OnShutdown
from launch.launch_context import LaunchContext
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, TextSubstitution
import yaml
from nav2_common.launch import ParseMultiRobotPose


def count_robots(context: LaunchContext) -> list[LogInfo]:
"""Count the number of robots from the 'robots' launch argument."""
robots_str = LaunchConfiguration('robots').perform(context).strip()
log_msg = ''

if not robots_str:
log_msg = 'No robots provided in the launch argument.'

try:
robots_list = [yaml.safe_load(robot.strip()) for robot in
robots_str.split(';') if robot.strip()]
log_msg = f'number_of_robots={len(robots_list)}'
except yaml.YAMLError as e:
log_msg = f'Error parsing the robots launch argument: {e}'

return [LogInfo(msg=[log_msg])]


def generate_robot_actions(name: str = '', pose: dict[str, float] = {}) -> list[GroupAction]:
"""Generate the actions to launch a robot with the given name and pose."""
def generate_robot_actions(context, *args, **kwargs):
bringup_dir = get_package_share_directory('nav2_bringup')
launch_dir = os.path.join(bringup_dir, 'launch')
use_rviz = LaunchConfiguration('use_rviz')
Expand All @@ -61,19 +48,25 @@ def generate_robot_actions(name: str = '', pose: dict[str, float] = {}) -> list[
graph_filepath = LaunchConfiguration('graph')
use_robot_state_pub = LaunchConfiguration('use_robot_state_pub')

robots_substitution = ParseMultiRobotPose(LaunchConfiguration('robots'))
robots_list = robots_substitution.perform(context)

# Define commands for launching the navigation instances
group = GroupAction(
bringup_cmd_group = []
for robot_name in robots_list:
init_pose = robots_list[robot_name]
group = GroupAction(
[
LogInfo(
msg=['Launching namespace=', name, ' init_pose=', str(pose),]
msg=['Launching namespace=', robot_name, ' init_pose=', str(init_pose), ]
),
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_dir, 'rviz_launch.py')
),
condition=IfCondition(use_rviz),
launch_arguments={
'namespace': TextSubstitution(text=name),
'namespace': TextSubstitution(text=robot_name),
'rviz_config': rviz_config_file,
}.items(),
),
Expand All @@ -82,7 +75,7 @@ def generate_robot_actions(name: str = '', pose: dict[str, float] = {}) -> list[
os.path.join(bringup_dir, 'launch', 'tb3_simulation_launch.py')
),
launch_arguments={
'namespace': name,
'namespace': robot_name,
'map': map_yaml_file,
'graph': graph_filepath,
'use_sim_time': 'True',
Expand All @@ -92,33 +85,32 @@ def generate_robot_actions(name: str = '', pose: dict[str, float] = {}) -> list[
'use_simulator': 'False',
'headless': 'False',
'use_robot_state_pub': use_robot_state_pub,
'x_pose': TextSubstitution(text=str(pose.get('x', 0.0))),
'y_pose': TextSubstitution(text=str(pose.get('y', 0.0))),
'z_pose': TextSubstitution(text=str(pose.get('z', 0.0))),
'roll': TextSubstitution(text=str(pose.get('roll', 0.0))),
'pitch': TextSubstitution(text=str(pose.get('pitch', 0.0))),
'yaw': TextSubstitution(text=str(pose.get('yaw', 0.0))),
'robot_name': TextSubstitution(text=name),
'x_pose': TextSubstitution(text=str(init_pose['x'])),
'y_pose': TextSubstitution(text=str(init_pose['y'])),
'z_pose': TextSubstitution(text=str(init_pose['z'])),
'roll': TextSubstitution(text=str(init_pose['roll'])),
'pitch': TextSubstitution(text=str(init_pose['pitch'])),
'yaw': TextSubstitution(text=str(init_pose['yaw'])),
'robot_name': TextSubstitution(text=robot_name),
}.items(),
),
]
)
return [group]

bringup_cmd_group.append(group)
bringup_cmd_group.append(LogInfo(msg=['number_of_robots=', str(len(robots_list))]))
return bringup_cmd_group


def generate_launch_description() -> LaunchDescription:
def generate_launch_description():
"""
Bring up the multi-robots with given launch arguments.

Launch arguments consist of robot name(which is namespace) and pose for initialization.
Keep general yaml format for pose information.

ex) robots:='{name: 'robot1', pose: {x: 1.0, y: 1.0, yaw: 1.5707}};
{name: 'robot2', pose: {x: 1.0, y: 1.0, yaw: 1.5707}}'
ex) robots:='{name: 'robot3', pose: {x: 1.0, y: 1.0, z: 1.0,
roll: 0.0, pitch: 1.5707, yaw: 1.5707}};
{name: 'robot4', pose: {x: 1.0, y: 1.0, z: 1.0,
roll: 0.0, pitch: 1.5707, yaw: 1.5707}}'
ex) robots:='robot1={x: 1.0, y: 1.0, yaw: 1.5707}; robot2={x: 1.0, y: 1.0, yaw: 1.5707}'
ex) robots:='robot3={x: 1.0, y: 1.0, z: 1.0, roll: 0.0, pitch: 1.5707, yaw: 1.5707};
robot4={x: 1.0, y: 1.0, z: 1.0, roll: 0.0, pitch: 1.5707, yaw: 1.5707}'
"""
# Get the launch directory
bringup_dir = get_package_share_directory('nav2_bringup')
Expand All @@ -144,10 +136,8 @@ def generate_launch_description() -> LaunchDescription:

declare_robots_cmd = DeclareLaunchArgument(
'robots',
default_value=(
"{name: 'robot1', pose: {x: 0.5, y: 0.5, yaw: 0}};"
"{name: 'robot2', pose: {x: -0.5, y: -0.5, z: 0, roll: 0, pitch: 0, yaw: 1.5707}}"
),
default_value="""robot1={x: 0.5, y: 0.5, yaw: 0};
robot2={x: -0.5, y: -0.5, z: 0, roll: 0, pitch: 0, yaw: 1.5707}""",
description='Robots and their initialization poses in YAML format',
)

Expand Down Expand Up @@ -198,7 +188,7 @@ def generate_launch_description() -> LaunchDescription:
world_sdf_xacro = ExecuteProcess(
cmd=['xacro', '-o', world_sdf, ['headless:=', 'False'], world])
start_gazebo_cmd = ExecuteProcess(
cmd=['gz', 'sim', '-r', '-s', world_sdf],
cmd=['ign', 'gazebo', '-r', '-s', world_sdf],
output='screen',
)

Expand All @@ -208,9 +198,9 @@ def generate_launch_description() -> LaunchDescription:
]))

set_env_vars_resources = AppendEnvironmentVariable(
'GZ_SIM_RESOURCE_PATH', os.path.join(sim_dir, 'models'))
'IGN_GAZEBO_RESOURCE_PATH', os.path.join(sim_dir, 'models'))
set_env_vars_resources2 = AppendEnvironmentVariable(
'GZ_SIM_RESOURCE_PATH',
'IGN_GAZEBO_RESOURCE_PATH',
str(Path(os.path.join(sim_dir)).parent.resolve()))

# Create the launch description and populate
Expand Down Expand Up @@ -255,8 +245,6 @@ def generate_launch_description() -> LaunchDescription:
ld.add_action(
LogInfo(condition=IfCondition(log_settings), msg=['autostart: ', autostart])
)

ld.add_action(OpaqueFunction(function=count_robots))
ld.add_action(ForEach(LaunchConfiguration('robots'), function=generate_robot_actions))
ld.add_action(OpaqueFunction(function=generate_robot_actions))

return ld
4 changes: 2 additions & 2 deletions nav2_bringup/launch/tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def generate_launch_description() -> LaunchDescription:
world_sdf_xacro = ExecuteProcess(
cmd=['xacro', '-o', world_sdf, ['headless:=', headless], world])
gazebo_server = ExecuteProcess(
cmd=['gz', 'sim', '-r', '-s', world_sdf],
cmd=['ign', 'gazebo', '-r', '-s', world_sdf],
output='screen',
condition=IfCondition(use_simulator)
)
Expand All @@ -224,7 +224,7 @@ def generate_launch_description() -> LaunchDescription:
),
condition=IfCondition(PythonExpression(
[use_simulator, ' and not ', headless])),
launch_arguments={'gz_args': ['-v4 -g ']}.items(),
launch_arguments={'ign_args': ['-v4 -g ']}.items(),
)

gz_robot = IncludeLaunchDescription(
Expand Down
Loading