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

Add global launch and configuration files #154

Merged
merged 31 commits into from
Aug 31, 2023

Conversation

DFriend01
Copy link
Contributor

@DFriend01 DFriend01 commented Jul 13, 2023

Description

Depends on the following PRs:

If not merged, use the following branches:

  • local_pathfinding: patrick-5546/overhaul_launch_file
  • boat_simulator: user/dfriend01/17-overhaul-launch-files
  • network_systems: user/dfriend01/update_launch_file_name

This PR aims to streamline the process of running all packages while having a single source for global configuration and launching.

To Dos

  • Move launch file to somewhere insides src/, as this is where the linters run
  • Move global config file from local_pathfinding to this repository
  • Read global config file in main_launch.py
  • Decide on local launch naming convention. <PACKAGE>_launch.py vs main_launch.py, or something else.
  • Add debug configuration for running global launch file

Verification

  • Run global launch file: ros2 launch $ROS_WORKSPACE/global_launch/main_launch.py
    • Launches all packages as expected and all ROS topics show up in ros2 topic list.
    • Test mode launch argument with values production and development
    • Test log_level launch argument with value debug
    • Test debug configuration
  • Run package launch files: ros launch debug configuration or ros2 launch <package> main_launch.py

Resources

@DFriend01
Copy link
Contributor Author

DFriend01 commented Jul 13, 2023

Adding arguments

To do this, I believe that the steps are the following:

  1. Try one of these methods to add arguments:

    • Add your launch arguments to the LAUNCH_ARGUMENTS list. I am hoping that the arguments are somehow passed into the children launch files. If this works, the only disadvantage that I see is that all arguments are exposed to all children launch files.
    • Edit the function get_include_launch_descriptions() in main_launch.py to accept launch arguments and include them in the launch include a description. I believe section 2 of this link shows you what that looks like. In each of the children launch files, make sure that the global parameters are declared with the DeclareLaunchArgument class and include them in the LaunchDescription (like what local pathfinding does right now). This method should allow us to only pass arguments that are needed for each package without exposing external arguments.
  2. If you want to add any more global arguments, follow the instructions on line 17 of main_launch.py and repeat step 1.

@DFriend01
Copy link
Contributor Author

DFriend01 commented Jul 15, 2023

@patrick-5546 It was decided that the following will be done:

  • Global configuration files and package-specific configuration files will be stored in sailbot workspace
  • Both the main launch file and the children will accept two arguments
    • The path to the global config file to be used
    • The path to the package-specific config file to be used
  • If launched via the main launch file, whatever the main launch file specifies will override the arguments (the config file paths) in the children launch files.

image

Copy link
Member

@patrick-5546 patrick-5546 left a comment

Choose a reason for hiding this comment

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

Great work on this PR, I really like this flow

@patrick-5546
Copy link
Member

patrick-5546 commented Aug 30, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants