Conversation
barulicm
left a comment
There was a problem hiding this comment.
Some interesting stuff in here. Excited to see a fresh start to this.
We should add more tests to fully exercise as much of the code and math as possible.
We may want to have a deeper conversation about architecture and object management in this at some point. There might be some simplifications we can make, especially on the robot tracking side where we know exactly how many robots we could be tracking.
new_super_vision_filter/package.xml
Outdated
| <?xml version="1.0"?> | ||
| <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
| <package format="3"> | ||
| <name>new_vision_filter</name> |
There was a problem hiding this comment.
Package name should match the folder name
There was a problem hiding this comment.
Do you have a preference for which we should pick? I'll change them all to match.
There was a problem hiding this comment.
I made it "new_super_vision_filter" for now, since that's more fun, but if the length is a problem I can change it to "new_vision_filter".
| PosMeasurement pos; | ||
| pos << ball_detection.pos.x, | ||
| ball_detection.pos.y; | ||
| timestamp = std::chrono::steady_clock::now(); |
There was a problem hiding this comment.
Should we think about using one of the timestamps from the vision detection frame message? Not sure if you've already considered this, and not sure if the time difference would actually matter in practice.
There was a problem hiding this comment.
Hm, I think it depends on whether we think degradation in quality/lag might be more likely from our vision filter internally or from SSL vision. Do you think it would be worth checking both? I think that switching to the SSL time stamps or adding them as an additional quality check would be straightforward.
| bot_detection.pose.position.y; | ||
| angle << bot_detection.pose.orientation.w; | ||
| robot_id = bot_detection.robot_id; | ||
| } |
There was a problem hiding this comment.
timestamp appears to not be initialized or set anywhere. Am I missing something?
There was a problem hiding this comment.
This should be initialized now in the constructor for the RobotMeasurement!
|
|
||
| #include <ssl_league_msgs/msg/vision_detection_ball.hpp> | ||
|
|
||
| class BallTrack { |
There was a problem hiding this comment.
Consider calling these types 'measurement' or 'detection'. At least in my mind, 'track' usually represents the internal filter state used to store detection history or correlate new detections to existing estimate instances.
| class BallTrack { | |
| class BallDetection { |
There was a problem hiding this comment.
Changed both this and the RobotTrack class to use the suffix "Measurement" instead.
| ++age; | ||
| } | ||
| if (health < maxHealth) { | ||
| health += 2; |
There was a problem hiding this comment.
Does health just track the staleness of the ball detections? Seems like it might be useful to include some measure of filter confidence in that metric as well.
There was a problem hiding this comment.
For now it just checks the staleness. We could make this number a combination of multiple checks, or another idea I have is to rename this something related to its function ("staleness", maybe) and then add other explicit defined checks related to the filter quality. My thought is that's a good option, since we can continue adding more as we go for now, until we have a better idea of what the best quality checks are.
| blue_robots.end(), | ||
| [bot_track](const FilteredRobot & bot){return bot_track.getId() == bot.getId();} | ||
| ); | ||
| if (it != blue_robots.end()) { |
There was a problem hiding this comment.
Is this condition inverted? It looks like you're trying to create FilteredRobot instances on demand as new IDs pop up. iterator != end means that an existing element was found.
This should also segfault as written when it takes the else branch as it does not point to a valid object.
There was a problem hiding this comment.
Whoops... this is fixed. I'm impressed (I think?) it never segfaulted in testing...
I think at least as an initial test before the PTO this weekend, I'll plan to see what generally happens to the filter state in a few conditions we're likely to see:
|
A simpler vision filter that just uses basic Kalman filtering and that's about it. It keeps the same interface as our previous filter but has a slimmed down design.
You can test it:
colcon test --packages-select new_vision_filterOr run the sim (or real) launch file:
ros2 launch ateam_bringup bringup_simulation.launch.py