How do teams do corrections to robot position to score or pickup a game piece while following a path? #294
WarrenReynolds
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As the discussion name suggests, I was wondering how teams with a swerve drive base to do fine adjustments to the robots position while executing a path following command.
Some scenarios might be, when intaking a game piece, slightly moving the robot to the left, right or further forward at a stop point based on a vision location of a game piece.
or
When scoring a game piece move the robot to the left or right for a game piece that isn't perfectly centered in the intake or for a robot that isn't perfectly aligned with the reflective tape.
I can see a couple of options here to address this problem. One is to shift the odometry values so that the path following corrects the error and moves the robot towards the goal. This could be done with a vision update to odometry, but I'm reluctant to do this as sometimes the game pieces aren't placed exactly in the correct positions on the field or they have been bumped off the mark by another robot, and if you were to adjust your official odometry position based on an incorrect position of a game piece, then the remaining path following could collide with some other structure on the field.
What I'd like to see is some sort of option that allows you the ability to hand over the control of the drive subsystem to a different command at some point in the path. This way pathplanner's path following could get you close to position and then another command like "Align and intake" or "Align and score" could take control of the drivebase to intake or score a game piece.
Alternatively, if the option existing to feed in a corrective Delta X or Delta Y (based on robot coordinates) into the trajectory follower while it was executing would also achieve this. For example let assume your robot is intaking a game piece in auto and the robot is driving straight at the game piece for the last 0.5m before intaking. If a marker command fired at the "0.5m from target" mark, that took a vision shot on the game piece. It calculates that it has to move the robot 200mm to the left in order to intake a cube correctly.
If this correction could be feed into the trajectory follower, the follower could rotate this error to field coordinates and then effectively push/ adjust the odometry values being used by the follower so that the inbuild error correction of the path following would adjust the robot position so that the robot perfectly lined up to intake the game piece. After the game piece has been intaked ,another command could fire that says return the odometry values to what the robot thinks they are (ie Remove the Delta X error).
Maybe these commands that pass errors into the follower would need some sort of trapezoidal/ slew rate passed in at the same time as the Delta X error is passed in, so that the path follower doesn't instantaneously what to jump sideways to correct for a 200mm error. Effectively moving the returned coordinates of odometry slowly so that pathfollower corrective errors aren't discontinuous.
I don't know what the best option is here. Do you hand over full control of the drivebase and let another command take control to do the last minute corrections or do you modify path planner to take corrective errors into the path follower so that it mantains control and it adjusts or maybe you just implement this yourself in a wrapper around the call that returns the odometry values.
As I typing this I'm thinking leave path planner as is and making a wrapper around the get pose method that fudges your position might be the best option.
Anyway, what are other teams doing in this space?
Beta Was this translation helpful? Give feedback.
All reactions