#include "encoder.h"
#include "mbed.h"
#include <functional>
Go to the source code of this file.
|
template<class T > |
constexpr const T & | clamp (const T &v, const T &lo, const T &hi) |
| Clamp the value between [lo,high]. More...
|
|
template<class T > |
constexpr const T | speed_to_pps (const T &speed) |
| Convert m/s to pulse per sec(PPS). More...
|
|
template<class T > |
constexpr const T | radiansToDegrees (const T &angle) |
| Convert radians to degree. More...
|
|
◆ clamp()
template<class T >
constexpr const T & clamp |
( |
const T & |
v, |
|
|
const T & |
lo, |
|
|
const T & |
hi |
|
) |
| |
|
constexpr |
Clamp the value between [lo,high].
- Template Parameters
-
T | Type to work with. This project use mostly float. |
- Parameters
-
v | Original value. |
lo | Lower bound. |
hi | Upper bound. |
- Returns
- constexpr const T& Clamped value.
◆ speed_to_pps()
template<class T >
constexpr const T speed_to_pps |
( |
const T & |
speed | ) |
|
|
constexpr |
Convert m/s to pulse per sec(PPS).
- Template Parameters
-
T | Type to work with. This project use mostly double. |
- Parameters
-
- Returns
- constexpr const T converted pps.
◆ radiansToDegrees()
template<class T >
constexpr const T radiansToDegrees |
( |
const T & |
angle | ) |
|
|
constexpr |
Convert radians to degree.
- Template Parameters
-
T | Type to work with. This project use mostly double. |
- Parameters
-
- Returns
- constexpr const T angle in degrees