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

feat(planning_validator): add validation for trajectory length and related tests #6195

Merged
merged 10 commits into from
Feb 14, 2024

Conversation

TakaHoribe
Copy link
Contributor

@TakaHoribe TakaHoribe commented Jan 28, 2024

Description

This PR improves planning validation.

  • Two validations are added:
    • check trajectory forward length
    • check longitudinal deviation
  • Add tests for all validation in the ros node level
  • Fix some bugs, and missing codes. (These are commented in github)

Now, the planning_validator can detect the invalid planning trajectory more correctly. For example, a very short path can be detected.

Before

planning_validator_before-2024-01-29_00.48.02.mp4

After

planning_validator_after-2024-01-29_00.29.33.mp4

Related links

None

Tests performed

  • run test in colcon
  • run psim and check if undesired behavior occurs (no error message on terminal)

Notes for reviewers

None

Interface changes

None

Effects on system behavior

The planning validation may will make more errors in diagnostics.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: Takamasa Horibe <[email protected]>
Signed-off-by: Takamasa Horibe <[email protected]>
@TakaHoribe TakaHoribe requested a review from kosuke55 as a code owner January 28, 2024 15:39
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Jan 28, 2024
@@ -296,7 +296,7 @@ std::pair<double, size_t> calcMaxSteeringRates(
const auto steer_next = steering_array.at(i + 1);

const auto steer_rate = (steer_next - steer_prev) / dt;
takeBigger(max_steering_rate, max_index, steer_rate, i);
takeBigger(max_steering_rate, max_index, std::abs(steer_rate), i);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix bug.

@@ -148,6 +152,20 @@ void PlanningValidator::setupDiag()
setStatus(
stat, validation_status_.is_valid_velocity_deviation, "velocity deviation is too large");
});
d->add(ns + "distance_deviation", [&](auto & stat) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add missing diagnostic

@@ -55,7 +59,7 @@ class PubSubManager : public rclcpp::Node

void spinSome(rclcpp::Node::SharedPtr node_ptr)
{
for (int i = 0; i < 50; ++i) {
for (int i = 0; i < 10; ++i) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to make sure this spin time is enough for CICD. This works well in my environment.

Signed-off-by: Takamasa Horibe <[email protected]>
Signed-off-by: Takamasa Horibe <[email protected]>
@github-actions github-actions bot added the component:map Map creation, storage, and loading. (auto-assigned) label Jan 31, 2024
@@ -95,4 +95,5 @@ MapProjectionLoader::MapProjectionLoader() : Node("map_projection_loader")
const auto adaptor = component_interface_utils::NodeAdaptor(this);
adaptor.init_pub(publisher_);
publisher_->publish(msg);
RCLCPP_WARN(get_logger(), "published map projection message");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this temporary code for debugging?
Or do you really want to merge it in the main branch as a WARN message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SakodaShintaro Sorry, this is just my mistake. This PR won't have any modification out of the planning_validator pkg.

@TakaHoribe TakaHoribe marked this pull request as draft February 9, 2024 04:58
@github-actions github-actions bot removed the component:map Map creation, storage, and loading. (auto-assigned) label Feb 9, 2024
@YamatoAndo YamatoAndo removed the request for review from TaikiYamada4 February 9, 2024 05:10
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Feb 9, 2024
Signed-off-by: Takamasa Horibe <[email protected]>
@TakaHoribe TakaHoribe marked this pull request as ready for review February 9, 2024 11:00
@TakaHoribe TakaHoribe added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Feb 9, 2024
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: 126 lines in your changes are missing coverage. Please review.

Comparison is base (1c54d43) 14.87% compared to head (465fbe8) 15.02%.
Report is 39 commits behind head on main.

Files Patch % Lines
...idator/test/src/test_planning_validator_pubsub.cpp 65.65% 1 Missing and 67 partials ⚠️
...idator/test/src/test_planning_validator_helper.cpp 59.75% 5 Missing and 28 partials ⚠️
...ning/planning_validator/src/planning_validator.cpp 68.33% 2 Missing and 17 partials ⚠️
...tor/test/src/test_planning_validator_functions.cpp 0.00% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6195      +/-   ##
==========================================
+ Coverage   14.87%   15.02%   +0.14%     
==========================================
  Files        1838     1838              
  Lines      126549   126843     +294     
  Branches    37958    38055      +97     
==========================================
+ Hits        18826    19057     +231     
+ Misses      86503    86492      -11     
- Partials    21220    21294      +74     
Flag Coverage Δ *Carryforward flag
differential 58.28% <63.58%> (?)
total 14.87% <ø> (-0.01%) ⬇️ Carriedforward from 720abf3

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 536 to 537
std::cerr << "forward_length_required = " << forward_length_required
<< ", forward_length = " << forward_length << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I removed it.

Signed-off-by: Takamasa Horibe <[email protected]>
Copy link
Contributor

@kosuke55 kosuke55 left a comment

Choose a reason for hiding this comment

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

LGTM!

@TakaHoribe TakaHoribe enabled auto-merge (squash) February 14, 2024 12:51
@TakaHoribe TakaHoribe merged commit b09bf92 into autowarefoundation:main Feb 14, 2024
22 of 26 checks passed
@TakaHoribe TakaHoribe deleted the update-planning-validator branch February 14, 2024 13:42
StepTurtle pushed a commit to StepTurtle/autoware.universe that referenced this pull request Feb 28, 2024
…lated tests (autowarefoundation#6195)

* tmp modify for smoother

Signed-off-by: Takamasa Horibe <[email protected]>

* improve planning validator

Signed-off-by: Takamasa Horibe <[email protected]>

* Revert "tmp modify for smoother"

This reverts commit a360bd0.

* remove undesired debug dependency

Signed-off-by: Takamasa Horibe <[email protected]>

* fix include guard

Signed-off-by: Takamasa Horibe <[email protected]>

* remove unintentional change

Signed-off-by: Takamasa Horibe <[email protected]>

* use acceleration to calculate required trajectory length

Signed-off-by: Takamasa Horibe <[email protected]>

* fix tests

Signed-off-by: Takamasa Horibe <[email protected]>

* remove debug comment

Signed-off-by: Takamasa Horibe <[email protected]>

---------

Signed-off-by: Takamasa Horibe <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…lated tests (autowarefoundation#6195)

* tmp modify for smoother

Signed-off-by: Takamasa Horibe <[email protected]>

* improve planning validator

Signed-off-by: Takamasa Horibe <[email protected]>

* Revert "tmp modify for smoother"

This reverts commit a360bd0.

* remove undesired debug dependency

Signed-off-by: Takamasa Horibe <[email protected]>

* fix include guard

Signed-off-by: Takamasa Horibe <[email protected]>

* remove unintentional change

Signed-off-by: Takamasa Horibe <[email protected]>

* use acceleration to calculate required trajectory length

Signed-off-by: Takamasa Horibe <[email protected]>

* fix tests

Signed-off-by: Takamasa Horibe <[email protected]>

* remove debug comment

Signed-off-by: Takamasa Horibe <[email protected]>

---------

Signed-off-by: Takamasa Horibe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants