robotpy / robotpy-wpilib

Moved to https://github.com/robotpy/mostrobotpy
https://robotpy.github.io
Other
169 stars 59 forks source link

Fix geometry/kinematics reprs #673

Closed auscompgeek closed 4 years ago

auscompgeek commented 4 years ago

From the Python documentation for repr():

For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(), otherwise the representation is a string enclosed in angle brackets [...]

This reverts the geometry __repr__ and fixes the kinematics __repr__ implementations to adhere to the expected behaviour of repr().

virtuald commented 4 years ago

I would rather have the units present, to remind users that these objects have units associated with them and that they're not just raw values.

auscompgeek commented 4 years ago

I would much rather be able to recreate these by just copy-pasting. You don't see the units when you instantiate these anyway.

The Java toString implementations don't include units either.

virtuald commented 4 years ago

How often are you recreating these?

auscompgeek commented 4 years ago

look I just know I'm going to screw up the maths when converting between our robot field coordinate system and the simulation coordinate system :P