FTC-12586 / FtcRobotController

3 stars 0 forks source link

Refactor odometryGlobalPosition algorithm file to use an interface #22

Closed ChainReaction12586 closed 2 years ago

ChainReaction12586 commented 2 years ago

Suggestion:

Create a Navagational interface like this: Interface PositioningSystem double getXPos() double getYPos() double getRot() void setPos(double x, double y, double rot)

Update OdometryGlobalPosition algorithm file to implement the Positing System interface

Refactor OdometryDriveSystem to take a object implementing the PositioningSystem interface. This technique is called dependency injection and makes code more flexible. This will also open the door to reuse the OdometryDrivetrain in case we choose to change positing algorithms.

wimos-ai commented 2 years ago

I refactored odometry to use the LocalizationAlgorithm. The LocalizationAlgorithm interface requires methods: double getXPos() double getYPos() double getRot() void setPos(double x, double y, double rot)

wimos-ai commented 2 years ago

I also Split Odometry into ThreeWheelOdometry and IMUOdometry