Skip to content

Commit

Permalink
tryout for substitute launch argument - fails
Browse files Browse the repository at this point in the history
  • Loading branch information
knmcguire committed Mar 7, 2024
1 parent 6019132 commit 623da39
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions crazyflie/launch/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,28 @@


def generate_launch_description():

config_folder = LaunchConfiguration('config_folder')
config_folder_launch_arg = DeclareLaunchArgument('config_folder',
default_value=os.path.join(get_package_share_directory('crazyflie'),
'config',
'crazyflies.yaml')),




# load crazyflies
crazyflies_yaml = os.path.join(
get_package_share_directory('crazyflie'),
'config',
config_folder,
'crazyflies.yaml')


with open(crazyflies_yaml, 'r') as ymlfile:
crazyflies = yaml.safe_load(ymlfile)

# server params
server_yaml = os.path.join(
get_package_share_directory('crazyflie'),
'config',
config_folder,
'server.yaml')

with open(server_yaml, 'r') as ymlfile:
Expand All @@ -41,8 +50,7 @@ def generate_launch_description():

# construct motion_capture_configuration
motion_capture_yaml = os.path.join(
get_package_share_directory('crazyflie'),
'config',
config_folder,
'motion_capture.yaml')

with open(motion_capture_yaml, 'r') as ymlfile:
Expand All @@ -64,15 +72,15 @@ def generate_launch_description():

# teleop params
teleop_params = os.path.join(
get_package_share_directory('crazyflie'),
'config',
config_folder,
'teleop.yaml')

return LaunchDescription([
DeclareLaunchArgument('backend', default_value='cpp'),
DeclareLaunchArgument('debug', default_value='False'),
DeclareLaunchArgument('rviz', default_value='False'),
DeclareLaunchArgument('gui', default_value='True'),
config_folder_launch_arg,
Node(
package='motion_capture_tracking',
executable='motion_capture_tracking_node',
Expand Down

0 comments on commit 623da39

Please sign in to comment.