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 to AWS warehouse simulation scenario #2797

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
15d4aa8
Moving nav2_bringup to AWS warehouse simulation scenario
lucabonamini Jan 24, 2022
bdb933b
Moving nav2_simple_commander to AWS warehouse simulation scenario
lucabonamini Jan 25, 2022
5b18241
fix(test_behavior_tree_node): changed include order to fix flake8 error
lucabonamini Feb 2, 2022
641e1c5
refactor(nav2_system_tests/src/planning): moved to AWS small warehous…
lucabonamini Feb 2, 2022
a60017b
refactor(nav2_system_tests/src/localization): moved to AWS small ware…
lucabonamini Feb 2, 2022
1c24b6d
Merge branch 'main' into refactor/aws
lucabonamini Feb 2, 2022
cd1adde
refactor(nav2_system_tests/src/system): moved to AWS small warehouse …
lucabonamini Feb 2, 2022
ccc295a
Merge branch 'refactor/aws' of github.com:lucabonamini/navigation2 in…
lucabonamini Feb 2, 2022
801a0e3
refactor(nav2_system_tests/src/system_failure): moved to AWS small wa…
lucabonamini Feb 2, 2022
715b0c7
refactor(nav2_system_tests/src/updown): moved to AWS small warehouse …
lucabonamini Feb 2, 2022
0482c8d
refactor(nav2_system_tests/src/updown): moved to AWS small warehouse …
lucabonamini Feb 5, 2022
53e84d9
refactor(nav2_system_tests/src/recoveries): moved to AWS small wareho…
lucabonamini Feb 5, 2022
7f634a3
refactor(nav2_system_tests/src/waypoint_follower): moved to AWS small…
lucabonamini Feb 5, 2022
b353c01
Merge branch 'main' into refactor/aws
lucabonamini Mar 24, 2022
a31b528
fix(nav2_simple_commander): add robot spawn
lucabonamini Apr 9, 2022
50317bd
Merge branch 'main' into refactor/aws
lucabonamini Apr 9, 2022
ff6c820
fix(nav2_bringup): restore gazebo launch
lucabonamini Apr 9, 2022
cf4f7ae
fix(nav2_simple_commander): flake8
lucabonamini Apr 10, 2022
2962c25
fix(nav2_bringup): add world as gazebo launch parameter
lucabonamini Apr 10, 2022
c03a8e0
Fix merge error
lucabonamini Apr 10, 2022
ac33d9c
fix(nav2_system_tests): add world as gazebo launch parameter
lucabonamini Apr 10, 2022
49a14d8
fix(nav2_system_tests): add robot spawn after switching to aws wareho…
lucabonamini Apr 10, 2022
0b54780
Fix linting errors
lucabonamini Apr 11, 2022
ca860b7
Fix missing dependency for tests running
lucabonamini Apr 11, 2022
fbd7496
Readd nav2_system_tests/src/system test_dynamic_obstacle
lucabonamini Apr 16, 2022
f6b187e
Fix test_system_launch.py
Apr 18, 2022
d22d052
Update keepout_mask.png
lucabonamini Apr 27, 2022
45d6728
Fix forward slashes
lucabonamini Apr 27, 2022
4e5ba4b
WIP set environment variables correctly
lucabonamini May 8, 2022
cff74fe
Merge branch 'main' into refactor/aws
lucabonamini May 9, 2022
f74fc15
Testing environment variables
lucabonamini May 9, 2022
00658a0
Move test_drive_on_heading_behavior_launch.py to AWS small_warehouse …
lucabonamini May 9, 2022
cbb2aa8
Fix robot spawning in test_drive_on_heading_behavior_launch.py
lucabonamini May 9, 2022
5af0419
Change waypoints positions in waypoint_follower tester.py
lucabonamini May 10, 2022
84f6fbd
Merge branch 'main' into refactor/aws
May 12, 2022
e33db07
Patch costamp filters paramaters
May 12, 2022
264347d
Fix requested changes
May 12, 2022
017f10f
Fix default value for headless parameter in tb3_simulation_launch.py
lucabonamini May 12, 2022
5137875
Merge branch 'main' into refactor/aws
lucabonamini May 15, 2022
d6c031b
refactor(tb3_simulation_launch.py): Increase maximum lidar range. Rot…
lucabonamini May 15, 2022
68b3cc9
Merge branch 'main' into refactor/aws
lucabonamini May 21, 2022
16d7698
Roll back to direct execution of gzserver and gzclient in tb3_simulat…
lucabonamini May 21, 2022
8df9acd
Merge branch 'main' into refactor/aws
lucabonamini May 27, 2022
30888a5
Change set up GAZEBO env variables
lucabonamini May 27, 2022
9f417d6
Merge branch 'main' into refactor/aws
Jun 1, 2022
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
1 change: 0 additions & 1 deletion nav2_bringup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ find_package(navigation2 REQUIRED)
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})
Expand Down
29 changes: 13 additions & 16 deletions nav2_bringup/launch/multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import (DeclareLaunchArgument, ExecuteProcess, GroupAction,
from launch.actions import (DeclareLaunchArgument, GroupAction,
IncludeLaunchDescription, LogInfo)
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
Expand All @@ -36,17 +36,18 @@ def generate_launch_description():
# Get the launch directory
bringup_dir = get_package_share_directory('nav2_bringup')
launch_dir = os.path.join(bringup_dir, 'launch')
aws_dir = get_package_share_directory('aws_robomaker_small_warehouse_world')
gazebo_ros = get_package_share_directory('gazebo_ros')

# Names and poses of the robots
robots = [
{'name': 'robot1', 'x_pose': 0.0, 'y_pose': 0.5, 'z_pose': 0.01,
{'name': 'robot1', 'x_pose': 1.80, 'y_pose': 2.20, 'z_pose': 0.01,
'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0},
{'name': 'robot2', 'x_pose': 0.0, 'y_pose': -0.5, 'z_pose': 0.01,
{'name': 'robot2', 'x_pose': -3.50, 'y_pose': 9.0, 'z_pose': 0.01,
'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0}]

# 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,17 +61,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(aws_dir, 'worlds', 'no_roof_small_warehouse',
'no_roof_small_warehouse.world'),
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(aws_dir, 'maps', '005', 'map.yaml'),
description='Full path to map file to load')

declare_robot1_params_file_cmd = DeclareLaunchArgument(
Expand Down Expand Up @@ -103,10 +100,11 @@ def generate_launch_description():
description='Whether to start RVIZ')

# 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')
start_gazebo_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gzserver.launch.py')),
launch_arguments={'world': world}.items()
)

# Define commands for launching the navigation instances
nav_instances_cmds = []
Expand Down Expand Up @@ -171,7 +169,6 @@ def generate_launch_description():
ld = LaunchDescription()

# 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_robot1_params_file_cmd)
Expand Down
43 changes: 21 additions & 22 deletions nav2_bringup/launch/tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, ExecuteProcess, IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PythonExpression
Expand All @@ -30,6 +30,8 @@ def generate_launch_description():
# Get the launch directory
bringup_dir = get_package_share_directory('nav2_bringup')
launch_dir = os.path.join(bringup_dir, 'launch')
aws_dir = get_package_share_directory('aws_robomaker_small_warehouse_world')
gazebo_ros = get_package_share_directory('gazebo_ros')

# Create the launch configuration variables
slam = LaunchConfiguration('slam')
Expand All @@ -49,8 +51,8 @@ def generate_launch_description():
use_rviz = LaunchConfiguration('use_rviz')
headless = LaunchConfiguration('headless')
world = LaunchConfiguration('world')
pose = {'x': LaunchConfiguration('x_pose', default='-2.00'),
'y': LaunchConfiguration('y_pose', default='-0.50'),
pose = {'x': LaunchConfiguration('x_pose', default='1.80'),
'y': LaunchConfiguration('y_pose', default='2.20'),
'z': LaunchConfiguration('z_pose', default='0.01'),
'R': LaunchConfiguration('roll', default='0.00'),
'P': LaunchConfiguration('pitch', default='0.00'),
Expand Down Expand Up @@ -86,7 +88,7 @@ def generate_launch_description():
declare_map_yaml_cmd = DeclareLaunchArgument(
'map',
default_value=os.path.join(
bringup_dir, 'maps', 'turtlebot3_world.yaml'),
aws_dir, 'maps', '005', 'map.yaml'),
description='Full path to map file to load')

declare_use_sim_time_cmd = DeclareLaunchArgument(
Expand Down Expand Up @@ -134,16 +136,13 @@ def generate_launch_description():

declare_simulator_cmd = DeclareLaunchArgument(
'headless',
default_value='True',
default_value='False',
description='Whether to execute gzclient)')

declare_world_cmd = DeclareLaunchArgument(
'world',
# TODO(orduno) Switch back once ROS argument passing has been fixed upstream
# https://github.com/ROBOTIS-GIT/turtlebot3_simulations/issues/91
# default_value=os.path.join(get_package_share_directory('turtlebot3_gazebo'),
# worlds/turtlebot3_worlds/waffle.model')
default_value=os.path.join(bringup_dir, 'worlds', 'world_only.model'),
default_value=os.path.join(aws_dir, 'worlds', 'no_roof_small_warehouse',
'no_roof_small_warehouse.world'),
description='Full path to world model file to load')

declare_robot_name_cmd = DeclareLaunchArgument(
Expand All @@ -156,18 +155,18 @@ def generate_launch_description():
default_value=os.path.join(bringup_dir, 'worlds', 'waffle.model'),
description='Full path to robot sdf file to spawn the robot in gazebo')

# Specify the actions
start_gazebo_server_cmd = ExecuteProcess(
condition=IfCondition(use_simulator),
cmd=['gzserver', '-s', 'libgazebo_ros_init.so',
'-s', 'libgazebo_ros_factory.so', world],
cwd=[launch_dir], output='screen')

start_gazebo_client_cmd = ExecuteProcess(
condition=IfCondition(PythonExpression(
[use_simulator, ' and not ', headless])),
cmd=['gzclient'],
cwd=[launch_dir], output='screen')
start_gazebo_server_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gzserver.launch.py')),
condition=IfCondition(PythonExpression([use_simulator])),
launch_arguments={'world': world}.items()
)

start_gazebo_client_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gzclient.launch.py')),
condition=IfCondition(PythonExpression([use_simulator, ' and not ', headless]))
)

urdf = os.path.join(bringup_dir, 'urdf', 'turtlebot3_waffle.urdf')
with open(urdf, 'r') as infp:
Expand Down
5 changes: 0 additions & 5 deletions nav2_bringup/maps/turtlebot3_world.pgm

This file was deleted.

6 changes: 0 additions & 6 deletions nav2_bringup/maps/turtlebot3_world.yaml

This file was deleted.

54 changes: 0 additions & 54 deletions nav2_bringup/worlds/world_only.model

This file was deleted.

54 changes: 43 additions & 11 deletions nav2_simple_commander/launch/follow_path_example_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,57 @@
from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import ExecuteProcess, IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration


def generate_launch_description():
warehouse_dir = get_package_share_directory('aws_robomaker_small_warehouse_world')
nav2_bringup_dir = get_package_share_directory('nav2_bringup')
python_commander_dir = get_package_share_directory('nav2_simple_commander')
gazebo_ros = get_package_share_directory('gazebo_ros')

map_yaml_file = os.path.join(warehouse_dir, 'maps', '005', 'map.yaml')
world = os.path.join(python_commander_dir, 'warehouse.world')
world = os.path.join(warehouse_dir, 'worlds', 'no_roof_small_warehouse',
'no_roof_small_warehouse.world')

robot_name = LaunchConfiguration('robot_name')
robot_sdf = LaunchConfiguration('robot_sdf')
pose = {'x': LaunchConfiguration('x_pose', default='0.0'),
'y': LaunchConfiguration('y_pose', default='0.0'),
'z': LaunchConfiguration('z_pose', default='0.01'),
'R': LaunchConfiguration('roll', default='0.00'),
'P': LaunchConfiguration('pitch', default='0.00'),
'Y': LaunchConfiguration('yaw', default='0.00')}

declare_robot_sdf = DeclareLaunchArgument(
'robot_sdf',
default_value=os.path.join(nav2_bringup_dir, 'worlds', 'waffle.model'),
description='Full path to robot sdf file to spawn the robot in gazebo')

declare_robot_name = DeclareLaunchArgument(
'robot_name',
default_value='turtlebot3_waffle',
description='name of the robot')

# start the simulation
start_gazebo_server_cmd = ExecuteProcess(
cmd=['gzserver', '-s', 'libgazebo_ros_factory.so', world],
cwd=[warehouse_dir], output='screen')
start_gazebo_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gazebo.launch.py')),
launch_arguments={'world': world}.items()
)

start_gazebo_client_cmd = ExecuteProcess(
cmd=['gzclient'],
cwd=[warehouse_dir], output='screen')
start_gazebo_spawner_cmd = Node(
package='gazebo_ros',
executable='spawn_entity.py',
output='screen',
arguments=[
'-entity', robot_name,
'-file', robot_sdf,
'-robot_namespace', '',
'-x', pose['x'], '-y', pose['y'], '-z', pose['z'],
'-R', pose['R'], '-P', pose['P'], '-Y', pose['Y']])

urdf = os.path.join(nav2_bringup_dir, 'urdf', 'turtlebot3_waffle.urdf')
start_robot_state_publisher_cmd = Node(
Expand Down Expand Up @@ -68,8 +98,10 @@ def generate_launch_description():
output='screen')

ld = LaunchDescription()
ld.add_action(start_gazebo_server_cmd)
ld.add_action(start_gazebo_client_cmd)
ld.add_action(declare_robot_name)
ld.add_action(declare_robot_sdf)
ld.add_action(start_gazebo_cmd)
ld.add_action(start_gazebo_spawner_cmd)
ld.add_action(start_robot_state_publisher_cmd)
ld.add_action(rviz_cmd)
ld.add_action(bringup_cmd)
Expand Down
54 changes: 43 additions & 11 deletions nav2_simple_commander/launch/inspection_demo_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,57 @@
from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import ExecuteProcess, IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration


def generate_launch_description():
warehouse_dir = get_package_share_directory('aws_robomaker_small_warehouse_world')
nav2_bringup_dir = get_package_share_directory('nav2_bringup')
python_commander_dir = get_package_share_directory('nav2_simple_commander')
gazebo_ros = get_package_share_directory('gazebo_ros')

map_yaml_file = os.path.join(warehouse_dir, 'maps', '005', 'map.yaml')
world = os.path.join(python_commander_dir, 'warehouse.world')
world = os.path.join(warehouse_dir, 'worlds', 'no_roof_small_warehouse',
'no_roof_small_warehouse.world')

robot_name = LaunchConfiguration('robot_name')
robot_sdf = LaunchConfiguration('robot_sdf')
pose = {'x': LaunchConfiguration('x_pose', default='0.0'),
'y': LaunchConfiguration('y_pose', default='0.0'),
'z': LaunchConfiguration('z_pose', default='0.01'),
'R': LaunchConfiguration('roll', default='0.00'),
'P': LaunchConfiguration('pitch', default='0.00'),
'Y': LaunchConfiguration('yaw', default='0.00')}

declare_robot_sdf = DeclareLaunchArgument(
'robot_sdf',
default_value=os.path.join(nav2_bringup_dir, 'worlds', 'waffle.model'),
description='Full path to robot sdf file to spawn the robot in gazebo')

declare_robot_name = DeclareLaunchArgument(
'robot_name',
default_value='turtlebot3_waffle',
description='name of the robot')

# start the simulation
start_gazebo_server_cmd = ExecuteProcess(
cmd=['gzserver', '-s', 'libgazebo_ros_factory.so', world],
cwd=[warehouse_dir], output='screen')
start_gazebo_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gazebo.launch.py')),
launch_arguments={'world': world}.items()
)

start_gazebo_client_cmd = ExecuteProcess(
cmd=['gzclient'],
cwd=[warehouse_dir], output='screen')
start_gazebo_spawner_cmd = Node(
package='gazebo_ros',
executable='spawn_entity.py',
output='screen',
arguments=[
'-entity', robot_name,
'-file', robot_sdf,
'-robot_namespace', '',
'-x', pose['x'], '-y', pose['y'], '-z', pose['z'],
'-R', pose['R'], '-P', pose['P'], '-Y', pose['Y']])

urdf = os.path.join(nav2_bringup_dir, 'urdf', 'turtlebot3_waffle.urdf')
start_robot_state_publisher_cmd = Node(
Expand Down Expand Up @@ -68,8 +98,10 @@ def generate_launch_description():
output='screen')

ld = LaunchDescription()
ld.add_action(start_gazebo_server_cmd)
ld.add_action(start_gazebo_client_cmd)
ld.add_action(declare_robot_name)
ld.add_action(declare_robot_sdf)
ld.add_action(start_gazebo_cmd)
ld.add_action(start_gazebo_spawner_cmd)
ld.add_action(start_robot_state_publisher_cmd)
ld.add_action(rviz_cmd)
ld.add_action(bringup_cmd)
Expand Down
Loading