robotpy / robotpy-wpilib

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

Add feet/degrees to various geometry/trajectory things #626

Closed virtuald closed 4 years ago

virtuald commented 4 years ago

Internally everything uses meters/radians. In C++ this isn't a big deal because the conversions are done for you automatically. For us, we have to pick statically. My inclination is to add static methods, and keep the existing constructors that use meters:

Pose2d.fromFeet(1,2)

Etc. Not sure about the right naming for this.

MrRSquared commented 4 years ago

Hello, I see this is closed. Did you all add feet/second? If not, I would like this, but can we not just translate them in code ourselves? input = x*3.28084 #x is the feet we want to input into the function. output = y/3.28084 #y is the feet we want to get out of the function.

auscompgeek commented 4 years ago

Where do you see this is closed? I still see the issue open.

I'm personally inclined to do what WPILib did for Java: keep everything in metres, and provide convenience conversion functions between units (which I think we might already do in robotpy-wpilib-utilities).

MrRSquared commented 4 years ago

I think that sounds like the best way from my limited experience point of view. As for closed, I swear when I looked earlier, the two buttons on the top of the page were the red Closed buttons. Now, it is just the linked mention in #618. So, definitely still open.

virtuald commented 4 years ago

The way I've decided to deal with this is by adding various getters/setters and static methods that take non-SI units where it makes sense. This has seemed like a sensible compromise to me, and I'm pretty happy with it so far.