Skip to content

Commit

Permalink
Fix ros2bag launch (#243)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
This PR fixes an issue in the carma-messenger launch script causing the
ros2 rosbag recording to error out.
The ThisLaunchFileDir() option being placed after
get_package_share_directory calls causes ThisLaunchFileDir()
substitution to take the value of the last
get_package_share_directory().

In this update the ros2 rosbag record launch option was moved to the
start of the script as a workaround.

Additionally the required config directory from the carma-messenger
package was added to installation.
## Description

<!--- Describe your changes in detail -->

## Related GitHub Issue

<!--- This project only accepts pull requests related to open GitHub
issues or Jira Keys -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please DO NOT name partially fixed issues, instead open an issue
specific to this fix -->
<!--- Please link to the issue here: -->

## Related Jira Key

<!-- e.g. CAR-123 -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [x] Defect fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the
[**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
adev4a authored Nov 22, 2024
1 parent 9b45c93 commit 976efa6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions carma-messenger-core/carma-messenger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ else() # ROS 2


ament_auto_package(
INSTALL_TO_SHARE launch log-config scripts ui
INSTALL_TO_SHARE config launch log-config scripts ui
)

endif()

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def generate_launch_description():
description = 'Path of folder on host PC containing route CSV file(s) that can be accessed by plugins'
)

# Launch ROS2 rosbag logging
ros2_rosbag_launch = GroupAction(
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/ros2_rosbag.launch.py']),
)
]
)

transform_group = GroupAction(
actions=[
PushRosNamespace(EnvironmentVariable('CARMA_TF_NS', default_value='/')),
Expand Down Expand Up @@ -94,23 +103,14 @@ def generate_launch_description():
)


# Launch ROS2 rosbag logging
ros2_rosbag_launch = GroupAction(
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/ros2_rosbag.launch.py']),
)
]
)


return LaunchDescription([
declare_configuration_delay_arg,
declare_route_file_folder,
ros2_rosbag_launch,
transform_group,
v2x_group,
plugins_group,
ui_group,
traffic_incident_group,
ros2_rosbag_launch
traffic_incident_group
])

0 comments on commit 976efa6

Please sign in to comment.