00001
00002 #ifndef PR2_MSGS_MESSAGE_BATTERYSTATE2_H
00003 #define PR2_MSGS_MESSAGE_BATTERYSTATE2_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_msgs
00015 {
00016 template <class ContainerAllocator>
00017 struct BatteryState2_ : public ros::Message
00018 {
00019 typedef BatteryState2_<ContainerAllocator> Type;
00020
00021 BatteryState2_()
00022 : present(false)
00023 , charging(false)
00024 , discharging(false)
00025 , power_present(false)
00026 , power_no_good(false)
00027 , inhibited(false)
00028 , last_battery_update()
00029 , battery_register()
00030 , battery_update_flag()
00031 , battery_register_update()
00032 {
00033 battery_register.assign(0);
00034 battery_update_flag.assign(false);
00035 }
00036
00037 BatteryState2_(const ContainerAllocator& _alloc)
00038 : present(false)
00039 , charging(false)
00040 , discharging(false)
00041 , power_present(false)
00042 , power_no_good(false)
00043 , inhibited(false)
00044 , last_battery_update()
00045 , battery_register()
00046 , battery_update_flag()
00047 , battery_register_update()
00048 {
00049 battery_register.assign(0);
00050 battery_update_flag.assign(false);
00051 }
00052
00053 typedef uint8_t _present_type;
00054 uint8_t present;
00055
00056 typedef uint8_t _charging_type;
00057 uint8_t charging;
00058
00059 typedef uint8_t _discharging_type;
00060 uint8_t discharging;
00061
00062 typedef uint8_t _power_present_type;
00063 uint8_t power_present;
00064
00065 typedef uint8_t _power_no_good_type;
00066 uint8_t power_no_good;
00067
00068 typedef uint8_t _inhibited_type;
00069 uint8_t inhibited;
00070
00071 typedef ros::Time _last_battery_update_type;
00072 ros::Time last_battery_update;
00073
00074 typedef boost::array<int16_t, 48> _battery_register_type;
00075 boost::array<int16_t, 48> battery_register;
00076
00077 typedef boost::array<uint8_t, 48> _battery_update_flag_type;
00078 boost::array<uint8_t, 48> battery_update_flag;
00079
00080 typedef boost::array<ros::Time, 48> _battery_register_update_type;
00081 boost::array<ros::Time, 48> battery_register_update;
00082
00083
00084 ROS_DEPRECATED uint32_t get_battery_register_size() const { return (uint32_t)battery_register.size(); }
00085 ROS_DEPRECATED uint32_t get_battery_update_flag_size() const { return (uint32_t)battery_update_flag.size(); }
00086 ROS_DEPRECATED uint32_t get_battery_register_update_size() const { return (uint32_t)battery_register_update.size(); }
00087 private:
00088 static const char* __s_getDataType_() { return "pr2_msgs/BatteryState2"; }
00089 public:
00090 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00091
00092 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00093
00094 private:
00095 static const char* __s_getMD5Sum_() { return "91b4acb000aa990ac3006834f9a99669"; }
00096 public:
00097 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00098
00099 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00100
00101 private:
00102 static const char* __s_getMessageDefinition_() { return "# This message communicates the state of a single battery.\n\
00103 # Battery Controller Flags, one per battery\n\
00104 bool present # is this pack present\n\
00105 bool charging # is this pack charging\n\
00106 bool discharging # is this pack discharging\n\
00107 bool power_present # is there an input voltage\n\
00108 bool power_no_good # is there a fault (No Good)\n\
00109 bool inhibited # is this pack disabled for some reason\n\
00110 # These registers are per battery\n\
00111 time last_battery_update # last time any battery update occurred\n\
00112 int16[48] battery_register # value of this register in the battery\n\
00113 bool[48] battery_update_flag # Has this register ever been updated\n\
00114 time[48] battery_register_update # last time this specific register was updated\n\
00115 \n\
00116 "; }
00117 public:
00118 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00119
00120 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00121
00122 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00123 {
00124 ros::serialization::OStream stream(write_ptr, 1000000000);
00125 ros::serialization::serialize(stream, present);
00126 ros::serialization::serialize(stream, charging);
00127 ros::serialization::serialize(stream, discharging);
00128 ros::serialization::serialize(stream, power_present);
00129 ros::serialization::serialize(stream, power_no_good);
00130 ros::serialization::serialize(stream, inhibited);
00131 ros::serialization::serialize(stream, last_battery_update);
00132 ros::serialization::serialize(stream, battery_register);
00133 ros::serialization::serialize(stream, battery_update_flag);
00134 ros::serialization::serialize(stream, battery_register_update);
00135 return stream.getData();
00136 }
00137
00138 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00139 {
00140 ros::serialization::IStream stream(read_ptr, 1000000000);
00141 ros::serialization::deserialize(stream, present);
00142 ros::serialization::deserialize(stream, charging);
00143 ros::serialization::deserialize(stream, discharging);
00144 ros::serialization::deserialize(stream, power_present);
00145 ros::serialization::deserialize(stream, power_no_good);
00146 ros::serialization::deserialize(stream, inhibited);
00147 ros::serialization::deserialize(stream, last_battery_update);
00148 ros::serialization::deserialize(stream, battery_register);
00149 ros::serialization::deserialize(stream, battery_update_flag);
00150 ros::serialization::deserialize(stream, battery_register_update);
00151 return stream.getData();
00152 }
00153
00154 ROS_DEPRECATED virtual uint32_t serializationLength() const
00155 {
00156 uint32_t size = 0;
00157 size += ros::serialization::serializationLength(present);
00158 size += ros::serialization::serializationLength(charging);
00159 size += ros::serialization::serializationLength(discharging);
00160 size += ros::serialization::serializationLength(power_present);
00161 size += ros::serialization::serializationLength(power_no_good);
00162 size += ros::serialization::serializationLength(inhibited);
00163 size += ros::serialization::serializationLength(last_battery_update);
00164 size += ros::serialization::serializationLength(battery_register);
00165 size += ros::serialization::serializationLength(battery_update_flag);
00166 size += ros::serialization::serializationLength(battery_register_update);
00167 return size;
00168 }
00169
00170 typedef boost::shared_ptr< ::pr2_msgs::BatteryState2_<ContainerAllocator> > Ptr;
00171 typedef boost::shared_ptr< ::pr2_msgs::BatteryState2_<ContainerAllocator> const> ConstPtr;
00172 };
00173 typedef ::pr2_msgs::BatteryState2_<std::allocator<void> > BatteryState2;
00174
00175 typedef boost::shared_ptr< ::pr2_msgs::BatteryState2> BatteryState2Ptr;
00176 typedef boost::shared_ptr< ::pr2_msgs::BatteryState2 const> BatteryState2ConstPtr;
00177
00178
00179 template<typename ContainerAllocator>
00180 std::ostream& operator<<(std::ostream& s, const ::pr2_msgs::BatteryState2_<ContainerAllocator> & v)
00181 {
00182 ros::message_operations::Printer< ::pr2_msgs::BatteryState2_<ContainerAllocator> >::stream(s, "", v);
00183 return s;}
00184
00185 }
00186
00187 namespace ros
00188 {
00189 namespace message_traits
00190 {
00191 template<class ContainerAllocator>
00192 struct MD5Sum< ::pr2_msgs::BatteryState2_<ContainerAllocator> > {
00193 static const char* value()
00194 {
00195 return "91b4acb000aa990ac3006834f9a99669";
00196 }
00197
00198 static const char* value(const ::pr2_msgs::BatteryState2_<ContainerAllocator> &) { return value(); }
00199 static const uint64_t static_value1 = 0x91b4acb000aa990aULL;
00200 static const uint64_t static_value2 = 0xc3006834f9a99669ULL;
00201 };
00202
00203 template<class ContainerAllocator>
00204 struct DataType< ::pr2_msgs::BatteryState2_<ContainerAllocator> > {
00205 static const char* value()
00206 {
00207 return "pr2_msgs/BatteryState2";
00208 }
00209
00210 static const char* value(const ::pr2_msgs::BatteryState2_<ContainerAllocator> &) { return value(); }
00211 };
00212
00213 template<class ContainerAllocator>
00214 struct Definition< ::pr2_msgs::BatteryState2_<ContainerAllocator> > {
00215 static const char* value()
00216 {
00217 return "# This message communicates the state of a single battery.\n\
00218 # Battery Controller Flags, one per battery\n\
00219 bool present # is this pack present\n\
00220 bool charging # is this pack charging\n\
00221 bool discharging # is this pack discharging\n\
00222 bool power_present # is there an input voltage\n\
00223 bool power_no_good # is there a fault (No Good)\n\
00224 bool inhibited # is this pack disabled for some reason\n\
00225 # These registers are per battery\n\
00226 time last_battery_update # last time any battery update occurred\n\
00227 int16[48] battery_register # value of this register in the battery\n\
00228 bool[48] battery_update_flag # Has this register ever been updated\n\
00229 time[48] battery_register_update # last time this specific register was updated\n\
00230 \n\
00231 ";
00232 }
00233
00234 static const char* value(const ::pr2_msgs::BatteryState2_<ContainerAllocator> &) { return value(); }
00235 };
00236
00237 template<class ContainerAllocator> struct IsFixedSize< ::pr2_msgs::BatteryState2_<ContainerAllocator> > : public TrueType {};
00238 }
00239 }
00240
00241 namespace ros
00242 {
00243 namespace serialization
00244 {
00245
00246 template<class ContainerAllocator> struct Serializer< ::pr2_msgs::BatteryState2_<ContainerAllocator> >
00247 {
00248 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00249 {
00250 stream.next(m.present);
00251 stream.next(m.charging);
00252 stream.next(m.discharging);
00253 stream.next(m.power_present);
00254 stream.next(m.power_no_good);
00255 stream.next(m.inhibited);
00256 stream.next(m.last_battery_update);
00257 stream.next(m.battery_register);
00258 stream.next(m.battery_update_flag);
00259 stream.next(m.battery_register_update);
00260 }
00261
00262 ROS_DECLARE_ALLINONE_SERIALIZER;
00263 };
00264 }
00265 }
00266
00267 namespace ros
00268 {
00269 namespace message_operations
00270 {
00271
00272 template<class ContainerAllocator>
00273 struct Printer< ::pr2_msgs::BatteryState2_<ContainerAllocator> >
00274 {
00275 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::pr2_msgs::BatteryState2_<ContainerAllocator> & v)
00276 {
00277 s << indent << "present: ";
00278 Printer<uint8_t>::stream(s, indent + " ", v.present);
00279 s << indent << "charging: ";
00280 Printer<uint8_t>::stream(s, indent + " ", v.charging);
00281 s << indent << "discharging: ";
00282 Printer<uint8_t>::stream(s, indent + " ", v.discharging);
00283 s << indent << "power_present: ";
00284 Printer<uint8_t>::stream(s, indent + " ", v.power_present);
00285 s << indent << "power_no_good: ";
00286 Printer<uint8_t>::stream(s, indent + " ", v.power_no_good);
00287 s << indent << "inhibited: ";
00288 Printer<uint8_t>::stream(s, indent + " ", v.inhibited);
00289 s << indent << "last_battery_update: ";
00290 Printer<ros::Time>::stream(s, indent + " ", v.last_battery_update);
00291 s << indent << "battery_register[]" << std::endl;
00292 for (size_t i = 0; i < v.battery_register.size(); ++i)
00293 {
00294 s << indent << " battery_register[" << i << "]: ";
00295 Printer<int16_t>::stream(s, indent + " ", v.battery_register[i]);
00296 }
00297 s << indent << "battery_update_flag[]" << std::endl;
00298 for (size_t i = 0; i < v.battery_update_flag.size(); ++i)
00299 {
00300 s << indent << " battery_update_flag[" << i << "]: ";
00301 Printer<uint8_t>::stream(s, indent + " ", v.battery_update_flag[i]);
00302 }
00303 s << indent << "battery_register_update[]" << std::endl;
00304 for (size_t i = 0; i < v.battery_register_update.size(); ++i)
00305 {
00306 s << indent << " battery_register_update[" << i << "]: ";
00307 Printer<ros::Time>::stream(s, indent + " ", v.battery_register_update[i]);
00308 }
00309 }
00310 };
00311
00312
00313 }
00314 }
00315
00316 #endif // PR2_MSGS_MESSAGE_BATTERYSTATE2_H
00317