-
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
Waller steal #2222
base: ros2
Are you sure you want to change the base?
Waller steal #2222
Conversation
automated style fixes Co-authored-by: YellowToad3197 <[email protected]>
automated style fixes Co-authored-by: ZachB123 <[email protected]>
@@ -134,7 +134,7 @@ std::optional<RobotIntent> Defense::state_to_task(RobotIntent intent) { | |||
return intent; | |||
} else if (current_state_ == WALLING) { | |||
if (!walling_robots_.empty()) { | |||
Waller waller{waller_id_, (int)walling_robots_.size()}; | |||
Waller waller{waller_id_, robot_id_, (int)walling_robots_.size(), walling_robots_}; |
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.
Waller waller{waller_id_, robot_id_, (int)walling_robots_.size(), walling_robots_}; | |
Waller waller{waller_id_, robot_id_, static_cast<int>(walling_robots_.size()), walling_robots_}; |
@@ -2,10 +2,12 @@ | |||
|
|||
namespace strategy { | |||
|
|||
Waller::Waller(int waller_num, int total_wallers) { | |||
Waller::Waller(int waller_num, int robot_id, int total_wallers, std::vector<u_int8_t> waller_ids) { |
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.
use an initializer-list here instead. also std::move
the waller_ids vector
intent.kick_speed = 4.0; | ||
intent.dribbler_speed = 255.0; | ||
intent.is_active = true; | ||
dont_kick = false; |
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 you do an early return intent;
here instead of using the boolean and checking it later?
std::vector<u_int8_t> waller_ids_; // list of wallers | ||
|
||
// max distance away the ball can be from a waller for it to jump out and kick it | ||
const float CLEAR_DIST = 0.75; |
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.
const float CLEAR_DIST = 0.75; | |
static constexpr float CLEAR_DIST = 0.75; |
Description
Wallers will come out to kick the ball towards the opponents goal if the ball is within a certain threshold.