Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate TB3 to nav2 minimal turtlebot repository & add the TB4 bringup option for modern gazebo #4401

Merged
merged 47 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c52b2b0
Initial support to the new Gazebo
ahcorde Jun 16, 2023
fd50e02
Added feedback
ahcorde Jun 16, 2023
2500c8c
Fixed build
ahcorde Jun 19, 2023
5215768
Added feeback
ahcorde Jun 20, 2023
d3c421a
Fixed physics tag
ahcorde Jun 20, 2023
975bc78
Fixed physics tag
ahcorde Jun 20, 2023
469c2a2
Fix copyright and urdf
ahcorde Jun 20, 2023
34f466e
min range cannot be zero
ahcorde Jun 21, 2023
01babc9
Simplify files
ahcorde Jun 21, 2023
00b5885
Merge remote-tracking branch 'origin/main' into ahcorde/initial_suppo…
ahcorde Jun 23, 2023
792569a
Added feedback
ahcorde Jun 23, 2023
960fdd7
Added feedback
ahcorde Jun 26, 2023
5a3e06c
Fix
ahcorde Jun 28, 2023
b17def8
Try to reduce load
ahcorde Jul 3, 2023
b413994
Removed cast shadows
ahcorde Jul 17, 2023
ed65b71
Use Gazebo plugins instead of gz_ros2_control
ahcorde Jul 24, 2023
41d7f4e
update dependency
ahcorde Jul 24, 2023
9a36ecd
Removed dependency
ahcorde Jul 24, 2023
027f113
Merge remote-tracking branch 'origin/main' into ahcorde/initial_suppo…
ahcorde Oct 5, 2023
564cf39
Removed ros2_control and use ogre
ahcorde Oct 5, 2023
4b8b006
Merge remote-tracking branch 'origin/main' into ahcorde/initial_suppo…
ahcorde Nov 14, 2023
ddb760d
Use param file to configure bridge
ahcorde Nov 14, 2023
076f1f0
Use sdf model and change to ogre instead of ogre2 for sensors
azeey Dec 15, 2023
04912e6
Merge branch 'main' into support_gz-sim
azeey Dec 15, 2023
b2deaee
Support Garden and later, performance improvements
azeey Dec 20, 2023
43ef810
Merge pull request #1 from azeey/support_gz-sim
ahcorde Dec 28, 2023
1cc1474
Use xacro for world file (#2)
azeey Feb 15, 2024
6a462be
Reviewer feedback
azeey Feb 17, 2024
225f1f3
Add comment explaining temp file
azeey Feb 17, 2024
1d8634d
Fix linter
azeey Feb 17, 2024
5bf14e2
Merge branch 'main' into ahcorde/initial_support/gazebo
SteveMacenski May 28, 2024
cc5bde0
Update nav2_bringup/worlds/gz_world_only.sdf.xacro
SteveMacenski May 28, 2024
89197d7
port GZ Classic launch changes to modern GZ and remove GZ Classic lau…
SteveMacenski Jun 5, 2024
cca7a66
adding changes
SteveMacenski Jun 5, 2024
058e9c0
changes done for TB4
SteveMacenski Jun 5, 2024
111be04
tb3 sim prototype
SteveMacenski Jun 5, 2024
0d5f9f3
fix missing ref
SteveMacenski Jun 5, 2024
f07b2f8
Merge branch 'main' into BR6
SteveMacenski Jun 5, 2024
046b0ef
linting
SteveMacenski Jun 5, 2024
30fa56d
Merge branch 'BR6' of github.com:ros-navigation/navigation2 into BR6
SteveMacenski Jun 5, 2024
f9937fd
fix branch name
SteveMacenski Jun 5, 2024
380a6cf
remove assets
SteveMacenski Jun 5, 2024
7e1d226
removing refs to turtlebot3_gazebo
SteveMacenski Jun 5, 2024
02edcd1
update map
SteveMacenski Jun 5, 2024
fce3e06
add new depot map
SteveMacenski Jun 5, 2024
af8e4e3
Update Nav2 side of multirobot launch files
SteveMacenski Jun 6, 2024
7d45353
linting
SteveMacenski Jun 6, 2024
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: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ _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 @@ -105,7 +104,6 @@ _commands:
--ignore-src \
--skip-keys " \
slam_toolbox \
turtlebot3_gazebo \
" \
--verbose | \
awk '$1 ~ /^resolution\:/' | \
Expand Down
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,11 @@ 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 @@ -170,9 +168,7 @@ RUN mkdir -p $ROOT_SRV

# install demo dependencies
RUN apt-get update && apt-get install -y \
ros-$ROS_DISTRO-aws-robomaker-small-warehouse-world \
ros-$ROS_DISTRO-rviz2 \
ros-$ROS_DISTRO-turtlebot3-simulations

# install gzweb dependacies
RUN apt-get install -y --no-install-recommends \
Expand Down
2 changes: 0 additions & 2 deletions nav2_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ nav2_package()
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})
install(DIRECTORY maps DESTINATION share/${PROJECT_NAME})
install(DIRECTORY rviz DESTINATION share/${PROJECT_NAME})
install(DIRECTORY worlds DESTINATION share/${PROJECT_NAME})
install(DIRECTORY params DESTINATION share/${PROJECT_NAME})
install(DIRECTORY urdf DESTINATION share/${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
Expand Down
55 changes: 33 additions & 22 deletions nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2023 LG Electronics.
# Copyright (c) 2024 Open Navigation LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,17 +15,23 @@


import os
from pathlib import Path
import tempfile

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
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_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, TextSubstitution
from nav2_common.launch import ParseMultiRobotPose
Expand All @@ -43,10 +50,10 @@ def generate_launch_description():
# Get the launch directory
bringup_dir = get_package_share_directory('nav2_bringup')
launch_dir = os.path.join(bringup_dir, 'launch')
sim_dir = get_package_share_directory('nav2_minimal_tb3_sim')

# Simulation settings
world = LaunchConfiguration('world')
simulator = LaunchConfiguration('simulator')

# On this example all robots are launched with the same settings
map_yaml_file = LaunchConfiguration('map')
Expand All @@ -60,19 +67,13 @@ def generate_launch_description():
# Declare the launch arguments
declare_world_cmd = DeclareLaunchArgument(
'world',
default_value=os.path.join(bringup_dir, 'worlds', 'world_only.model'),
default_value=os.path.join(sim_dir, 'worlds', 'tb3_sandbox.sdf.xacro'),
description='Full path to world file to load',
)

declare_simulator_cmd = DeclareLaunchArgument(
'simulator',
default_value='gazebo',
description='The simulator to use (gazebo or gzserver)',
)

declare_map_yaml_cmd = DeclareLaunchArgument(
'map',
default_value=os.path.join(bringup_dir, 'maps', 'turtlebot3_world.yaml'),
default_value=os.path.join(bringup_dir, 'maps', 'tb3_sandbox.yaml'),
description='Full path to map file to load',
)

Expand Down Expand Up @@ -107,18 +108,19 @@ def generate_launch_description():
)

# Start Gazebo with plugin providing the robot spawning service
start_gazebo_cmd = ExecuteProcess(
cmd=[
simulator,
'--verbose',
'-s',
'libgazebo_ros_init.so',
'-s',
'libgazebo_ros_factory.so',
world,
],
output='screen',
)
world_sdf = tempfile.mktemp(prefix='nav2_', suffix='.sdf')
world_sdf_xacro = ExecuteProcess(
cmd=['xacro', '-o', world_sdf, ['headless:=', 'False'], world])
start_gazebo_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('ros_gz_sim'), 'launch',
'gz_sim.launch.py')),
launch_arguments={'gz_args': ['-r -s ', world_sdf]}.items())

remove_temp_sdf_file = RegisterEventHandler(event_handler=OnShutdown(
on_shutdown=[
OpaqueFunction(function=lambda _: os.remove(world_sdf))
]))

robots_list = ParseMultiRobotPose('robots').value()

Expand Down Expand Up @@ -176,11 +178,18 @@ def generate_launch_description():

bringup_cmd_group.append(group)

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

# Create the launch description and populate
ld = LaunchDescription()
ld.add_action(set_env_vars_resources)
ld.add_action(set_env_vars_resources2)

# Declare the launch options
ld.add_action(declare_simulator_cmd)
ld.add_action(declare_world_cmd)
ld.add_action(declare_map_yaml_cmd)
ld.add_action(declare_params_file_cmd)
Expand All @@ -190,7 +199,9 @@ def generate_launch_description():
ld.add_action(declare_use_robot_state_pub_cmd)

# Add the actions to start gazebo, robots and simulations
ld.add_action(world_sdf_xacro)
ld.add_action(start_gazebo_cmd)
ld.add_action(remove_temp_sdf_file)

ld.add_action(LogInfo(msg=['number_of_robots=', str(len(robots_list))]))

Expand Down
106 changes: 0 additions & 106 deletions nav2_bringup/launch/tb3_gz_robot_launch.py

This file was deleted.

Loading
Loading