$search
00001 /* Auto-generated by genmsg_cpp for file /home/rosbuild/hudson/workspace/doc-electric-pr2_common/doc_stacks/2013-03-01_16-36-22.045406/pr2_common/pr2_msgs/msg/BatteryServer.msg */ 00002 #ifndef PR2_MSGS_MESSAGE_BATTERYSERVER_H 00003 #define PR2_MSGS_MESSAGE_BATTERYSERVER_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 #include "std_msgs/Header.h" 00018 #include "pr2_msgs/BatteryState.h" 00019 00020 namespace pr2_msgs 00021 { 00022 template <class ContainerAllocator> 00023 struct BatteryServer_ { 00024 typedef BatteryServer_<ContainerAllocator> Type; 00025 00026 BatteryServer_() 00027 : header() 00028 , id(0) 00029 , lastTimeSystem(0) 00030 , timeLeft(0) 00031 , averageCharge(0) 00032 , message() 00033 , lastTimeController(0) 00034 , present(0) 00035 , charging(0) 00036 , discharging(0) 00037 , reserved(0) 00038 , powerPresent(0) 00039 , powerNG(0) 00040 , inhibited(0) 00041 , battery() 00042 { 00043 } 00044 00045 BatteryServer_(const ContainerAllocator& _alloc) 00046 : header(_alloc) 00047 , id(0) 00048 , lastTimeSystem(0) 00049 , timeLeft(0) 00050 , averageCharge(0) 00051 , message(_alloc) 00052 , lastTimeController(0) 00053 , present(0) 00054 , charging(0) 00055 , discharging(0) 00056 , reserved(0) 00057 , powerPresent(0) 00058 , powerNG(0) 00059 , inhibited(0) 00060 , battery(_alloc) 00061 { 00062 } 00063 00064 typedef ::std_msgs::Header_<ContainerAllocator> _header_type; 00065 ::std_msgs::Header_<ContainerAllocator> header; 00066 00067 typedef int32_t _id_type; 00068 int32_t id; 00069 00070 typedef int32_t _lastTimeSystem_type; 00071 int32_t lastTimeSystem; 00072 00073 typedef uint16_t _timeLeft_type; 00074 uint16_t timeLeft; 00075 00076 typedef uint16_t _averageCharge_type; 00077 uint16_t averageCharge; 00078 00079 typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _message_type; 00080 std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > message; 00081 00082 typedef int32_t _lastTimeController_type; 00083 int32_t lastTimeController; 00084 00085 typedef uint16_t _present_type; 00086 uint16_t present; 00087 00088 typedef uint16_t _charging_type; 00089 uint16_t charging; 00090 00091 typedef uint16_t _discharging_type; 00092 uint16_t discharging; 00093 00094 typedef uint16_t _reserved_type; 00095 uint16_t reserved; 00096 00097 typedef uint16_t _powerPresent_type; 00098 uint16_t powerPresent; 00099 00100 typedef uint16_t _powerNG_type; 00101 uint16_t powerNG; 00102 00103 typedef uint16_t _inhibited_type; 00104 uint16_t inhibited; 00105 00106 typedef std::vector< ::pr2_msgs::BatteryState_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::pr2_msgs::BatteryState_<ContainerAllocator> >::other > _battery_type; 00107 std::vector< ::pr2_msgs::BatteryState_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::pr2_msgs::BatteryState_<ContainerAllocator> >::other > battery; 00108 00109 enum { MAX_BAT_COUNT = 4 }; 00110 enum { MAX_BAT_REG = 48 }; 00111 00112 ROS_DEPRECATED uint32_t get_battery_size() const { return (uint32_t)battery.size(); } 00113 ROS_DEPRECATED void set_battery_size(uint32_t size) { battery.resize((size_t)size); } 00114 ROS_DEPRECATED void get_battery_vec(std::vector< ::pr2_msgs::BatteryState_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::pr2_msgs::BatteryState_<ContainerAllocator> >::other > & vec) const { vec = this->battery; } 00115 ROS_DEPRECATED void set_battery_vec(const std::vector< ::pr2_msgs::BatteryState_<ContainerAllocator> , typename ContainerAllocator::template rebind< ::pr2_msgs::BatteryState_<ContainerAllocator> >::other > & vec) { this->battery = vec; } 00116 private: 00117 static const char* __s_getDataType_() { return "pr2_msgs/BatteryServer"; } 00118 public: 00119 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); } 00120 00121 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); } 00122 00123 private: 00124 static const char* __s_getMD5Sum_() { return "4f6d6e54c9581beb1df7ea408c0727be"; } 00125 public: 00126 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); } 00127 00128 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); } 00129 00130 private: 00131 static const char* __s_getMessageDefinition_() { return "# DEPRECATED. Use pr2_msgs/BatteryServer2 instead.\n\ 00132 Header header\n\ 00133 uint32 MAX_BAT_COUNT=4\n\ 00134 uint32 MAX_BAT_REG=48\n\ 00135 int32 id # unique ID for each battery server\n\ 00136 # Battery System Stats\n\ 00137 int32 lastTimeSystem #epoch time\n\ 00138 uint16 timeLeft # in minutes\n\ 00139 uint16 averageCharge # in percent\n\ 00140 string message\n\ 00141 # Battery Controller Flags\n\ 00142 int32 lastTimeController #epoch time\n\ 00143 uint16 present\n\ 00144 uint16 charging\n\ 00145 uint16 discharging\n\ 00146 uint16 reserved\n\ 00147 uint16 powerPresent\n\ 00148 uint16 powerNG\n\ 00149 uint16 inhibited\n\ 00150 # for each battery\n\ 00151 pr2_msgs/BatteryState[] battery\n\ 00152 \n\ 00153 ================================================================================\n\ 00154 MSG: std_msgs/Header\n\ 00155 # Standard metadata for higher-level stamped data types.\n\ 00156 # This is generally used to communicate timestamped data \n\ 00157 # in a particular coordinate frame.\n\ 00158 # \n\ 00159 # sequence ID: consecutively increasing ID \n\ 00160 uint32 seq\n\ 00161 #Two-integer timestamp that is expressed as:\n\ 00162 # * stamp.secs: seconds (stamp_secs) since epoch\n\ 00163 # * stamp.nsecs: nanoseconds since stamp_secs\n\ 00164 # time-handling sugar is provided by the client library\n\ 00165 time stamp\n\ 00166 #Frame this data is associated with\n\ 00167 # 0: no frame\n\ 00168 # 1: global frame\n\ 00169 string frame_id\n\ 00170 \n\ 00171 ================================================================================\n\ 00172 MSG: pr2_msgs/BatteryState\n\ 00173 # DEPRECATED. Use pr2_msgs/BatteryState2 instead.\n\ 00174 # Each batteries registers\n\ 00175 int32 lastTimeBattery #epoch time\n\ 00176 uint16[48] batReg\n\ 00177 uint16[48] batRegFlag\n\ 00178 int32[48] batRegTime\n\ 00179 \n\ 00180 "; } 00181 public: 00182 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); } 00183 00184 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); } 00185 00186 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const 00187 { 00188 ros::serialization::OStream stream(write_ptr, 1000000000); 00189 ros::serialization::serialize(stream, header); 00190 ros::serialization::serialize(stream, id); 00191 ros::serialization::serialize(stream, lastTimeSystem); 00192 ros::serialization::serialize(stream, timeLeft); 00193 ros::serialization::serialize(stream, averageCharge); 00194 ros::serialization::serialize(stream, message); 00195 ros::serialization::serialize(stream, lastTimeController); 00196 ros::serialization::serialize(stream, present); 00197 ros::serialization::serialize(stream, charging); 00198 ros::serialization::serialize(stream, discharging); 00199 ros::serialization::serialize(stream, reserved); 00200 ros::serialization::serialize(stream, powerPresent); 00201 ros::serialization::serialize(stream, powerNG); 00202 ros::serialization::serialize(stream, inhibited); 00203 ros::serialization::serialize(stream, battery); 00204 return stream.getData(); 00205 } 00206 00207 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr) 00208 { 00209 ros::serialization::IStream stream(read_ptr, 1000000000); 00210 ros::serialization::deserialize(stream, header); 00211 ros::serialization::deserialize(stream, id); 00212 ros::serialization::deserialize(stream, lastTimeSystem); 00213 ros::serialization::deserialize(stream, timeLeft); 00214 ros::serialization::deserialize(stream, averageCharge); 00215 ros::serialization::deserialize(stream, message); 00216 ros::serialization::deserialize(stream, lastTimeController); 00217 ros::serialization::deserialize(stream, present); 00218 ros::serialization::deserialize(stream, charging); 00219 ros::serialization::deserialize(stream, discharging); 00220 ros::serialization::deserialize(stream, reserved); 00221 ros::serialization::deserialize(stream, powerPresent); 00222 ros::serialization::deserialize(stream, powerNG); 00223 ros::serialization::deserialize(stream, inhibited); 00224 ros::serialization::deserialize(stream, battery); 00225 return stream.getData(); 00226 } 00227 00228 ROS_DEPRECATED virtual uint32_t serializationLength() const 00229 { 00230 uint32_t size = 0; 00231 size += ros::serialization::serializationLength(header); 00232 size += ros::serialization::serializationLength(id); 00233 size += ros::serialization::serializationLength(lastTimeSystem); 00234 size += ros::serialization::serializationLength(timeLeft); 00235 size += ros::serialization::serializationLength(averageCharge); 00236 size += ros::serialization::serializationLength(message); 00237 size += ros::serialization::serializationLength(lastTimeController); 00238 size += ros::serialization::serializationLength(present); 00239 size += ros::serialization::serializationLength(charging); 00240 size += ros::serialization::serializationLength(discharging); 00241 size += ros::serialization::serializationLength(reserved); 00242 size += ros::serialization::serializationLength(powerPresent); 00243 size += ros::serialization::serializationLength(powerNG); 00244 size += ros::serialization::serializationLength(inhibited); 00245 size += ros::serialization::serializationLength(battery); 00246 return size; 00247 } 00248 00249 typedef boost::shared_ptr< ::pr2_msgs::BatteryServer_<ContainerAllocator> > Ptr; 00250 typedef boost::shared_ptr< ::pr2_msgs::BatteryServer_<ContainerAllocator> const> ConstPtr; 00251 boost::shared_ptr<std::map<std::string, std::string> > __connection_header; 00252 }; // struct BatteryServer 00253 typedef ::pr2_msgs::BatteryServer_<std::allocator<void> > BatteryServer; 00254 00255 typedef boost::shared_ptr< ::pr2_msgs::BatteryServer> BatteryServerPtr; 00256 typedef boost::shared_ptr< ::pr2_msgs::BatteryServer const> BatteryServerConstPtr; 00257 00258 00259 template<typename ContainerAllocator> 00260 std::ostream& operator<<(std::ostream& s, const ::pr2_msgs::BatteryServer_<ContainerAllocator> & v) 00261 { 00262 ros::message_operations::Printer< ::pr2_msgs::BatteryServer_<ContainerAllocator> >::stream(s, "", v); 00263 return s;} 00264 00265 } // namespace pr2_msgs 00266 00267 namespace ros 00268 { 00269 namespace message_traits 00270 { 00271 template<class ContainerAllocator> struct IsMessage< ::pr2_msgs::BatteryServer_<ContainerAllocator> > : public TrueType {}; 00272 template<class ContainerAllocator> struct IsMessage< ::pr2_msgs::BatteryServer_<ContainerAllocator> const> : public TrueType {}; 00273 template<class ContainerAllocator> 00274 struct MD5Sum< ::pr2_msgs::BatteryServer_<ContainerAllocator> > { 00275 static const char* value() 00276 { 00277 return "4f6d6e54c9581beb1df7ea408c0727be"; 00278 } 00279 00280 static const char* value(const ::pr2_msgs::BatteryServer_<ContainerAllocator> &) { return value(); } 00281 static const uint64_t static_value1 = 0x4f6d6e54c9581bebULL; 00282 static const uint64_t static_value2 = 0x1df7ea408c0727beULL; 00283 }; 00284 00285 template<class ContainerAllocator> 00286 struct DataType< ::pr2_msgs::BatteryServer_<ContainerAllocator> > { 00287 static const char* value() 00288 { 00289 return "pr2_msgs/BatteryServer"; 00290 } 00291 00292 static const char* value(const ::pr2_msgs::BatteryServer_<ContainerAllocator> &) { return value(); } 00293 }; 00294 00295 template<class ContainerAllocator> 00296 struct Definition< ::pr2_msgs::BatteryServer_<ContainerAllocator> > { 00297 static const char* value() 00298 { 00299 return "# DEPRECATED. Use pr2_msgs/BatteryServer2 instead.\n\ 00300 Header header\n\ 00301 uint32 MAX_BAT_COUNT=4\n\ 00302 uint32 MAX_BAT_REG=48\n\ 00303 int32 id # unique ID for each battery server\n\ 00304 # Battery System Stats\n\ 00305 int32 lastTimeSystem #epoch time\n\ 00306 uint16 timeLeft # in minutes\n\ 00307 uint16 averageCharge # in percent\n\ 00308 string message\n\ 00309 # Battery Controller Flags\n\ 00310 int32 lastTimeController #epoch time\n\ 00311 uint16 present\n\ 00312 uint16 charging\n\ 00313 uint16 discharging\n\ 00314 uint16 reserved\n\ 00315 uint16 powerPresent\n\ 00316 uint16 powerNG\n\ 00317 uint16 inhibited\n\ 00318 # for each battery\n\ 00319 pr2_msgs/BatteryState[] battery\n\ 00320 \n\ 00321 ================================================================================\n\ 00322 MSG: std_msgs/Header\n\ 00323 # Standard metadata for higher-level stamped data types.\n\ 00324 # This is generally used to communicate timestamped data \n\ 00325 # in a particular coordinate frame.\n\ 00326 # \n\ 00327 # sequence ID: consecutively increasing ID \n\ 00328 uint32 seq\n\ 00329 #Two-integer timestamp that is expressed as:\n\ 00330 # * stamp.secs: seconds (stamp_secs) since epoch\n\ 00331 # * stamp.nsecs: nanoseconds since stamp_secs\n\ 00332 # time-handling sugar is provided by the client library\n\ 00333 time stamp\n\ 00334 #Frame this data is associated with\n\ 00335 # 0: no frame\n\ 00336 # 1: global frame\n\ 00337 string frame_id\n\ 00338 \n\ 00339 ================================================================================\n\ 00340 MSG: pr2_msgs/BatteryState\n\ 00341 # DEPRECATED. Use pr2_msgs/BatteryState2 instead.\n\ 00342 # Each batteries registers\n\ 00343 int32 lastTimeBattery #epoch time\n\ 00344 uint16[48] batReg\n\ 00345 uint16[48] batRegFlag\n\ 00346 int32[48] batRegTime\n\ 00347 \n\ 00348 "; 00349 } 00350 00351 static const char* value(const ::pr2_msgs::BatteryServer_<ContainerAllocator> &) { return value(); } 00352 }; 00353 00354 template<class ContainerAllocator> struct HasHeader< ::pr2_msgs::BatteryServer_<ContainerAllocator> > : public TrueType {}; 00355 template<class ContainerAllocator> struct HasHeader< const ::pr2_msgs::BatteryServer_<ContainerAllocator> > : public TrueType {}; 00356 } // namespace message_traits 00357 } // namespace ros 00358 00359 namespace ros 00360 { 00361 namespace serialization 00362 { 00363 00364 template<class ContainerAllocator> struct Serializer< ::pr2_msgs::BatteryServer_<ContainerAllocator> > 00365 { 00366 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m) 00367 { 00368 stream.next(m.header); 00369 stream.next(m.id); 00370 stream.next(m.lastTimeSystem); 00371 stream.next(m.timeLeft); 00372 stream.next(m.averageCharge); 00373 stream.next(m.message); 00374 stream.next(m.lastTimeController); 00375 stream.next(m.present); 00376 stream.next(m.charging); 00377 stream.next(m.discharging); 00378 stream.next(m.reserved); 00379 stream.next(m.powerPresent); 00380 stream.next(m.powerNG); 00381 stream.next(m.inhibited); 00382 stream.next(m.battery); 00383 } 00384 00385 ROS_DECLARE_ALLINONE_SERIALIZER; 00386 }; // struct BatteryServer_ 00387 } // namespace serialization 00388 } // namespace ros 00389 00390 namespace ros 00391 { 00392 namespace message_operations 00393 { 00394 00395 template<class ContainerAllocator> 00396 struct Printer< ::pr2_msgs::BatteryServer_<ContainerAllocator> > 00397 { 00398 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::pr2_msgs::BatteryServer_<ContainerAllocator> & v) 00399 { 00400 s << indent << "header: "; 00401 s << std::endl; 00402 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header); 00403 s << indent << "id: "; 00404 Printer<int32_t>::stream(s, indent + " ", v.id); 00405 s << indent << "lastTimeSystem: "; 00406 Printer<int32_t>::stream(s, indent + " ", v.lastTimeSystem); 00407 s << indent << "timeLeft: "; 00408 Printer<uint16_t>::stream(s, indent + " ", v.timeLeft); 00409 s << indent << "averageCharge: "; 00410 Printer<uint16_t>::stream(s, indent + " ", v.averageCharge); 00411 s << indent << "message: "; 00412 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.message); 00413 s << indent << "lastTimeController: "; 00414 Printer<int32_t>::stream(s, indent + " ", v.lastTimeController); 00415 s << indent << "present: "; 00416 Printer<uint16_t>::stream(s, indent + " ", v.present); 00417 s << indent << "charging: "; 00418 Printer<uint16_t>::stream(s, indent + " ", v.charging); 00419 s << indent << "discharging: "; 00420 Printer<uint16_t>::stream(s, indent + " ", v.discharging); 00421 s << indent << "reserved: "; 00422 Printer<uint16_t>::stream(s, indent + " ", v.reserved); 00423 s << indent << "powerPresent: "; 00424 Printer<uint16_t>::stream(s, indent + " ", v.powerPresent); 00425 s << indent << "powerNG: "; 00426 Printer<uint16_t>::stream(s, indent + " ", v.powerNG); 00427 s << indent << "inhibited: "; 00428 Printer<uint16_t>::stream(s, indent + " ", v.inhibited); 00429 s << indent << "battery[]" << std::endl; 00430 for (size_t i = 0; i < v.battery.size(); ++i) 00431 { 00432 s << indent << " battery[" << i << "]: "; 00433 s << std::endl; 00434 s << indent; 00435 Printer< ::pr2_msgs::BatteryState_<ContainerAllocator> >::stream(s, indent + " ", v.battery[i]); 00436 } 00437 } 00438 }; 00439 00440 00441 } // namespace message_operations 00442 } // namespace ros 00443 00444 #endif // PR2_MSGS_MESSAGE_BATTERYSERVER_H 00445