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

Intermediate Pathgen #2266

Merged
merged 12 commits into from
Sep 29, 2024
Merged

Intermediate Pathgen #2266

merged 12 commits into from
Sep 29, 2024

Conversation

sanatd33
Copy link
Contributor

@sanatd33 sanatd33 commented Sep 3, 2024

Description

Creates a new path planner to replace RRT. The main idea is to create one (or more) intermediate points that can segment a straight line path to avoid obstacles. This is heavily based on the TIGERS path planner, specifically referencing their 2019 TDP.

Copy link
Contributor

@jacksherling jacksherling left a comment

Choose a reason for hiding this comment

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

looks awesome

@@ -216,6 +216,8 @@ bool RobotFactoryPosition::am_closest_kicker() {
}

void RobotFactoryPosition::set_default_position() {
set_current_position<Line>();
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Testing shouldn't be pushed to ros2 😄

@@ -145,8 +146,8 @@ class RobotFactoryPosition : public Position {
// SPDLOG_INFO("we are never leaving defense :)");
// return;
// }
SPDLOG_INFO("Robot {}: change {}", robot_id_, current_position_->get_name());
Copy link
Contributor

Choose a reason for hiding this comment

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

return to prior spot. probably don't want logs to get flooded with positions that aren't changing

std::vector<rj_geometry::Point> get_intermediates(const LinearMotionInstant& start,
const LinearMotionInstant& goal);

const double MIN_SCALE = 0.5, MAX_SCALE = 1.5;
Copy link
Contributor

Choose a reason for hiding this comment

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

let's use constexpr here and for the other variables below because we already know the values

constexpr double MIN_SCALE = 0.5, MAX_SCALE = 1.5;
constexpr double MIN_ANGLE = 20, MAX_ANGLE = 140;
constexpr int NUM_INTERMEDIATES = 10;
constexpr double STEP_SIZE = 0.1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Use right style: kConstantName


std::vector<rj_geometry::Point> get_intermediates(const LinearMotionInstant& start,
const LinearMotionInstant& goal) {
std::random_device rd;
Copy link
Contributor

Choose a reason for hiding this comment

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

Add intermediate that works to list of new random ones. Cache that so know have one that works. (only cache if know works). Cache means adding to array of possibilities so still find optimal one. This helps because might be finding worse random positions later and veering off path.

soccer/src/soccer/planning/primitives/create_path.cpp Outdated Show resolved Hide resolved
soccer/src/soccer/planning/primitives/create_path.cpp Outdated Show resolved Hide resolved
soccer/src/soccer/planning/primitives/create_path.cpp Outdated Show resolved Hide resolved
soccer/src/soccer/planning/primitives/create_path.cpp Outdated Show resolved Hide resolved
soccer/src/soccer/planning/primitives/create_path.cpp Outdated Show resolved Hide resolved
automated style fixes

Co-authored-by: sid-parikh <sid-parikh@users.noreply.github.com>
double scale = scale_dist(gen);

// Generate random tuples of distances and angles
inter_tuples.emplace_back(abs(angle), signbit(angle) ? -1 : 1, scale);
Copy link
Contributor

Choose a reason for hiding this comment

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

Changes look good

@jacksherling jacksherling merged commit 8830a80 into ros2 Sep 29, 2024
1 of 2 checks passed
@jacksherling jacksherling deleted the intermediate-pathgen branch September 29, 2024 23:51
piman51277 pushed a commit that referenced this pull request Oct 6, 2024
* initial test of tigers system

* clean up and add comment

* added line test

* fix line issue

* made comments and removed from settle

* Fix Code Style On intermediate-pathgen (#2267)

automated style fixes

Co-authored-by: sanatd33 <sanatd33@users.noreply.github.com>

* make pr changes

* add cache inter

* start cacching intermediates

* add params

* use abs angle

* Fix Code Style On intermediate-pathgen (#2269)

automated style fixes

Co-authored-by: sid-parikh <sid-parikh@users.noreply.github.com>

---------

Co-authored-by: rishiso <rishisoni.5678@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: sanatd33 <sanatd33@users.noreply.github.com>
Co-authored-by: petergarud <peter.garud04@gmail.com>
Co-authored-by: sid-parikh <sid-parikh@users.noreply.github.com>
shourikb pushed a commit that referenced this pull request Oct 30, 2024
* initial test of tigers system

* clean up and add comment

* added line test

* fix line issue

* made comments and removed from settle

* Fix Code Style On intermediate-pathgen (#2267)

automated style fixes

Co-authored-by: sanatd33 <sanatd33@users.noreply.github.com>

* make pr changes

* add cache inter

* start cacching intermediates

* add params

* use abs angle

* Fix Code Style On intermediate-pathgen (#2269)

automated style fixes

Co-authored-by: sid-parikh <sid-parikh@users.noreply.github.com>

---------

Co-authored-by: rishiso <rishisoni.5678@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: sanatd33 <sanatd33@users.noreply.github.com>
Co-authored-by: petergarud <peter.garud04@gmail.com>
Co-authored-by: sid-parikh <sid-parikh@users.noreply.github.com>
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.

5 participants