Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wpiunits] Add Feedforward unit types #7064

Closed
wants to merge 12 commits into from
21 changes: 18 additions & 3 deletions wpiunits/generate_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def output(outPath, outfn, contents):
"LinearAcceleration",
"LinearMomentum",
"LinearVelocity",
"LinearVelocityFeedForward",
narmstro2020 marked this conversation as resolved.
Show resolved Hide resolved
"Mass",
"MomentOfInertia",
"Mult<?, ?>",
Expand Down Expand Up @@ -182,7 +183,15 @@ def output(outPath, outfn, contents):
"LinearVelocity": {
"base_unit": "MetersPerSecond",
"multiply": {"Time": "Distance", "Frequency": "LinearAcceleration"},
"divide": {"Time": "LinearAcceleration"},
"divide": {
"Time": "LinearAcceleration",
"LinearVelocityFeedForward": "Voltage",
},
},
"LinearVelocityFeedForward": {
"base_unit": "VoltsPerMetersPerSecond",
"multiply": {"LinearVelocity": "Voltage"},
"divide": {},
},
"Mass": {
"base_unit": "Kilograms",
Expand Down Expand Up @@ -261,7 +270,14 @@ def output(outPath, outfn, contents):
"multiply": {},
"divide": {},
},
"Voltage": {"base_unit": "Volts", "multiply": {"Current": "Power"}, "divide": {}},
"Voltage": {
"base_unit": "Volts",
"multiply": {"Current": "Power"},
"divide": {
"LinearVelocity": "LinearVelocityFeedForward",
"LinearVelocityFeedForward": "LinearVelocity",
},
},
}


Expand Down Expand Up @@ -311,7 +327,6 @@ def mtou(measure_name):


def main():

dirname, _ = os.path.split(os.path.abspath(__file__))

env = Environment(
Expand Down
Loading