-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: Observer improvements #131
Open
JornJorn
wants to merge
29
commits into
main
Choose a base branch
from
ObserverImprovements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
e4a4204
Only output balls that have 3+ observations
JornJorn 202cb4f
Avoid copying balls
JornJorn 6bf3738
Implement ball-robot collision for ball estimation for the Kalman. Th…
JornJorn 7d726ac
remove reset covariance
JornJorn bf57def
Add comparison operators to TeamRobotID for set inclusion
JornJorn 0f30585
Use CameraMap with data from GeoemtryFilter
JornJorn ce8c12a
Update BallFilter to contain more information
JornJorn 37ee6f6
Implemented kick detection, result not used yet
JornJorn 00a8e11
Add kickEvent
JornJorn 2a41997
Use ball model data from vision
JornJorn ab26d7d
Implement Chip/Kick Trajectories
JornJorn 7be6395
Add chip estimator
JornJorn fc5ec52
add package needed for optimization
JornJorn 8509157
Merge branch 'main' into ObserverImprovements
JornJorn 185f774
Fix docker
e1ea04f
Fix docker and tests perhaps
619a88d
Add dlib to release as well
fa73ae8
Docker fix for real
a919d2a
remove external autoref/framework as submodule, use them as image ins…
6b2832d
Oeps
6b2bb9b
Oeps
0c09dca
Finetune iteration count nonlinear kick estimator
rolfvdhulst 97b1585
Merge branch 'main' into ObserverImprovements
JornJorn 5dd52fa
Move find_package before add_library
JornJorn c1c3112
Move dlib to cpp
JornJorn 8fb6b62
Merge branch 'main' into ObserverImprovements
JornJorn 5eebae1
Detect NaN/infinities and reset filters when necessary
rolfvdhulst 382256f
Change time extrapolation and add a cap to prevent long extrapolations
rolfvdhulst e71ae8b
Check for negative time differences in extrapolation
rolfvdhulst 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 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 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 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 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 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
version: '3' | ||
|
||
services: | ||
|
||
roboteam_builder: | ||
|
This file contains 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
Submodule autoref
deleted from
6f15f5
Submodule framework
deleted from
0f5fff
This file contains 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 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
39 changes: 39 additions & 0 deletions
39
roboteam_observer/observer/include/observer/filters/shot/ChipEstimator.h
This file contains 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef CHIPESTIMATOR_H | ||
#define CHIPESTIMATOR_H | ||
|
||
#include <dlib/optimization.h> | ||
JornJorn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#include <Eigen/Dense> | ||
#include <iostream> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
#include "ShotEvent.h" | ||
#include "observer/filters/shot/ChipTrajectory.h" | ||
#include "observer/filters/vision/ball/BallParameters.h" | ||
#include "observer/filters/vision/ball/FilteredBall.h" | ||
|
||
class ChipEstimator { | ||
private: | ||
std::vector<BallObservation> ballsSinceShot; | ||
ShotEvent shotEvent; | ||
Eigen::Vector3d bestShotPos; | ||
Eigen::Vector3d bestShotVel; | ||
BallParameters ballParameters; | ||
CameraMap cameraMap; | ||
int pruneIndex = 1; | ||
bool doFirstHop = true; | ||
double bestTOff = 0.0; | ||
|
||
public: | ||
ChipEstimator(const ShotEvent& shotEvent, const BallParameters& ballParameters, const CameraMap& cameraMap); | ||
double getAverageDistance(); | ||
double getAverageDistance(Eigen::Vector3d shotPos, Eigen::Vector3d shotVel, Eigen::Vector2d shotSpin); | ||
void addFilteredBall(const BallObservation& newBall); | ||
std::pair<Eigen::Vector3d, double> noSpinBall(double tOff); | ||
Eigen::Vector3d getBestShotVel() { return bestShotVel; } | ||
Eigen::Vector3d getBestShotPos() { return bestShotPos; } | ||
Time getFirstBallTime() { return ballsSinceShot[0].timeCaptured; } | ||
}; | ||
|
||
#endif // CHIPESTIMATOR_H |
25 changes: 25 additions & 0 deletions
25
roboteam_observer/observer/include/observer/filters/shot/ChipTrajectory.h
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef CHIP_TRAJECTORY_H | ||
#define CHIP_TRAJECTORY_H | ||
|
||
#include <Eigen/Dense> | ||
#include <cmath> | ||
|
||
#include "observer/filters/shot/ShotEvent.h" | ||
#include "observer/filters/vision/ball/BallParameters.h" | ||
|
||
class ChipTrajectory { | ||
private: | ||
Eigen::Vector3d initialPos; | ||
Eigen::Vector3d initialVel; | ||
Eigen::Vector2d initialSpin; | ||
BallParameters parameters; | ||
|
||
public: | ||
ChipTrajectory(const Eigen::Vector3d& initialPos, const Eigen::Vector3d& initialVel, const Eigen::Vector2d& initialSpin, const BallParameters& ballParameters); | ||
ChipTrajectory(const Eigen::Vector3d& initialPos, const Eigen::Vector3d& initialVel, const BallParameters& ballParameters); | ||
ChipTrajectory(const Eigen::Vector2d& initialPos, const Eigen::Vector3d& initialVel, const BallParameters& ballParameters); | ||
|
||
ShotState getPositionAtTime(double time); | ||
}; | ||
|
||
#endif // CHIP_TRAJECTORY_H |
31 changes: 31 additions & 0 deletions
31
roboteam_observer/observer/include/observer/filters/shot/KickEstimator.h
This file contains 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef KICKESTIMATOR_H | ||
#define KICKESTIMATOR_H | ||
#include <dlib/optimization.h> | ||
JornJorn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#include <vector> | ||
|
||
#include "ShotEvent.h" | ||
#include "observer/filters/shot/KickTrajectory.h" | ||
#include "observer/filters/vision/ball/BallParameters.h" | ||
#include "observer/filters/vision/ball/FilteredBall.h" | ||
|
||
class KickEstimator { | ||
private: | ||
std::vector<BallObservation> ballsSinceShot; | ||
ShotEvent shotEvent; | ||
BallParameters ballParameters; | ||
int pruneIndex = 1; | ||
|
||
public: | ||
Eigen::Vector3d bestShotPos; | ||
Eigen::Vector3d bestShotVel; | ||
KickEstimator(const ShotEvent& shotEvent, const BallParameters& ballParameters); | ||
double getAverageDistance(); | ||
double getAverageDistance(Eigen::Vector3d shotPos, Eigen::Vector3d shotVel, Eigen::Vector2d shotSpin); | ||
std::pair<Eigen::Vector3d, Eigen::Vector3d> slidingBall(); | ||
Eigen::Vector2d getKickDir(); | ||
std::pair<Eigen::Vector3d, Eigen::Vector3d> noSpinBall(); | ||
void addFilteredBall(const BallObservation& newBall); | ||
Comment on lines
+21
to
+27
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. These functions need some documentation (probably not now), because their usage is not clear from their naming to me. |
||
}; | ||
|
||
#endif // KICKESTIMATOR_H |
32 changes: 32 additions & 0 deletions
32
roboteam_observer/observer/include/observer/filters/shot/KickTrajectory.h
This file contains 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef KICK_TRAJECTORY_H | ||
#define KICK_TRAJECTORY_H | ||
|
||
#include <Eigen/Dense> | ||
#include <cmath> | ||
|
||
#include "observer/filters/shot/ShotEvent.h" | ||
#include "observer/filters/vision/ball/BallParameters.h" | ||
|
||
class KickTrajectory { | ||
private: | ||
double tSwitch; | ||
Eigen::Vector2d posSwitch; | ||
Eigen::Vector2d velSwitch; | ||
Eigen::Vector2d accSlide; | ||
Eigen::Vector2d accSlideSpin; | ||
Eigen::Vector2d accRoll; | ||
Eigen::Vector2d initialPos; | ||
Eigen::Vector2d initialVel; | ||
Eigen::Vector2d initialSpin; | ||
BallParameters parameters; | ||
|
||
public: | ||
KickTrajectory(const Eigen::Vector2d& initialPos, const Eigen::Vector2d& initialVel, const Eigen::Vector2d& initialSpin, const BallParameters& ballParameters); | ||
KickTrajectory(const Eigen::Vector2d& initialPos, const Eigen::Vector2d& initialVel, const BallParameters& ballParameters); | ||
KickTrajectory(const Eigen::Vector3d& initialPos, const Eigen::Vector3d& initialVel, const Eigen::Vector2d& initialSpin, const BallParameters& ballParameters); | ||
|
||
ShotState getPositionAtTime(double time); | ||
double getTimeAtRest(); | ||
}; | ||
|
||
#endif // KICK_TRAJECTORY_H |
24 changes: 24 additions & 0 deletions
24
roboteam_observer/observer/include/observer/filters/shot/ShotEvent.h
This file contains 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef SHOTEVENT_H | ||
#define SHOTEVENT_H | ||
|
||
#include "observer/filters/vision/CameraMap.h" | ||
#include "observer/filters/vision/DetectionFrame.h" | ||
#include "observer/filters/vision/GeometryFilter.h" | ||
#include "observer/filters/vision/RobotFeedbackFilter.h" | ||
#include "observer/filters/vision/ball/BallFilter.h" | ||
#include "observer/filters/vision/robot/RobotFilter.h" | ||
#include "observer/parameters/RobotParameterDatabase.h" | ||
|
||
struct ShotEvent { | ||
TeamRobotID shootingBot; | ||
RobotPos shottingBotPos; | ||
Eigen::Vector2d ballPosition; | ||
Time time; | ||
std::vector<FilteredBall> ballsSinceShot; | ||
}; | ||
struct ShotState { | ||
Eigen::Vector3d pos; | ||
Eigen::Vector3d vel; | ||
}; | ||
|
||
#endif // SHOTEVENT_H |
This file contains 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.
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.
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.
Never do this, this always gives problems down the line because you're compiling some file that you're not aware of. It's always better to be explicit.