-
Notifications
You must be signed in to change notification settings - Fork 127
Brakebream availability in gameplay #3462
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
Merged
zuperzane
merged 40 commits into
UBC-Thunderbots:master
from
zuperzane:zane/brakebream_availability
Jun 13, 2025
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
6345128
adding breakbream status to robot status and setting it in robot dete…
537c17d
working on compiliing
0509db4
ok i think it may all be for nothing since robotdetections are also i…
2d05a5c
frgttocommit
adbf0db
i think its working
cb83db5
working accessable
377b58d
removed comments not finished
9f9be4e
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] aee119d
adding breakbream status to robot status and setting it in robot dete…
1a20fb2
working on compiliing
52772ba
ok i think it may all be for nothing since robotdetections are also i…
db59c18
frgttocommit
1035d88
i think its working
79a548b
working accessable
8c8e022
removed comments not finished
7f80363
test fix
ae4a000
merge
1567cec
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 56a40e2
test improvements?
f4021e3
merge
a26ec53
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 34dd2c1
tests and docs
4a26315
Merge branch 'zane/brakebream_availability' of github.com:zuperzane/z…
42ae62b
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 0364416
space
3b62efa
Merge branch 'zane/brakebream_availability' of github.com:zuperzane/z…
5b08bdc
isneardribbler change
10058f2
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 817a279
tests and little bugs
832ce6b
merge
dc2b330
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 5690655
mini fixes
de6811e
docs
b3e475f
Merge branch 'zane/brakebream_availability' of github.com:zuperzane/z…
041ffc3
test fixes
57e6d5e
accidentally commited goalie changes
a9e1a4a
Update src/software/sensor_fusion/filter/robot_filter.h
zuperzane c8830d5
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] d796638
tests
937a41d
i forgot to edit this test lol
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,27 @@ | |
| #include "software/ai/evaluation/time_to_travel.h" | ||
| #include "software/logger/logger.h" | ||
|
|
||
| Robot::Robot(RobotId id, const Point &position, const Vector &velocity, | ||
| const Angle &orientation, const AngularVelocity &angular_velocity, | ||
| const Timestamp ×tamp, bool breakbeam_tripped, | ||
| const std::set<RobotCapability> &unavailable_capabilities, | ||
| const RobotConstants_t &robot_constants) | ||
| : id_(id), | ||
| current_state_(position, velocity, orientation, angular_velocity, | ||
| breakbeam_tripped), | ||
| timestamp_(timestamp), | ||
| unavailable_capabilities_(unavailable_capabilities), | ||
| robot_constants_(robot_constants) | ||
| { | ||
| } | ||
|
|
||
| Robot::Robot(RobotId id, const Point &position, const Vector &velocity, | ||
| const Angle &orientation, const AngularVelocity &angular_velocity, | ||
| const Timestamp ×tamp, | ||
| const std::set<RobotCapability> &unavailable_capabilities, | ||
| const RobotConstants_t &robot_constants) | ||
| : id_(id), | ||
| current_state_(position, velocity, orientation, angular_velocity), | ||
| current_state_(position, velocity, orientation, angular_velocity, false), | ||
| timestamp_(timestamp), | ||
| unavailable_capabilities_(unavailable_capabilities), | ||
| robot_constants_(robot_constants) | ||
|
|
@@ -90,6 +104,11 @@ Angle Robot::orientation() const | |
| return current_state_.orientation(); | ||
| } | ||
|
|
||
| bool Robot::breakbeamTripped() const | ||
| { | ||
| return current_state_.breakbeamTripped(); | ||
| } | ||
|
|
||
| AngularVelocity Robot::angularVelocity() const | ||
| { | ||
| return current_state_.angularVelocity(); | ||
|
|
@@ -99,17 +118,19 @@ bool Robot::isNearDribbler(const Point &test_point, double TOLERANCE) const | |
| { | ||
| const double POSSESSION_THRESHOLD_METERS = DIST_TO_FRONT_OF_ROBOT_METERS + TOLERANCE; | ||
|
|
||
| bool breakbeam = this->breakbeamTripped(); | ||
| Vector vector_to_test_point = test_point - position(); | ||
| if (vector_to_test_point.length() > POSSESSION_THRESHOLD_METERS) | ||
| { | ||
| return false; | ||
| return breakbeam; | ||
| } | ||
| else | ||
| { | ||
| // check that ball is in a 90-degree cone in front of the robot | ||
| auto ball_to_robot_angle = | ||
| orientation().minDiff(vector_to_test_point.orientation()); | ||
| return (ball_to_robot_angle < Angle::fromDegrees(45.0)); | ||
| bool vision_confirm_ball = (ball_to_robot_angle < Angle::fromDegrees(45.0)); | ||
| return breakbeam || vision_confirm_ball; | ||
|
itsarune marked this conversation as resolved.
Comment on lines
+132
to
+133
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this an OR not an AND?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in case vision noise is preventing AI from realizing the ball is in the breakbeam |
||
| } | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.