odometry
BodyState.hpp
Go to the documentation of this file.
1 #ifndef __ODOMETRY_BODYSTATE_HPP__
2 #define __ODOMETRY_BODYSTATE_HPP__
3 
4 #include <base/Time.hpp>
5 
6 namespace odometry
7 {
8  static const size_t NUMBER_OF_WHEELS = 4;
9 
10  enum wheelIdx
11  {
12  REAR_LEFT = 0,
16  };
17 
20  extern bool isLeft( wheelIdx idx );
21 
24  extern bool isFront( wheelIdx idx );
25 
32  extern wheelIdx wheelIdxEnum( unsigned long idx );
33 
34  class BodyState
35  {
36  public:
37  BodyState();
38  public:
40  base::Time time;
41 
42  double getWheelPos(wheelIdx idx) const;
43  void setWheelPos(wheelIdx idx, double value);
44 
46  double wheelPos[NUMBER_OF_WHEELS];
47  };
48 }
49 
50 #endif
wheelIdx
Definition: BodyState.hpp:10
bool isLeft(wheelIdx idx)
convenience method to check if a given wheel index is on the left of the robot
Definition: BodyState.cpp:7
double getWheelPos(wheelIdx idx) const
Definition: BodyState.cpp:34
Definition: BodyState.hpp:15
Definition: BodyState.hpp:13
double wheelPos[NUMBER_OF_WHEELS]
Definition: BodyState.hpp:46
base::Time time
Definition: BodyState.hpp:40
Definition: BodyState.hpp:12
Definition: BodyState.hpp:14
bool isFront(wheelIdx idx)
convenience method to check if a given wheel index is on the front of the robot
Definition: BodyState.cpp:12
wheelIdx wheelIdxEnum(unsigned long idx)
get a wheel index from an unsigned long
Definition: BodyState.cpp:17
Definition: BodyState.cpp:5
BodyState()
Definition: BodyState.cpp:28
Definition: BodyState.hpp:34
void setWheelPos(wheelIdx idx, double value)
Definition: BodyState.cpp:39