-
Notifications
You must be signed in to change notification settings - Fork 122
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 permissive movement to allowed #2373
base: develop
Are you sure you want to change the base?
Conversation
can_make_early_arrival = ((early_arrival_state_by_algo_optional.get().second == lanelet::CarmaTrafficSignalState::PROTECTED_MOVEMENT_ALLOWED) | ||
|| (early_arrival_state_by_algo_optional.get().second == lanelet::CarmaTrafficSignalState::PERMISSIVE_MOVEMENT_ALLOWED)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the OR or AND conditions added in this PR can be made concise by using helper function called
isAllowedMovement
where
bool isAllowedMovement(const lanelet::CarmaTrafficSignalState& state) {
return state == lanelet::CarmaTrafficSignalState::PROTECTED_MOVEMENT_ALLOWED ||
state == lanelet::CarmaTrafficSignalState::PERMISSIVE_MOVEMENT_ALLOWED;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for isClearanceMovement()
function and add the permissive clearance to supported signals as well
@@ -369,15 +369,20 @@ std::tuple<rclcpp::Time, bool, bool> LCIStrategicPlugin::get_final_entry_time_an | |||
RCLCPP_DEBUG_STREAM(rclcpp::get_logger("lci_strategic_plugin"), "normal_arrival_signal_end_time: " << std::to_string(lanelet::time::toSec(normal_arrival_state_green_et_optional.get().first))); | |||
|
|||
// nearest_green_signal_start_time = normal_arrival_signal_end_time (green guaranteed) - green_signal_duration | |||
nearest_green_signal_start_time = rclcpp::Time(lanelet::time::toSec(normal_arrival_state_green_et_optional.get().first - traffic_light->signal_durations[lanelet::CarmaTrafficSignalState::PROTECTED_MOVEMENT_ALLOWED]) * 1e9); | |||
if(traffic_light->signal_durations[lanelet::CarmaTrafficSignalState::PROTECTED_MOVEMENT_ALLOWED]){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create a helper function like getAllowedState(const lanelet::CarmaTrafficSignalPtr& signal)
which can iterate over the available states and return correct "green" state from either of protected or permissive. Same applies to getClearanceState()
this way we don't need to create this if function, which is increasing the cognitive complexity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a nice suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added this
@@ -251,6 +250,17 @@ rclcpp::Duration LCIStrategicPlugin::get_earliest_entry_time(double remaining_di | |||
|
|||
} | |||
|
|||
int LCIStrategicPlugin::getClearanceDuration(lanelet::CarmaTrafficSignalPtr traffic_light) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is little misleading as it is getting movement allowed durations not clearance
PR Details
This PR adds Permissive movements to the lci strategic plugin planning logic. It extends the functionality for protected movements to permissive movements as well.
Description
During voices integration testing it was found that SPAT messages published by the virtual econolite controller were being published with the permissive movement type.
Related GitHub Issue
Related Jira Key
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: