00001
00002 #ifndef PR2_MECHANISM_MSGS_MESSAGE_ACTUATORSTATISTICS_H
00003 #define PR2_MECHANISM_MSGS_MESSAGE_ACTUATORSTATISTICS_H
00004 #include <string>
00005 #include <vector>
00006 #include <ostream>
00007 #include "ros/serialization.h"
00008 #include "ros/builtin_message_traits.h"
00009 #include "ros/message_operations.h"
00010 #include "ros/message.h"
00011 #include "ros/time.h"
00012
00013
00014 namespace pr2_mechanism_msgs
00015 {
00016 template <class ContainerAllocator>
00017 struct ActuatorStatistics_ : public ros::Message
00018 {
00019 typedef ActuatorStatistics_<ContainerAllocator> Type;
00020
00021 ActuatorStatistics_()
00022 : name()
00023 , device_id(0)
00024 , timestamp()
00025 , encoder_count(0)
00026 , encoder_offset(0.0)
00027 , position(0.0)
00028 , encoder_velocity(0.0)
00029 , velocity(0.0)
00030 , calibration_reading(false)
00031 , calibration_rising_edge_valid(false)
00032 , calibration_falling_edge_valid(false)
00033 , last_calibration_rising_edge(0.0)
00034 , last_calibration_falling_edge(0.0)
00035 , is_enabled(false)
00036 , halted(false)
00037 , last_commanded_current(0.0)
00038 , last_commanded_effort(0.0)
00039 , last_executed_current(0.0)
00040 , last_executed_effort(0.0)
00041 , last_measured_current(0.0)
00042 , last_measured_effort(0.0)
00043 , motor_voltage(0.0)
00044 , num_encoder_errors(0)
00045 {
00046 }
00047
00048 ActuatorStatistics_(const ContainerAllocator& _alloc)
00049 : name(_alloc)
00050 , device_id(0)
00051 , timestamp()
00052 , encoder_count(0)
00053 , encoder_offset(0.0)
00054 , position(0.0)
00055 , encoder_velocity(0.0)
00056 , velocity(0.0)
00057 , calibration_reading(false)
00058 , calibration_rising_edge_valid(false)
00059 , calibration_falling_edge_valid(false)
00060 , last_calibration_rising_edge(0.0)
00061 , last_calibration_falling_edge(0.0)
00062 , is_enabled(false)
00063 , halted(false)
00064 , last_commanded_current(0.0)
00065 , last_commanded_effort(0.0)
00066 , last_executed_current(0.0)
00067 , last_executed_effort(0.0)
00068 , last_measured_current(0.0)
00069 , last_measured_effort(0.0)
00070 , motor_voltage(0.0)
00071 , num_encoder_errors(0)
00072 {
00073 }
00074
00075 typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _name_type;
00076 std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > name;
00077
00078 typedef int32_t _device_id_type;
00079 int32_t device_id;
00080
00081 typedef ros::Time _timestamp_type;
00082 ros::Time timestamp;
00083
00084 typedef int32_t _encoder_count_type;
00085 int32_t encoder_count;
00086
00087 typedef double _encoder_offset_type;
00088 double encoder_offset;
00089
00090 typedef double _position_type;
00091 double position;
00092
00093 typedef double _encoder_velocity_type;
00094 double encoder_velocity;
00095
00096 typedef double _velocity_type;
00097 double velocity;
00098
00099 typedef uint8_t _calibration_reading_type;
00100 uint8_t calibration_reading;
00101
00102 typedef uint8_t _calibration_rising_edge_valid_type;
00103 uint8_t calibration_rising_edge_valid;
00104
00105 typedef uint8_t _calibration_falling_edge_valid_type;
00106 uint8_t calibration_falling_edge_valid;
00107
00108 typedef double _last_calibration_rising_edge_type;
00109 double last_calibration_rising_edge;
00110
00111 typedef double _last_calibration_falling_edge_type;
00112 double last_calibration_falling_edge;
00113
00114 typedef uint8_t _is_enabled_type;
00115 uint8_t is_enabled;
00116
00117 typedef uint8_t _halted_type;
00118 uint8_t halted;
00119
00120 typedef double _last_commanded_current_type;
00121 double last_commanded_current;
00122
00123 typedef double _last_commanded_effort_type;
00124 double last_commanded_effort;
00125
00126 typedef double _last_executed_current_type;
00127 double last_executed_current;
00128
00129 typedef double _last_executed_effort_type;
00130 double last_executed_effort;
00131
00132 typedef double _last_measured_current_type;
00133 double last_measured_current;
00134
00135 typedef double _last_measured_effort_type;
00136 double last_measured_effort;
00137
00138 typedef double _motor_voltage_type;
00139 double motor_voltage;
00140
00141 typedef int32_t _num_encoder_errors_type;
00142 int32_t num_encoder_errors;
00143
00144
00145 private:
00146 static const char* __s_getDataType_() { return "pr2_mechanism_msgs/ActuatorStatistics"; }
00147 public:
00148 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00149
00150 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00151
00152 private:
00153 static const char* __s_getMD5Sum_() { return "c37184273b29627de29382f1d3670175"; }
00154 public:
00155 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00156
00157 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00158
00159 private:
00160 static const char* __s_getMessageDefinition_() { return "# This message contains the state of an actuator on the pr2 robot.\n\
00161 # An actuator contains a motor and an encoder, and is connected\n\
00162 # to a joint by a transmission\n\
00163 \n\
00164 # the name of the actuator\n\
00165 string name\n\
00166 \n\
00167 # the sequence number of the MCB in the ethercat chain. \n\
00168 # the first device in the chain gets deviced_id zero\n\
00169 int32 device_id\n\
00170 \n\
00171 # the time at which this actuator state was measured\n\
00172 time timestamp\n\
00173 \n\
00174 # the encoder position, represented by the number of encoder ticks\n\
00175 int32 encoder_count\n\
00176 \n\
00177 # The angular offset (in radians) that is added to the encoder reading, \n\
00178 # to get to the position of the actuator. This number is computed when the referece\n\
00179 # sensor is triggered during the calibration phase\n\
00180 float64 encoder_offset\n\
00181 \n\
00182 # the encoder position in radians\n\
00183 float64 position\n\
00184 \n\
00185 # the encoder velocity in encoder ticks per second\n\
00186 float64 encoder_velocity\n\
00187 \n\
00188 # the encoder velocity in radians per second\n\
00189 float64 velocity\n\
00190 \n\
00191 # the value of the calibration reading: low (false) or high (true)\n\
00192 bool calibration_reading\n\
00193 \n\
00194 # bool to indicate if the joint already triggered the rising/falling edge of the reference sensor\n\
00195 bool calibration_rising_edge_valid\n\
00196 bool calibration_falling_edge_valid\n\
00197 \n\
00198 # the encoder position when the last rising/falling edge was observed. \n\
00199 # only read this value when the calibration_rising/falling_edge_valid is true\n\
00200 float64 last_calibration_rising_edge\n\
00201 float64 last_calibration_falling_edge\n\
00202 \n\
00203 # flag to indicate if this actuator is enabled or not. \n\
00204 # An actuator can only be commanded when it is enabled.\n\
00205 bool is_enabled\n\
00206 \n\
00207 # indicates if the motor is halted. A motor can be halted because of a voltage or communication problem\n\
00208 bool halted\n\
00209 \n\
00210 # the last current/effort command that was requested\n\
00211 float64 last_commanded_current\n\
00212 float64 last_commanded_effort\n\
00213 \n\
00214 # the last current/effort command that was executed by the actuator\n\
00215 float64 last_executed_current\n\
00216 float64 last_executed_effort\n\
00217 \n\
00218 # the last current/effort that was measured by the actuator\n\
00219 float64 last_measured_current\n\
00220 float64 last_measured_effort\n\
00221 \n\
00222 # the motor voltate\n\
00223 float64 motor_voltage\n\
00224 \n\
00225 # the number of detected encoder problems \n\
00226 int32 num_encoder_errors\n\
00227 \n\
00228 \n\
00229 "; }
00230 public:
00231 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00232
00233 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00234
00235 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00236 {
00237 ros::serialization::OStream stream(write_ptr, 1000000000);
00238 ros::serialization::serialize(stream, name);
00239 ros::serialization::serialize(stream, device_id);
00240 ros::serialization::serialize(stream, timestamp);
00241 ros::serialization::serialize(stream, encoder_count);
00242 ros::serialization::serialize(stream, encoder_offset);
00243 ros::serialization::serialize(stream, position);
00244 ros::serialization::serialize(stream, encoder_velocity);
00245 ros::serialization::serialize(stream, velocity);
00246 ros::serialization::serialize(stream, calibration_reading);
00247 ros::serialization::serialize(stream, calibration_rising_edge_valid);
00248 ros::serialization::serialize(stream, calibration_falling_edge_valid);
00249 ros::serialization::serialize(stream, last_calibration_rising_edge);
00250 ros::serialization::serialize(stream, last_calibration_falling_edge);
00251 ros::serialization::serialize(stream, is_enabled);
00252 ros::serialization::serialize(stream, halted);
00253 ros::serialization::serialize(stream, last_commanded_current);
00254 ros::serialization::serialize(stream, last_commanded_effort);
00255 ros::serialization::serialize(stream, last_executed_current);
00256 ros::serialization::serialize(stream, last_executed_effort);
00257 ros::serialization::serialize(stream, last_measured_current);
00258 ros::serialization::serialize(stream, last_measured_effort);
00259 ros::serialization::serialize(stream, motor_voltage);
00260 ros::serialization::serialize(stream, num_encoder_errors);
00261 return stream.getData();
00262 }
00263
00264 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00265 {
00266 ros::serialization::IStream stream(read_ptr, 1000000000);
00267 ros::serialization::deserialize(stream, name);
00268 ros::serialization::deserialize(stream, device_id);
00269 ros::serialization::deserialize(stream, timestamp);
00270 ros::serialization::deserialize(stream, encoder_count);
00271 ros::serialization::deserialize(stream, encoder_offset);
00272 ros::serialization::deserialize(stream, position);
00273 ros::serialization::deserialize(stream, encoder_velocity);
00274 ros::serialization::deserialize(stream, velocity);
00275 ros::serialization::deserialize(stream, calibration_reading);
00276 ros::serialization::deserialize(stream, calibration_rising_edge_valid);
00277 ros::serialization::deserialize(stream, calibration_falling_edge_valid);
00278 ros::serialization::deserialize(stream, last_calibration_rising_edge);
00279 ros::serialization::deserialize(stream, last_calibration_falling_edge);
00280 ros::serialization::deserialize(stream, is_enabled);
00281 ros::serialization::deserialize(stream, halted);
00282 ros::serialization::deserialize(stream, last_commanded_current);
00283 ros::serialization::deserialize(stream, last_commanded_effort);
00284 ros::serialization::deserialize(stream, last_executed_current);
00285 ros::serialization::deserialize(stream, last_executed_effort);
00286 ros::serialization::deserialize(stream, last_measured_current);
00287 ros::serialization::deserialize(stream, last_measured_effort);
00288 ros::serialization::deserialize(stream, motor_voltage);
00289 ros::serialization::deserialize(stream, num_encoder_errors);
00290 return stream.getData();
00291 }
00292
00293 ROS_DEPRECATED virtual uint32_t serializationLength() const
00294 {
00295 uint32_t size = 0;
00296 size += ros::serialization::serializationLength(name);
00297 size += ros::serialization::serializationLength(device_id);
00298 size += ros::serialization::serializationLength(timestamp);
00299 size += ros::serialization::serializationLength(encoder_count);
00300 size += ros::serialization::serializationLength(encoder_offset);
00301 size += ros::serialization::serializationLength(position);
00302 size += ros::serialization::serializationLength(encoder_velocity);
00303 size += ros::serialization::serializationLength(velocity);
00304 size += ros::serialization::serializationLength(calibration_reading);
00305 size += ros::serialization::serializationLength(calibration_rising_edge_valid);
00306 size += ros::serialization::serializationLength(calibration_falling_edge_valid);
00307 size += ros::serialization::serializationLength(last_calibration_rising_edge);
00308 size += ros::serialization::serializationLength(last_calibration_falling_edge);
00309 size += ros::serialization::serializationLength(is_enabled);
00310 size += ros::serialization::serializationLength(halted);
00311 size += ros::serialization::serializationLength(last_commanded_current);
00312 size += ros::serialization::serializationLength(last_commanded_effort);
00313 size += ros::serialization::serializationLength(last_executed_current);
00314 size += ros::serialization::serializationLength(last_executed_effort);
00315 size += ros::serialization::serializationLength(last_measured_current);
00316 size += ros::serialization::serializationLength(last_measured_effort);
00317 size += ros::serialization::serializationLength(motor_voltage);
00318 size += ros::serialization::serializationLength(num_encoder_errors);
00319 return size;
00320 }
00321
00322 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > Ptr;
00323 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> const> ConstPtr;
00324 };
00325 typedef ::pr2_mechanism_msgs::ActuatorStatistics_<std::allocator<void> > ActuatorStatistics;
00326
00327 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics> ActuatorStatisticsPtr;
00328 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics const> ActuatorStatisticsConstPtr;
00329
00330
00331 template<typename ContainerAllocator>
00332 std::ostream& operator<<(std::ostream& s, const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> & v)
00333 {
00334 ros::message_operations::Printer< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> >::stream(s, "", v);
00335 return s;}
00336
00337 }
00338
00339 namespace ros
00340 {
00341 namespace message_traits
00342 {
00343 template<class ContainerAllocator>
00344 struct MD5Sum< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > {
00345 static const char* value()
00346 {
00347 return "c37184273b29627de29382f1d3670175";
00348 }
00349
00350 static const char* value(const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> &) { return value(); }
00351 static const uint64_t static_value1 = 0xc37184273b29627dULL;
00352 static const uint64_t static_value2 = 0xe29382f1d3670175ULL;
00353 };
00354
00355 template<class ContainerAllocator>
00356 struct DataType< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > {
00357 static const char* value()
00358 {
00359 return "pr2_mechanism_msgs/ActuatorStatistics";
00360 }
00361
00362 static const char* value(const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> &) { return value(); }
00363 };
00364
00365 template<class ContainerAllocator>
00366 struct Definition< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > {
00367 static const char* value()
00368 {
00369 return "# This message contains the state of an actuator on the pr2 robot.\n\
00370 # An actuator contains a motor and an encoder, and is connected\n\
00371 # to a joint by a transmission\n\
00372 \n\
00373 # the name of the actuator\n\
00374 string name\n\
00375 \n\
00376 # the sequence number of the MCB in the ethercat chain. \n\
00377 # the first device in the chain gets deviced_id zero\n\
00378 int32 device_id\n\
00379 \n\
00380 # the time at which this actuator state was measured\n\
00381 time timestamp\n\
00382 \n\
00383 # the encoder position, represented by the number of encoder ticks\n\
00384 int32 encoder_count\n\
00385 \n\
00386 # The angular offset (in radians) that is added to the encoder reading, \n\
00387 # to get to the position of the actuator. This number is computed when the referece\n\
00388 # sensor is triggered during the calibration phase\n\
00389 float64 encoder_offset\n\
00390 \n\
00391 # the encoder position in radians\n\
00392 float64 position\n\
00393 \n\
00394 # the encoder velocity in encoder ticks per second\n\
00395 float64 encoder_velocity\n\
00396 \n\
00397 # the encoder velocity in radians per second\n\
00398 float64 velocity\n\
00399 \n\
00400 # the value of the calibration reading: low (false) or high (true)\n\
00401 bool calibration_reading\n\
00402 \n\
00403 # bool to indicate if the joint already triggered the rising/falling edge of the reference sensor\n\
00404 bool calibration_rising_edge_valid\n\
00405 bool calibration_falling_edge_valid\n\
00406 \n\
00407 # the encoder position when the last rising/falling edge was observed. \n\
00408 # only read this value when the calibration_rising/falling_edge_valid is true\n\
00409 float64 last_calibration_rising_edge\n\
00410 float64 last_calibration_falling_edge\n\
00411 \n\
00412 # flag to indicate if this actuator is enabled or not. \n\
00413 # An actuator can only be commanded when it is enabled.\n\
00414 bool is_enabled\n\
00415 \n\
00416 # indicates if the motor is halted. A motor can be halted because of a voltage or communication problem\n\
00417 bool halted\n\
00418 \n\
00419 # the last current/effort command that was requested\n\
00420 float64 last_commanded_current\n\
00421 float64 last_commanded_effort\n\
00422 \n\
00423 # the last current/effort command that was executed by the actuator\n\
00424 float64 last_executed_current\n\
00425 float64 last_executed_effort\n\
00426 \n\
00427 # the last current/effort that was measured by the actuator\n\
00428 float64 last_measured_current\n\
00429 float64 last_measured_effort\n\
00430 \n\
00431 # the motor voltate\n\
00432 float64 motor_voltage\n\
00433 \n\
00434 # the number of detected encoder problems \n\
00435 int32 num_encoder_errors\n\
00436 \n\
00437 \n\
00438 ";
00439 }
00440
00441 static const char* value(const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> &) { return value(); }
00442 };
00443
00444 }
00445 }
00446
00447 namespace ros
00448 {
00449 namespace serialization
00450 {
00451
00452 template<class ContainerAllocator> struct Serializer< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> >
00453 {
00454 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00455 {
00456 stream.next(m.name);
00457 stream.next(m.device_id);
00458 stream.next(m.timestamp);
00459 stream.next(m.encoder_count);
00460 stream.next(m.encoder_offset);
00461 stream.next(m.position);
00462 stream.next(m.encoder_velocity);
00463 stream.next(m.velocity);
00464 stream.next(m.calibration_reading);
00465 stream.next(m.calibration_rising_edge_valid);
00466 stream.next(m.calibration_falling_edge_valid);
00467 stream.next(m.last_calibration_rising_edge);
00468 stream.next(m.last_calibration_falling_edge);
00469 stream.next(m.is_enabled);
00470 stream.next(m.halted);
00471 stream.next(m.last_commanded_current);
00472 stream.next(m.last_commanded_effort);
00473 stream.next(m.last_executed_current);
00474 stream.next(m.last_executed_effort);
00475 stream.next(m.last_measured_current);
00476 stream.next(m.last_measured_effort);
00477 stream.next(m.motor_voltage);
00478 stream.next(m.num_encoder_errors);
00479 }
00480
00481 ROS_DECLARE_ALLINONE_SERIALIZER;
00482 };
00483 }
00484 }
00485
00486 namespace ros
00487 {
00488 namespace message_operations
00489 {
00490
00491 template<class ContainerAllocator>
00492 struct Printer< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> >
00493 {
00494 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> & v)
00495 {
00496 s << indent << "name: ";
00497 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.name);
00498 s << indent << "device_id: ";
00499 Printer<int32_t>::stream(s, indent + " ", v.device_id);
00500 s << indent << "timestamp: ";
00501 Printer<ros::Time>::stream(s, indent + " ", v.timestamp);
00502 s << indent << "encoder_count: ";
00503 Printer<int32_t>::stream(s, indent + " ", v.encoder_count);
00504 s << indent << "encoder_offset: ";
00505 Printer<double>::stream(s, indent + " ", v.encoder_offset);
00506 s << indent << "position: ";
00507 Printer<double>::stream(s, indent + " ", v.position);
00508 s << indent << "encoder_velocity: ";
00509 Printer<double>::stream(s, indent + " ", v.encoder_velocity);
00510 s << indent << "velocity: ";
00511 Printer<double>::stream(s, indent + " ", v.velocity);
00512 s << indent << "calibration_reading: ";
00513 Printer<uint8_t>::stream(s, indent + " ", v.calibration_reading);
00514 s << indent << "calibration_rising_edge_valid: ";
00515 Printer<uint8_t>::stream(s, indent + " ", v.calibration_rising_edge_valid);
00516 s << indent << "calibration_falling_edge_valid: ";
00517 Printer<uint8_t>::stream(s, indent + " ", v.calibration_falling_edge_valid);
00518 s << indent << "last_calibration_rising_edge: ";
00519 Printer<double>::stream(s, indent + " ", v.last_calibration_rising_edge);
00520 s << indent << "last_calibration_falling_edge: ";
00521 Printer<double>::stream(s, indent + " ", v.last_calibration_falling_edge);
00522 s << indent << "is_enabled: ";
00523 Printer<uint8_t>::stream(s, indent + " ", v.is_enabled);
00524 s << indent << "halted: ";
00525 Printer<uint8_t>::stream(s, indent + " ", v.halted);
00526 s << indent << "last_commanded_current: ";
00527 Printer<double>::stream(s, indent + " ", v.last_commanded_current);
00528 s << indent << "last_commanded_effort: ";
00529 Printer<double>::stream(s, indent + " ", v.last_commanded_effort);
00530 s << indent << "last_executed_current: ";
00531 Printer<double>::stream(s, indent + " ", v.last_executed_current);
00532 s << indent << "last_executed_effort: ";
00533 Printer<double>::stream(s, indent + " ", v.last_executed_effort);
00534 s << indent << "last_measured_current: ";
00535 Printer<double>::stream(s, indent + " ", v.last_measured_current);
00536 s << indent << "last_measured_effort: ";
00537 Printer<double>::stream(s, indent + " ", v.last_measured_effort);
00538 s << indent << "motor_voltage: ";
00539 Printer<double>::stream(s, indent + " ", v.motor_voltage);
00540 s << indent << "num_encoder_errors: ";
00541 Printer<int32_t>::stream(s, indent + " ", v.num_encoder_errors);
00542 }
00543 };
00544
00545
00546 }
00547 }
00548
00549 #endif // PR2_MECHANISM_MSGS_MESSAGE_ACTUATORSTATISTICS_H
00550