Vanetza
 
Loading...
Searching...
No Matches
units.hpp
1#ifndef UNITS_HPP_O254IL9W
2#define UNITS_HPP_O254IL9W
3
4#include <boost/units/make_scaled_unit.hpp>
5#include <boost/units/quantity.hpp>
6#include <boost/units/systems/angle/degrees.hpp>
7#include <boost/units/systems/si/length.hpp>
8#include <cstdint>
9
10namespace vanetza
11{
12namespace geonet
13{
14
15// distance given in meter
16typedef boost::units::quantity<boost::units::si::length, uint16_t> distance_u16t;
17
18// geographical angles with 1/10 micro degree resolution
19typedef boost::units::quantity<boost::units::make_scaled_unit<
20 boost::units::degree::plane_angle,
21 boost::units::scale<10, boost::units::static_rational<-7>>
22 >::type, int32_t> geo_angle_i32t;
23
24// angle with 1 degree resolution
25typedef boost::units::quantity<boost::units::degree::plane_angle, uint16_t> angle_u16t;
26
27// heading with 0.1 degree resolution
28typedef boost::units::quantity<boost::units::make_scaled_unit<
29 boost::units::degree::plane_angle,
30 boost::units::scale<10, boost::units::static_rational<-1>>
31 >::type, uint16_t> heading_u16t;
32
33} // namespace geonet
34} // namespace vanetza
35
36#endif /* UNITS_HPP_O254IL9W */
37