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

port platooning_control to ros2 #2377

Merged
merged 23 commits into from
May 21, 2024
Merged

Conversation

adev4a
Copy link
Contributor

@adev4a adev4a commented May 8, 2024

PR Details

Ports the platooning control plugin to ros2.

Description

Related GitHub Issue

Related Jira Key

https://usdot-carma.atlassian.net/browse/CAR-5188

Motivation and Context

How Has This Been Tested?

Unit Test and Local Integration Test.

Types of changes

  • 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:

  • 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.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@adev4a adev4a marked this pull request as draft May 8, 2024 13:35
@adev4a adev4a requested review from MishkaMN and saina-ramyar May 8, 2024 14:05
@adev4a adev4a marked this pull request as ready for review May 9, 2024 12:55
@adev4a adev4a self-assigned this May 9, 2024
<!--Platooning Control Plugin-->
<include file="$(find platoon_control)/launch/platoon_control.launch" />

<!--Platooning Control IHP Plugin-->
Copy link
Contributor

Choose a reason for hiding this comment

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

you can remove the ihp plugin too. We wont need it

@@ -1,7 +1,7 @@
# platoon_control

Platooning Control plugin which allows platooning to maintain the gap; moreover, generates longitudinal and lateral control commands to follow the trajectory. The structure of this plugin is very similar to the control plugin for IHP2, so the same design document is included here.
The difference between platoon_control, and platoon_control_ihp is that the IHP plugin includes logic to open or close the gap between platoon members, to allow for a new member to join or an existing memeber to exit the platoon.
The difference between platoon_control, and platoon_control_ihp is that the IHP plugin includes logic to open or close the gap between platoon members, to allow for a new member to join or an existing memeber to exit the platoon.
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think we need this paragraph anymore since the control ihp will be removed. You can add a few sentences saying it includes logic from control ihp, and autoware pure pursuit

@adev4a adev4a requested a review from saina-ramyar May 10, 2024 17:45
carma/launch/plugins.launch.py Outdated Show resolved Hide resolved
platooning_control/CMakeLists.txt Outdated Show resolved Hide resolved
platooning_control/CMakeLists.txt Outdated Show resolved Hide resolved
platooning_control/CMakeLists.txt Outdated Show resolved Hide resolved
platooning_control/config/parameters.yaml Outdated Show resolved Hide resolved
@@ -23,22 +23,24 @@
- /guidance/plugins/inlanecruising_plugin
- /guidance/pure_pursuit_wrapper
- /guidance/yield_plugin
- /guidance/plugins/platoon_control
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't probably add platooning to required plugins

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Related issue here: #2383

@MishkaMN
Copy link
Contributor

Left a lot of comments, so please use your own judgement on what to address. But just wanted to bring these up so that we can also remember to look for such things in future PRs.

@adev4a adev4a requested a review from MishkaMN May 10, 2024 21:06
@adev4a adev4a requested a review from MishkaMN May 16, 2024 13:19
/**
* \brief Extending class provided method which can optionally handle trajectory plan callbacks.
*/
virtual void current_trajectory_callback(carma_planning_msgs::msg::TrajectoryPlan::UniquePtr msg);
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think you can make the trajectory callback pure virtual, other controllers dont have their own implementation and depend on it to receive the trajectory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one won't be pure virtual (doesn't include the =0). Also i'm able to build the pure pursuit wrapper

Copy link
Contributor

Choose a reason for hiding this comment

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

you are right, it was shown in multiple lanes and I thought I saw the =0

Copy link
Contributor

Choose a reason for hiding this comment

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

I put all the callbacks in protected, can you do the same? to avoid merge conflicts?

MishkaMN
MishkaMN previously approved these changes May 16, 2024
@@ -46,7 +46,7 @@ ament_auto_add_executable(${node_exec}
)

# Register component
rclcpp_components_register_nodes(${node_lib} "platoon_control::PlatoonControlPlugin")
rclcpp_components_register_nodes(${node_lib} "platooning_control::PlatoonControlPlugin")
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, not to cause extra work, but if the namespace is now platooning, shouldn't the class also be PlatooningControl?

/**
* \brief Extending class provided method which can optionally handle trajectory plan callbacks.
*/
virtual void current_trajectory_callback(carma_planning_msgs::msg::TrajectoryPlan::UniquePtr msg);
Copy link
Contributor

Choose a reason for hiding this comment

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

I put all the callbacks in protected, can you do the same? to avoid merge conflicts?

@adev4a adev4a requested review from saina-ramyar and MishkaMN May 17, 2024 21:10
MishkaMN
MishkaMN previously approved these changes May 17, 2024
MishkaMN
MishkaMN previously approved these changes May 20, 2024
saina-ramyar
saina-ramyar previously approved these changes May 20, 2024
@adev4a adev4a dismissed stale reviews from saina-ramyar and MishkaMN via e434aaa May 20, 2024 17:59
Copy link

@adev4a adev4a merged commit 1000679 into develop May 21, 2024
4 checks passed
@adev4a adev4a deleted the car-5188-ros2port-platooning-plugin branch May 21, 2024 00:05
adev4a added a commit to usdot-fhwa-stol/carma-config that referenced this pull request Jul 26, 2024
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
This PR removes reference to platoon_control_ihp node as the node has
been removed under
usdot-fhwa-stol/carma-platform#2377

This PR also adds a note for using control plugins. Under current
implementation it is required that only a single control node be
activated at a time, as activating multiple control nodes will cause
each node to publish commands for as long as they are activated. This
means that if a certain plugin is activated and not responsible for
control cmds for a specific trajectory plan, it will publish empty
commands that are populated with a valid value of 0.0 for speed and
steering.

## Description

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

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- 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 link to the issue here: -->

## 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** document.
[CARMA Contributing
Guide](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants