In order to implement robot-agnostic code to e.g. determine if the robot is moving or not, we want access to forward speed and turn speed. This should be pretty simple:
Track the raw motor values in Omni2DBase and TankBase in the tank() and omni2D() methods
Provide functionality to turn this into standard form of forward and turn speed (for omni this is trivial!) in same way that moveForward, turnOnTheSpot turn standard commands into robot-specific ones
Some of this functionality existed in the past but was removed (@alexdewar any idea why? Tracking raw motor values seems useful and exactly the type of thing the robot abstraction should provide) and, additionally, switching from a standard class hierarchy of robot classes to curiously-recurring template pattern makes it irritating as I have needed to liberally scatter friend declarations around (again, can't really remember why this change was made so worried I'm missing something here @alexdewar).
In order to implement robot-agnostic code to e.g. determine if the robot is moving or not, we want access to forward speed and turn speed. This should be pretty simple:
Omni2DBase
andTankBase
in thetank()
andomni2D()
methodsmoveForward
,turnOnTheSpot
turn standard commands into robot-specific onesSome of this functionality existed in the past but was removed (@alexdewar any idea why? Tracking raw motor values seems useful and exactly the type of thing the robot abstraction should provide) and, additionally, switching from a standard class hierarchy of robot classes to curiously-recurring template pattern makes it irritating as I have needed to liberally scatter
friend
declarations around (again, can't really remember why this change was made so worried I'm missing something here @alexdewar).