bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
unit_converter.h
Go to the documentation of this file.
1#ifndef BITSIM_UTILS_UNIT_CONVERTER_H
2#define BITSIM_UTILS_UNIT_CONVERTER_H
3
8
10#include "bitsim/bitsim_types.h"
11
12namespace bitsim
13{
15{
16
22{
23 return (2.0 * bitsim::consts::maths::PI * rpm) / 60.0;
24}
25
30inline real_t angular_speed_to_linear_speed(real_t r, real_t w) { return r * w; }
31
36inline real_t rad_to_degrees(real_t rad) { return (rad * 180.0) / bitsim::consts::maths::PI; }
37
42inline real_t degrees_to_rad(real_t degs) { return (degs * bitsim::consts::maths::PI) / 180.0; }
43
44} // namespace utils::unit_converter
45} // namespace bitsim
46
47#endif // BITSIM_UTILS_UNIT_CONVERTER_H
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
const real_t PI
The PI constant.
Definition bitsim_consts.h:63
Definition unit_converter.h:15
real_t rad_to_degrees(real_t rad)
Definition unit_converter.h:36
real_t rpm_to_angular_speed(uint_t rpm)
Definition unit_converter.h:21
real_t angular_speed_to_linear_speed(real_t r, real_t w)
Definition unit_converter.h:30
real_t degrees_to_rad(real_t degs)
Definition unit_converter.h:42
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20