-
Notifications
You must be signed in to change notification settings - Fork 186
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
base: ros2
Are you sure you want to change the base?
Conversation
automated style fixes Co-authored-by: sanatd33 <[email protected]>
automated style fixes Co-authored-by: sid-parikh <[email protected]>
|
||
// List of obstacles | ||
ShapeSet static_obstacles; | ||
std::vector<DynamicObstacle> dynamic_obstacles; | ||
fill_obstacles(plan_request, &static_obstacles, &dynamic_obstacles, false); | ||
|
||
if (current_state_ == Intercept) { |
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 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) { |
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.
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? |
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.
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, |
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.
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++) { |
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.
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) { |
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.
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, |
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.
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) || |
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.
Consider making tolerance higher rather than getting rid of velocity check
Collect now can properly get stationary and moving balls