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 <map>
00007 #include <ostream>
00008 #include "ros/serialization.h"
00009 #include "ros/builtin_message_traits.h"
00010 #include "ros/message_operations.h"
00011 #include "ros/time.h"
00012
00013 #include "ros/macros.h"
00014
00015 #include "ros/assert.h"
00016
00017
00018 namespace pr2_mechanism_msgs
00019 {
00020 template <class ContainerAllocator>
00021 struct ActuatorStatistics_ {
00022 typedef ActuatorStatistics_<ContainerAllocator> Type;
00023
00024 ActuatorStatistics_()
00025 : name()
00026 , device_id(0)
00027 , timestamp()
00028 , encoder_count(0)
00029 , encoder_offset(0.0)
00030 , position(0.0)
00031 , encoder_velocity(0.0)
00032 , velocity(0.0)
00033 , calibration_reading(false)
00034 , calibration_rising_edge_valid(false)
00035 , calibration_falling_edge_valid(false)
00036 , last_calibration_rising_edge(0.0)
00037 , last_calibration_falling_edge(0.0)
00038 , is_enabled(false)
00039 , halted(false)
00040 , last_commanded_current(0.0)
00041 , last_commanded_effort(0.0)
00042 , last_executed_current(0.0)
00043 , last_executed_effort(0.0)
00044 , last_measured_current(0.0)
00045 , last_measured_effort(0.0)
00046 , motor_voltage(0.0)
00047 , num_encoder_errors(0)
00048 {
00049 }
00050
00051 ActuatorStatistics_(const ContainerAllocator& _alloc)
00052 : name(_alloc)
00053 , device_id(0)
00054 , timestamp()
00055 , encoder_count(0)
00056 , encoder_offset(0.0)
00057 , position(0.0)
00058 , encoder_velocity(0.0)
00059 , velocity(0.0)
00060 , calibration_reading(false)
00061 , calibration_rising_edge_valid(false)
00062 , calibration_falling_edge_valid(false)
00063 , last_calibration_rising_edge(0.0)
00064 , last_calibration_falling_edge(0.0)
00065 , is_enabled(false)
00066 , halted(false)
00067 , last_commanded_current(0.0)
00068 , last_commanded_effort(0.0)
00069 , last_executed_current(0.0)
00070 , last_executed_effort(0.0)
00071 , last_measured_current(0.0)
00072 , last_measured_effort(0.0)
00073 , motor_voltage(0.0)
00074 , num_encoder_errors(0)
00075 {
00076 }
00077
00078 typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _name_type;
00079 std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > name;
00080
00081 typedef int32_t _device_id_type;
00082 int32_t device_id;
00083
00084 typedef ros::Time _timestamp_type;
00085 ros::Time timestamp;
00086
00087 typedef int32_t _encoder_count_type;
00088 int32_t encoder_count;
00089
00090 typedef double _encoder_offset_type;
00091 double encoder_offset;
00092
00093 typedef double _position_type;
00094 double position;
00095
00096 typedef double _encoder_velocity_type;
00097 double encoder_velocity;
00098
00099 typedef double _velocity_type;
00100 double velocity;
00101
00102 typedef uint8_t _calibration_reading_type;
00103 uint8_t calibration_reading;
00104
00105 typedef uint8_t _calibration_rising_edge_valid_type;
00106 uint8_t calibration_rising_edge_valid;
00107
00108 typedef uint8_t _calibration_falling_edge_valid_type;
00109 uint8_t calibration_falling_edge_valid;
00110
00111 typedef double _last_calibration_rising_edge_type;
00112 double last_calibration_rising_edge;
00113
00114 typedef double _last_calibration_falling_edge_type;
00115 double last_calibration_falling_edge;
00116
00117 typedef uint8_t _is_enabled_type;
00118 uint8_t is_enabled;
00119
00120 typedef uint8_t _halted_type;
00121 uint8_t halted;
00122
00123 typedef double _last_commanded_current_type;
00124 double last_commanded_current;
00125
00126 typedef double _last_commanded_effort_type;
00127 double last_commanded_effort;
00128
00129 typedef double _last_executed_current_type;
00130 double last_executed_current;
00131
00132 typedef double _last_executed_effort_type;
00133 double last_executed_effort;
00134
00135 typedef double _last_measured_current_type;
00136 double last_measured_current;
00137
00138 typedef double _last_measured_effort_type;
00139 double last_measured_effort;
00140
00141 typedef double _motor_voltage_type;
00142 double motor_voltage;
00143
00144 typedef int32_t _num_encoder_errors_type;
00145 int32_t num_encoder_errors;
00146
00147
00148 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > Ptr;
00149 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> const> ConstPtr;
00150 boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
00151 };
00152 typedef ::pr2_mechanism_msgs::ActuatorStatistics_<std::allocator<void> > ActuatorStatistics;
00153
00154 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics> ActuatorStatisticsPtr;
00155 typedef boost::shared_ptr< ::pr2_mechanism_msgs::ActuatorStatistics const> ActuatorStatisticsConstPtr;
00156
00157
00158 template<typename ContainerAllocator>
00159 std::ostream& operator<<(std::ostream& s, const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> & v)
00160 {
00161 ros::message_operations::Printer< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> >::stream(s, "", v);
00162 return s;}
00163
00164 }
00165
00166 namespace ros
00167 {
00168 namespace message_traits
00169 {
00170 template<class ContainerAllocator> struct IsMessage< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > : public TrueType {};
00171 template<class ContainerAllocator> struct IsMessage< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> const> : public TrueType {};
00172 template<class ContainerAllocator>
00173 struct MD5Sum< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > {
00174 static const char* value()
00175 {
00176 return "c37184273b29627de29382f1d3670175";
00177 }
00178
00179 static const char* value(const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> &) { return value(); }
00180 static const uint64_t static_value1 = 0xc37184273b29627dULL;
00181 static const uint64_t static_value2 = 0xe29382f1d3670175ULL;
00182 };
00183
00184 template<class ContainerAllocator>
00185 struct DataType< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > {
00186 static const char* value()
00187 {
00188 return "pr2_mechanism_msgs/ActuatorStatistics";
00189 }
00190
00191 static const char* value(const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> &) { return value(); }
00192 };
00193
00194 template<class ContainerAllocator>
00195 struct Definition< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> > {
00196 static const char* value()
00197 {
00198 return "# This message contains the state of an actuator on the pr2 robot.\n\
00199 # An actuator contains a motor and an encoder, and is connected\n\
00200 # to a joint by a transmission\n\
00201 \n\
00202 # the name of the actuator\n\
00203 string name\n\
00204 \n\
00205 # the sequence number of the MCB in the ethercat chain. \n\
00206 # the first device in the chain gets deviced_id zero\n\
00207 int32 device_id\n\
00208 \n\
00209 # the time at which this actuator state was measured\n\
00210 time timestamp\n\
00211 \n\
00212 # the encoder position, represented by the number of encoder ticks\n\
00213 int32 encoder_count\n\
00214 \n\
00215 # The angular offset (in radians) that is added to the encoder reading, \n\
00216 # to get to the position of the actuator. This number is computed when the referece\n\
00217 # sensor is triggered during the calibration phase\n\
00218 float64 encoder_offset\n\
00219 \n\
00220 # the encoder position in radians\n\
00221 float64 position\n\
00222 \n\
00223 # the encoder velocity in encoder ticks per second\n\
00224 float64 encoder_velocity\n\
00225 \n\
00226 # the encoder velocity in radians per second\n\
00227 float64 velocity\n\
00228 \n\
00229 # the value of the calibration reading: low (false) or high (true)\n\
00230 bool calibration_reading\n\
00231 \n\
00232 # bool to indicate if the joint already triggered the rising/falling edge of the reference sensor\n\
00233 bool calibration_rising_edge_valid\n\
00234 bool calibration_falling_edge_valid\n\
00235 \n\
00236 # the encoder position when the last rising/falling edge was observed. \n\
00237 # only read this value when the calibration_rising/falling_edge_valid is true\n\
00238 float64 last_calibration_rising_edge\n\
00239 float64 last_calibration_falling_edge\n\
00240 \n\
00241 # flag to indicate if this actuator is enabled or not. \n\
00242 # An actuator can only be commanded when it is enabled.\n\
00243 bool is_enabled\n\
00244 \n\
00245 # indicates if the motor is halted. A motor can be halted because of a voltage or communication problem\n\
00246 bool halted\n\
00247 \n\
00248 # the last current/effort command that was requested\n\
00249 float64 last_commanded_current\n\
00250 float64 last_commanded_effort\n\
00251 \n\
00252 # the last current/effort command that was executed by the actuator\n\
00253 float64 last_executed_current\n\
00254 float64 last_executed_effort\n\
00255 \n\
00256 # the last current/effort that was measured by the actuator\n\
00257 float64 last_measured_current\n\
00258 float64 last_measured_effort\n\
00259 \n\
00260 # the motor voltate\n\
00261 float64 motor_voltage\n\
00262 \n\
00263 # the number of detected encoder problems \n\
00264 int32 num_encoder_errors\n\
00265 \n\
00266 \n\
00267 ";
00268 }
00269
00270 static const char* value(const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> &) { return value(); }
00271 };
00272
00273 }
00274 }
00275
00276 namespace ros
00277 {
00278 namespace serialization
00279 {
00280
00281 template<class ContainerAllocator> struct Serializer< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> >
00282 {
00283 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00284 {
00285 stream.next(m.name);
00286 stream.next(m.device_id);
00287 stream.next(m.timestamp);
00288 stream.next(m.encoder_count);
00289 stream.next(m.encoder_offset);
00290 stream.next(m.position);
00291 stream.next(m.encoder_velocity);
00292 stream.next(m.velocity);
00293 stream.next(m.calibration_reading);
00294 stream.next(m.calibration_rising_edge_valid);
00295 stream.next(m.calibration_falling_edge_valid);
00296 stream.next(m.last_calibration_rising_edge);
00297 stream.next(m.last_calibration_falling_edge);
00298 stream.next(m.is_enabled);
00299 stream.next(m.halted);
00300 stream.next(m.last_commanded_current);
00301 stream.next(m.last_commanded_effort);
00302 stream.next(m.last_executed_current);
00303 stream.next(m.last_executed_effort);
00304 stream.next(m.last_measured_current);
00305 stream.next(m.last_measured_effort);
00306 stream.next(m.motor_voltage);
00307 stream.next(m.num_encoder_errors);
00308 }
00309
00310 ROS_DECLARE_ALLINONE_SERIALIZER;
00311 };
00312 }
00313 }
00314
00315 namespace ros
00316 {
00317 namespace message_operations
00318 {
00319
00320 template<class ContainerAllocator>
00321 struct Printer< ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> >
00322 {
00323 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::pr2_mechanism_msgs::ActuatorStatistics_<ContainerAllocator> & v)
00324 {
00325 s << indent << "name: ";
00326 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.name);
00327 s << indent << "device_id: ";
00328 Printer<int32_t>::stream(s, indent + " ", v.device_id);
00329 s << indent << "timestamp: ";
00330 Printer<ros::Time>::stream(s, indent + " ", v.timestamp);
00331 s << indent << "encoder_count: ";
00332 Printer<int32_t>::stream(s, indent + " ", v.encoder_count);
00333 s << indent << "encoder_offset: ";
00334 Printer<double>::stream(s, indent + " ", v.encoder_offset);
00335 s << indent << "position: ";
00336 Printer<double>::stream(s, indent + " ", v.position);
00337 s << indent << "encoder_velocity: ";
00338 Printer<double>::stream(s, indent + " ", v.encoder_velocity);
00339 s << indent << "velocity: ";
00340 Printer<double>::stream(s, indent + " ", v.velocity);
00341 s << indent << "calibration_reading: ";
00342 Printer<uint8_t>::stream(s, indent + " ", v.calibration_reading);
00343 s << indent << "calibration_rising_edge_valid: ";
00344 Printer<uint8_t>::stream(s, indent + " ", v.calibration_rising_edge_valid);
00345 s << indent << "calibration_falling_edge_valid: ";
00346 Printer<uint8_t>::stream(s, indent + " ", v.calibration_falling_edge_valid);
00347 s << indent << "last_calibration_rising_edge: ";
00348 Printer<double>::stream(s, indent + " ", v.last_calibration_rising_edge);
00349 s << indent << "last_calibration_falling_edge: ";
00350 Printer<double>::stream(s, indent + " ", v.last_calibration_falling_edge);
00351 s << indent << "is_enabled: ";
00352 Printer<uint8_t>::stream(s, indent + " ", v.is_enabled);
00353 s << indent << "halted: ";
00354 Printer<uint8_t>::stream(s, indent + " ", v.halted);
00355 s << indent << "last_commanded_current: ";
00356 Printer<double>::stream(s, indent + " ", v.last_commanded_current);
00357 s << indent << "last_commanded_effort: ";
00358 Printer<double>::stream(s, indent + " ", v.last_commanded_effort);
00359 s << indent << "last_executed_current: ";
00360 Printer<double>::stream(s, indent + " ", v.last_executed_current);
00361 s << indent << "last_executed_effort: ";
00362 Printer<double>::stream(s, indent + " ", v.last_executed_effort);
00363 s << indent << "last_measured_current: ";
00364 Printer<double>::stream(s, indent + " ", v.last_measured_current);
00365 s << indent << "last_measured_effort: ";
00366 Printer<double>::stream(s, indent + " ", v.last_measured_effort);
00367 s << indent << "motor_voltage: ";
00368 Printer<double>::stream(s, indent + " ", v.motor_voltage);
00369 s << indent << "num_encoder_errors: ";
00370 Printer<int32_t>::stream(s, indent + " ", v.num_encoder_errors);
00371 }
00372 };
00373
00374
00375 }
00376 }
00377
00378 #endif // PR2_MECHANISM_MSGS_MESSAGE_ACTUATORSTATISTICS_H
00379