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

Allow to launch the joy launchfile #111

Open
wants to merge 1 commit into
base: humble
Choose a base branch
from
Open
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
29 changes: 13 additions & 16 deletions linorobot2_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,18 @@

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, PythonExpression
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch.conditions import IfCondition, UnlessCondition


def generate_launch_description():
sensors_launch_path = PathJoinSubstitution(
[FindPackageShare('linorobot2_bringup'), 'launch', 'sensors.launch.py']
)

joy_launch_path = PathJoinSubstitution(
[FindPackageShare('linorobot2_bringup'), 'launch', 'joy_teleop.launch.py']
)

description_launch_path = PathJoinSubstitution(
[FindPackageShare('linorobot2_description'), 'launch', 'description.launch.py']
)

ekf_config_path = PathJoinSubstitution(
[FindPackageShare("linorobot2_base"), "config", "ekf.yaml"]
)
Expand All @@ -52,19 +44,19 @@ def generate_launch_description():

return LaunchDescription([
DeclareLaunchArgument(
name='custom_robot',
name='custom_robot',
default_value='false',
description='Use custom robot'
),

DeclareLaunchArgument(
name='extra',
name='extra',
default_value='false',
description='Launch extra launch file'
),

DeclareLaunchArgument(
name='base_serial_port',
name='base_serial_port',
default_value='/dev/ttyACM0',
description='Linorobot Base Serial Port'
),
Expand All @@ -82,13 +74,13 @@ def generate_launch_description():
),

DeclareLaunchArgument(
name='odom_topic',
name='odom_topic',
default_value='/odom',
description='EKF out odometry topic'
),

DeclareLaunchArgument(
name='joy',
name='joy',
default_value='false',
description='Use Joystick'
),
Expand Down Expand Up @@ -120,5 +112,10 @@ def generate_launch_description():
IncludeLaunchDescription(
PythonLaunchDescriptionSource(custom_robot_launch_path),
condition=IfCondition(LaunchConfiguration("custom_robot")),
)
),

IncludeLaunchDescription(
PythonLaunchDescriptionSource(joy_launch_path),
condition=IfCondition(LaunchConfiguration("joy")),
),
])