acmerobotics / road-runner-quickstart

FTC quickstart for https://github.com/acmerobotics/road-runner
BSD 3-Clause Clear License
168 stars 855 forks source link

Make MecanumDrive not final or alternative method for custom absolute localization? #367

Open j5155 opened 4 months ago

j5155 commented 4 months ago

RR FTC Version

0.1.13, quickstart 03d95d7

Observed Behavior

Currently, MecanumDrive is final, preventing classes from extending it. This stops me from easily distributing my vision relocalizer system. The only reason this has to extend MecanumDrive is because there is no better way I could see to do custom absolute localization; localizers only return relative data.

Also, as an off-topic question; is RR planning to implement official AprilTag support, or would a PR that adds it to the quickstart be accepted?

Tuning Files

No response

Robot Logs

No response

rbrott commented 4 months ago

Currently, MecanumDrive is final, preventing classes from extending it.

True, though end users can easily remove the final.

This stops me from easily distributing my vision relocalizer system.

I don't recommend distributing "out-of-tree" quickstart modules. I don't give any guarantees about the stability of the quickstart, and I want teams to modify it to fit their purposes.

Also, as an off-topic question; is RR planning to implement official AprilTag support

I do not plan on implementing AprilTag support myself.

or would a PR that adds it to the quickstart be accepted?

I could be convinced to add it to the quickstart and adapt the interfaces accordingly. I do have pretty high standards for the code and would want something that's both theoretically sound and somewhat practically proven. A full AprilTag localizer in particular would require dealing with a bunch of stuff (filtering/latency compensation, camera calibration -- intrinsics & extrinsics, tag ambiguity to name some). I worry that it wouldn't be totally foolproof, and that's a pretty important requirement for all code going in the quickstart as I've learned.

On the other hand, my standards for the docs aren't quite so high. I'm happy to take contributions styled as official sections or, more casually, as "community guides" (see https://rr.brott.dev/docs/v1-0/guides/centerstage-auto/). Of course I will still retain some editorial control.

And you're free to disregard all of my gatekeeping and market your additions separately 🙂

j5155 commented 1 month ago

As another update here, the SparkFun vision-based odometry sensor also uses absolute localization (it has both an IMU and an optical tracking sensor and automatically sums them to return an absolute pose) It would be great if there was a better way of incorporating absolute localization then making modifications to MecanumDrive. I could do that for this SparkFun sensor like I did for the AprilTag relocalization, but then they would be incompatible with each other. SparkFun sensor product page is https://www.sparkfun.com/products/24904 and the FTC code for it is https://github.com/sparkfun/SparkFun_Qwiic_OTOS_FTC_Java_Library/