00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00026 #ifndef JSPACE_STATE_HPP
00027 #define JSPACE_STATE_HPP
00028
00029 #include <jspace/wrap_eigen.hpp>
00030
00031 namespace jspace {
00032
00033 class State
00034 {
00035 public:
00036 typedef enum {
00037 COMPARE_ACQUISITION_TIME = 0x1,
00038 COMPARE_POSITION = 0x2,
00039 COMPARE_VELOCITY = 0x4,
00040 COMPARE_FORCE = 0x8,
00041 COMPARE_ALL = 0xf
00042 } compare_flags_t;
00043
00044 State();
00045 State(State const & orig);
00046 State(size_t npos, size_t nvel, size_t nforce);
00047
00052 void init(size_t npos, size_t nvel, size_t nforce);
00053
00065 void resizeAndPadWithZeros(size_t npos, size_t nvel, size_t nforce);
00066
00072 bool equal(State const & rhs,
00073 int flags = COMPARE_POSITION | COMPARE_VELOCITY,
00074 double precision = 1e-3) const;
00075
00076 State & operator = (State const & rhs);
00077
00078 size_t time_sec_;
00079 size_t time_usec_;
00080 Vector position_;
00081 Vector velocity_;
00082 Vector force_;
00083 };
00084
00085 }
00086
00087 #endif // JSPACE_STATE_HPP