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

Merge Settle into Collect #2320

Open
wants to merge 5 commits into
base: ros2
Choose a base branch
from
Open

Merge Settle into Collect #2320

wants to merge 5 commits into from

Conversation

sanatd33
Copy link
Contributor

Collect now can properly get stationary and moving balls

github-actions bot and others added 2 commits January 19, 2025 21:49

// List of obstacles
ShapeSet static_obstacles;
std::vector<DynamicObstacle> dynamic_obstacles;
fill_obstacles(plan_request, &static_obstacles, &dynamic_obstacles, false);

if (current_state_ == Intercept) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use our convention from strategy and the line kick planner for all caps state names?

RobotInstant start_instant) {
// If the ball is moving, intercept
// if not, regularly approach
if (current_state_ == CoarseApproach && average_ball_vel_.mag() > 0.2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Magic number? (0.2)

@@ -177,8 +200,7 @@ void CollectPathPlanner::process_state_transition(BallState ball, RobotInstant s
// If we are close enough to the target point near the ball
// and almost the same speed we want, start slowing down
// TODO(#1518): Check for ball sense?
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can get rid of this TODO comment once and for all :)

@@ -243,6 +266,246 @@ Trajectory CollectPathPlanner::coarse_approach(
return coarse_path;
}

void CollectPathPlanner::calc_delta_pos_for_dir(BallState ball, RobotInstant start_instant,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this function for our use case?

std::ceil((settle::PARAM_search_end_dist - settle::PARAM_search_start_dist) /
settle::PARAM_search_inc_dist);

for (int iteration = 0; iteration < num_iterations; iteration++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of calculating number of iterations can we do all the "math" in the for loop? Like start at start, end at end, and increment by increment for each part of for loop, respectively?

@@ -453,6 +715,8 @@ bool CollectPathPlanner::is_done() const {
// (see process_state_transition())
if (current_state_ != Control) {
Copy link
Contributor

Choose a reason for hiding this comment

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

return current_state_ == Control?

Also, if we're not using the below code do we need Control?

Trajectory dampen_end;

if (previous_.empty()) {
dampen_end = CreatePath::simple(start_instant.linear_motion(), final_stopping_motion,
Copy link
Contributor

Choose a reason for hiding this comment

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

intermediate?

@@ -23,12 +23,11 @@ Trajectory::Trajectory(Trajectory a, const Trajectory& b) {

using rj_geometry::Point;
if (!a_end.position().near_point(b_begin.position(), 1e-6) ||
!a_end.linear_velocity().near_point(b_begin.linear_velocity(), 1e-6) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider making tolerance higher rather than getting rid of velocity check

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.

2 participants