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 13 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
19 changes: 6 additions & 13 deletions nav2_bringup/launch/multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ 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')

# 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
Expand All @@ -60,7 +61,8 @@ 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(
Expand All @@ -70,7 +72,7 @@ def generate_launch_description():

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 @@ -102,12 +104,6 @@ def generate_launch_description():
default_value='True',
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')

# Define commands for launching the navigation instances
nav_instances_cmds = []
for robot in robots:
Expand Down Expand Up @@ -181,9 +177,6 @@ def generate_launch_description():
ld.add_action(declare_rviz_config_file_cmd)
ld.add_action(declare_use_robot_state_pub_cmd)

# Add the actions to start gazebo, robots and simulations
ld.add_action(start_gazebo_cmd)
Copy link
Member

Choose a reason for hiding this comment

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

Removing gazebo? Wouldn't we have multiple instances of it running if each of the n robots starts their own? I thought we did that here so that it didn't get done there so they all shared 1 and we set the gazebo parameters to false within each's launch (e.g. https://github.com/ros-planning/navigation2/blob/7f634a3993bd5e129c5b5b220795df9a09a332bd/nav2_bringup/launch/multi_tb3_simulation_launch.py#L133). I think gazebo needs to be launched here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You were right. I misunderstood the use of that parameter. Anyway, I'm having some problem: map is not load correctly, so the simulation is not working properly.

Copy link
Member

Choose a reason for hiding this comment

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

Did that get worked out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. Still debugging it.

Copy link
Member

Choose a reason for hiding this comment

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

OK!


for simulation_instance_cmd in nav_instances_cmds:
ld.add_action(simulation_instance_cmd)

Expand Down
37 changes: 17 additions & 20 deletions nav2_bringup/launch/tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -48,8 +50,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 @@ -85,7 +87,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,11 +136,8 @@ def generate_launch_description():

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 @@ -151,18 +150,16 @@ 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'))
)

start_gazebo_client_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gzclient.launch.py')),
condition=IfCondition(PythonExpression(['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.

26 changes: 17 additions & 9 deletions nav2_simple_commander/launch/inspection_demo_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,34 @@
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


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')

declare_world_cmd = DeclareLaunchArgument(
'world',
default_value=os.path.join(warehouse_dir, 'worlds', 'no_roof_small_warehouse',
'no_roof_small_warehouse.world'),
description='Full path to world model file to load')

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

start_gazebo_client_cmd = ExecuteProcess(
cmd=['gzclient'],
cwd=[warehouse_dir], output='screen')
start_gazebo_client_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gzclient.launch.py'))
)

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

ld = LaunchDescription()
ld.add_action(declare_world_cmd)
ld.add_action(start_gazebo_server_cmd)
ld.add_action(start_gazebo_client_cmd)
ld.add_action(start_robot_state_publisher_cmd)
Expand Down
26 changes: 17 additions & 9 deletions nav2_simple_commander/launch/nav_through_poses_example_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,34 @@
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, ExecuteProcess, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node


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')

declare_world_cmd = DeclareLaunchArgument(
'world',
default_value=os.path.join(warehouse_dir, 'worlds', 'no_roof_small_warehouse',
'no_roof_small_warehouse.world'),
description='Full path to world model file to load')

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

start_gazebo_client_cmd = ExecuteProcess(
cmd=['gzclient'],
cwd=[warehouse_dir], output='screen')
start_gazebo_client_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gzclient.launch.py'))
)

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

ld = LaunchDescription()
ld.add_action(declare_world_cmd)
ld.add_action(start_gazebo_server_cmd)
ld.add_action(start_gazebo_client_cmd)
ld.add_action(start_robot_state_publisher_cmd)
Expand Down
26 changes: 17 additions & 9 deletions nav2_simple_commander/launch/nav_to_pose_example_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,34 @@
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


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')

declare_world_cmd = DeclareLaunchArgument(
'world',
default_value=os.path.join(warehouse_dir, 'worlds', 'no_roof_small_warehouse',
'no_roof_small_warehouse.world'),
description='Full path to world model file to load')

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

start_gazebo_client_cmd = ExecuteProcess(
cmd=['gzclient'],
cwd=[warehouse_dir], output='screen')
start_gazebo_client_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros, 'launch', 'gzclient.launch.py'))
)

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

ld = LaunchDescription()
ld.add_action(declare_world_cmd)
ld.add_action(start_gazebo_server_cmd)
ld.add_action(start_gazebo_client_cmd)
ld.add_action(start_robot_state_publisher_cmd)
Expand Down
Loading