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