Skip to content
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

How to us April Tag for re-localization #101

Open
pgaston opened this issue Mar 4, 2024 · 4 comments
Open

How to us April Tag for re-localization #101

pgaston opened this issue Mar 4, 2024 · 4 comments

Comments

@pgaston
Copy link

pgaston commented Mar 4, 2024

(Using meepmeep here - hopefully that isn't the issue... Any help is appreciated! I tried reddit, but didn't get any takers.
Hopefully I'm not too far out in left field...)

Two thoughts on how to integrate April Tags into our auto - using roadrunner 1.0... (btw, rr + meepmeep looks great!)

  1. In a large auto TrajectorySecuence, use addDisplacementMarker when we want to re-localize. This doesn't work. I'm assuming (?) that when the TrajectorySecuence did the 'build()' it baked in poses? Or is this a meepmeep interaction? When the new bot pose is set, meepmeep flashes the robot in the new position, then immediately continues ignoring the changed position.
    // Drop off second one .splineTo(new Vector2d(aprilTagDropoff.getX(),aprilTagDropoff.getY()),aprilTagDropoff.getHeading()) // Read AprilTag for re-localization .addDisplacementMarker(() -> { // This runs after the last splineTo completes - we want to be mostly stopped for april tags to work currentPose = getAprilTagPose() // current pose if we don't see the AT // Testing - re-localize enough so can see on meepmeep Pose2d testPose = new Pose2d(currentPose.getX()-20,currentPose.getY(),currentPose.getHeading()); myBot.setPose(testPose); // relocalized - but not working })
  2. Use multiple TrajectorySequence (s) - with the AT read between them. Similar to 0.56 . This isn't working for me - in the example below only the second/last TrajectorySequence is run.
    myBot.followTrajectorySequence(tsAlpha); myBot.setPose(getAprilTagPose()); // will return currentPose if AT not found TrajectorySequence tsToDropOff = myBot.getDrive().trajectorySequenceBuilder(myBot.getPose()) // Drop off second one .splineTo(new Vector2d(aprilTagDropoff.getX(),aprilTagDropoff.getY()),aprilTagDropoff.getHeading()) .build(); myBot.followTrajectorySequence(tsToDropOff);
@pgaston
Copy link
Author

pgaston commented Mar 4, 2024

Or I could just be lost... meepmeep works well at least!

@rbrott
Copy link
Member

rbrott commented Mar 4, 2024

using roadrunner 1.0...

I'm confused because you mention RR 1.0 but then talk about trajectory sequences below which are a 0.5 quickstart feature. The API in your examples is also 0.5.

(Using meepmeep here - hopefully that isn't the issue... Any help is appreciated! I tried reddit, but didn't get any takers. Hopefully I'm not too far out in left field...)

MeepMeep isn't a great place to experiment with relocalization. It only knows about the desired trajectory with its perfect poses.

When the new bot pose is set, meepmeep flashes the robot in the new position, then immediately continues ignoring the changed position.

This is pretty much what I would expect.

Check out acmerobotics/road-runner-quickstart#367 for a better starting point.

@pgaston
Copy link
Author

pgaston commented Mar 4, 2024 via email

@pgaston
Copy link
Author

pgaston commented Mar 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants