37 #ifndef URDF_MODEL_STATE_H 38 #define URDF_MODEL_STATE_H 45 #include "urdf_pose.h" 46 #include "urdf_twist.h" 51 static int my_round (
double x) {
54 return ((x-i) >= 0.5) ? (i + 1) : (i);
56 return (-x+i >= 0.5) ? (i - 1) : (i);
63 Time() { this->clear(); };
65 void set(
double _seconds)
67 this->sec = (int32_t)(floor(_seconds));
68 this->nsec = (int32_t)(my_round((_seconds - this->sec) * 1e9));
74 return (static_cast<double>(this->sec) +
75 static_cast<double>(this->nsec)*1e-9);
90 if (this->nsec >= 1e9)
93 this->nsec = (int32_t)(this->nsec - 1e9);
95 else if (this->nsec < 0)
98 this->nsec = (int32_t)(this->nsec + 1e9);
112 std::vector<double> position;
113 std::vector<double> velocity;
114 std::vector<double> effort;
119 this->position.clear();
120 this->velocity.clear();
121 this->effort.clear();
138 this->time_stamp.set(0);
139 this->joint_states.clear();
142 std::vector<std::shared_ptr<JointState> > joint_states;
std::string joint
joint name
Definition: urdf_model_state.h:107
Definition: urdf_model_state.h:60
Definition: urdf_model_state.h:104
Definition: urdf_color.h:46
Definition: urdf_model_state.h:125
std::string name
state name must be unique
Definition: urdf_model_state.h:128