LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
QAcceleration.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(0, 1, -2, 0, QAcceleration)
18
19constexpr QAcceleration mps2 = meter / (second * second);
20constexpr QAcceleration G = 9.80665 * mps2;
21
22inline namespace literals {
23constexpr QAcceleration operator"" _mps2(long double x) {
24 return QAcceleration(x);
25}
26constexpr QAcceleration operator"" _mps2(unsigned long long int x) {
27 return QAcceleration(static_cast<double>(x));
28}
29constexpr QAcceleration operator"" _G(long double x) {
30 return static_cast<double>(x) * G;
31}
32constexpr QAcceleration operator"" _G(unsigned long long int x) {
33 return static_cast<double>(x) * G;
34}
35} // namespace literals
36} // namespace okapi
#define QUANTITY_TYPE(_Mdim, _Ldim, _Tdim, _Adim, name)
Definition RQuantity.hpp:84
constexpr QLength meter(1.0)
constexpr QAcceleration G
constexpr QAcceleration mps2
@ x
Roll Axis.
constexpr QTime second(1.0)