LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
QTorque.hpp
Go to the documentation of this file.
1/*
2 * This code is a modified version of Benjamin Jurke's work in 2015. You can read his blog post
3 * here:
4 * https://benjaminjurke.com/content/articles/2015/compile-time-numerical-unit-dimension-checking/
5 *
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
10#pragma once
11
15
16namespace okapi {
17QUANTITY_TYPE(1, 2, -2, 0, QTorque)
18
19constexpr QTorque newtonMeter = newton * meter;
20constexpr QTorque footPound = 1.355817948 * newtonMeter;
21constexpr QTorque inchPound = 0.083333333 * footPound;
22
23inline namespace literals {
24constexpr QTorque operator"" _nM(long double x) {
25 return QTorque(x);
26}
27constexpr QTorque operator"" _nM(unsigned long long int x) {
28 return QTorque(static_cast<double>(x));
29}
30constexpr QTorque operator"" _inLb(long double x) {
31 return static_cast<double>(x) * inchPound;
32}
33constexpr QTorque operator"" _inLb(unsigned long long int x) {
34 return static_cast<double>(x) * inchPound;
35}
36constexpr QTorque operator"" _ftLb(long double x) {
37 return static_cast<double>(x) * footPound;
38}
39constexpr QTorque operator"" _ftLb(unsigned long long int x) {
40 return static_cast<double>(x) * footPound;
41}
42} // namespace literals
43} // namespace okapi
#define QUANTITY_TYPE(_Mdim, _Ldim, _Tdim, _Adim, name)
Definition RQuantity.hpp:84
constexpr QTorque footPound
Definition QTorque.hpp:20
constexpr QTorque newtonMeter
Definition QTorque.hpp:19
constexpr QLength meter(1.0)
constexpr QForce newton
Definition QForce.hpp:19
@ x
Roll Axis.
constexpr QTorque inchPound
Definition QTorque.hpp:21