Skip to content
Open
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
124 changes: 19 additions & 105 deletions common/robotnik_simulation_bringup/launch/bringup_complete.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ def generate_launch_description():
default_value="false",
description="Enable MoveIt for manipulation"
),
DeclareLaunchArgument(
"run_localization",
default_value="true",
description="Enable localization stack"
),
DeclareLaunchArgument(
"run_navigation",
default_value="true",
description="Enable navigation stack"
),
DeclareLaunchArgument(
"arm_type",
default_value="ur10e",
Expand All @@ -102,6 +112,8 @@ def generate_launch_description():
world_path = LaunchConfiguration("world_path")
use_rviz = LaunchConfiguration("use_rviz")
run_moveit = LaunchConfiguration("run_moveit")
run_localization = LaunchConfiguration("run_localization")
run_navigation = LaunchConfiguration("run_navigation")
arm_type = LaunchConfiguration("arm_type")

gazebo_world = IncludeLaunchDescription(
Expand All @@ -117,127 +129,29 @@ def generate_launch_description():
}.items()
)

gazebo_robot = IncludeLaunchDescription(
robot_complete = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
FindPackageShare('robotnik_gazebo_ignition'), 'launch/spawn_robot.launch.py'
FindPackageShare('robotnik_simulation_bringup'), 'launch/robot_complete.launch.py'
])
),
launch_arguments={
'robot_id': robot_id,
'robot': robot,
'robot_model': robot_model,
'robot_xacro_path': robot_xacro_path,
'run_moveit': run_moveit,
'run_localization': run_localization,
'run_navigation': run_navigation,
'arm_type': arm_type,
'low_performance_simulation': low_performance_simulation,
'run_rviz': 'false'
}.items()
)

# In spawn_robot.launch.py the add_laser("front") is defined for any robot model
# This causes two publishers to /robot/front_laser/scan when laser filters are enabled
# In rbsummit and rbwatcher is not an issue because front laser is not available
# but in other robot models that have front laser, it causes conflict.
laser_filters = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
FindPackageShare('robotnik_simulation_bringup'), 'launch/laser_filters.launch.py'
])
),
launch_arguments={
'robot_id': robot_id,
'use_sim': 'true',
}.items(),
condition=IfCondition(
OrSubstitution(
OrSubstitution(
EqualsSubstitution(robot_model, 'rbsummit'),
EqualsSubstitution(robot_model, 'rbwatcher'),
),
EqualsSubstitution(robot_model, 'rbcar'),
)
)
)

localization = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
FindPackageShare('robotnik_simulation_localization'), 'launch/localization.launch.py'
])
),
launch_arguments={
'robot_id': robot_id,
'use_sim': 'true',
}.items()
)

delayed_localization = TimerAction(
period=10.0,
actions=[localization]
)

navigation = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
FindPackageShare('robotnik_simulation_navigation'), 'launch/navigation.launch.py'
])
),
launch_arguments={
'robot_id': robot_id,
'use_sim': 'true',
'use_rviz': use_rviz,
}.items()
)

delayed_navigation = TimerAction(
period=15.0,
actions=[navigation]
)

rviz = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
FindPackageShare('robotnik_simulation_bringup'), 'launch/rviz.launch.py'
])
),
condition=IfCondition(use_rviz)
)

delayed_rviz = TimerAction(
period=20.0,
actions=[rviz]
)

moveit = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution([
FindPackageShare('robotnik_simulation_moveit'), 'launch/moveit.launch.py',
])
),
launch_arguments={
'robot_id': robot_id,
'robot': robot,
'robot_model': robot_model,
'robot_xacro_path': robot_xacro_path,
'moveit_config_name': [robot, '_moveit_config'],
'arm_type': arm_type,
'use_sim_time': 'true',
}.items(),
condition=IfCondition(run_moveit),
)

delayed_moveit = TimerAction(
period=25.0,
actions=[moveit]
)

group = GroupAction([
gazebo_world,
gazebo_robot,
laser_filters,
delayed_localization,
delayed_navigation,
delayed_rviz,
delayed_moveit,
robot_complete
])

return LaunchDescription(declared_arguments + [group])
Loading