00001
00002 #ifndef PR2_MSGS_MESSAGE_POWERSTATE_H
00003 #define PR2_MSGS_MESSAGE_POWERSTATE_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
00015 namespace pr2_msgs
00016 {
00017 template <class ContainerAllocator>
00018 struct PowerState_ : public ros::Message
00019 {
00020 typedef PowerState_<ContainerAllocator> Type;
00021
00022 PowerState_()
00023 : header()
00024 , power_consumption(0.0)
00025 , time_remaining()
00026 , prediction_method()
00027 , relative_capacity(0)
00028 , AC_present(0)
00029 {
00030 }
00031
00032 PowerState_(const ContainerAllocator& _alloc)
00033 : header(_alloc)
00034 , power_consumption(0.0)
00035 , time_remaining()
00036 , prediction_method(_alloc)
00037 , relative_capacity(0)
00038 , AC_present(0)
00039 {
00040 }
00041
00042 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00043 ::std_msgs::Header_<ContainerAllocator> header;
00044
00045 typedef double _power_consumption_type;
00046 double power_consumption;
00047
00048 typedef ros::Duration _time_remaining_type;
00049 ros::Duration time_remaining;
00050
00051 typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _prediction_method_type;
00052 std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > prediction_method;
00053
00054 typedef int8_t _relative_capacity_type;
00055 int8_t relative_capacity;
00056
00057 typedef int8_t _AC_present_type;
00058 int8_t AC_present;
00059
00060
00061 private:
00062 static const char* __s_getDataType_() { return "pr2_msgs/PowerState"; }
00063 public:
00064 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00065
00066 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00067
00068 private:
00069 static const char* __s_getMD5Sum_() { return "e6fa46a387cad0b7a80959a21587a6c9"; }
00070 public:
00071 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00072
00073 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00074
00075 private:
00076 static const char* __s_getMessageDefinition_() { return "# This message communicates the state of the PR2's power system.\n\
00077 Header header\n\
00078 float64 power_consumption ## Watts\n\
00079 duration time_remaining ## estimated time to empty or full\n\
00080 string prediction_method ## how time_remaining is being calculated\n\
00081 int8 relative_capacity ## percent of capacity\n\
00082 int8 AC_present ## number of packs detecting AC power, > 0 means plugged in\n\
00083 \n\
00084 ================================================================================\n\
00085 MSG: std_msgs/Header\n\
00086 # Standard metadata for higher-level stamped data types.\n\
00087 # This is generally used to communicate timestamped data \n\
00088 # in a particular coordinate frame.\n\
00089 # \n\
00090 # sequence ID: consecutively increasing ID \n\
00091 uint32 seq\n\
00092 #Two-integer timestamp that is expressed as:\n\
00093 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00094 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00095 # time-handling sugar is provided by the client library\n\
00096 time stamp\n\
00097 #Frame this data is associated with\n\
00098 # 0: no frame\n\
00099 # 1: global frame\n\
00100 string frame_id\n\
00101 \n\
00102 "; }
00103 public:
00104 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00105
00106 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00107
00108 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00109 {
00110 ros::serialization::OStream stream(write_ptr, 1000000000);
00111 ros::serialization::serialize(stream, header);
00112 ros::serialization::serialize(stream, power_consumption);
00113 ros::serialization::serialize(stream, time_remaining);
00114 ros::serialization::serialize(stream, prediction_method);
00115 ros::serialization::serialize(stream, relative_capacity);
00116 ros::serialization::serialize(stream, AC_present);
00117 return stream.getData();
00118 }
00119
00120 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00121 {
00122 ros::serialization::IStream stream(read_ptr, 1000000000);
00123 ros::serialization::deserialize(stream, header);
00124 ros::serialization::deserialize(stream, power_consumption);
00125 ros::serialization::deserialize(stream, time_remaining);
00126 ros::serialization::deserialize(stream, prediction_method);
00127 ros::serialization::deserialize(stream, relative_capacity);
00128 ros::serialization::deserialize(stream, AC_present);
00129 return stream.getData();
00130 }
00131
00132 ROS_DEPRECATED virtual uint32_t serializationLength() const
00133 {
00134 uint32_t size = 0;
00135 size += ros::serialization::serializationLength(header);
00136 size += ros::serialization::serializationLength(power_consumption);
00137 size += ros::serialization::serializationLength(time_remaining);
00138 size += ros::serialization::serializationLength(prediction_method);
00139 size += ros::serialization::serializationLength(relative_capacity);
00140 size += ros::serialization::serializationLength(AC_present);
00141 return size;
00142 }
00143
00144 typedef boost::shared_ptr< ::pr2_msgs::PowerState_<ContainerAllocator> > Ptr;
00145 typedef boost::shared_ptr< ::pr2_msgs::PowerState_<ContainerAllocator> const> ConstPtr;
00146 };
00147 typedef ::pr2_msgs::PowerState_<std::allocator<void> > PowerState;
00148
00149 typedef boost::shared_ptr< ::pr2_msgs::PowerState> PowerStatePtr;
00150 typedef boost::shared_ptr< ::pr2_msgs::PowerState const> PowerStateConstPtr;
00151
00152
00153 template<typename ContainerAllocator>
00154 std::ostream& operator<<(std::ostream& s, const ::pr2_msgs::PowerState_<ContainerAllocator> & v)
00155 {
00156 ros::message_operations::Printer< ::pr2_msgs::PowerState_<ContainerAllocator> >::stream(s, "", v);
00157 return s;}
00158
00159 }
00160
00161 namespace ros
00162 {
00163 namespace message_traits
00164 {
00165 template<class ContainerAllocator>
00166 struct MD5Sum< ::pr2_msgs::PowerState_<ContainerAllocator> > {
00167 static const char* value()
00168 {
00169 return "e6fa46a387cad0b7a80959a21587a6c9";
00170 }
00171
00172 static const char* value(const ::pr2_msgs::PowerState_<ContainerAllocator> &) { return value(); }
00173 static const uint64_t static_value1 = 0xe6fa46a387cad0b7ULL;
00174 static const uint64_t static_value2 = 0xa80959a21587a6c9ULL;
00175 };
00176
00177 template<class ContainerAllocator>
00178 struct DataType< ::pr2_msgs::PowerState_<ContainerAllocator> > {
00179 static const char* value()
00180 {
00181 return "pr2_msgs/PowerState";
00182 }
00183
00184 static const char* value(const ::pr2_msgs::PowerState_<ContainerAllocator> &) { return value(); }
00185 };
00186
00187 template<class ContainerAllocator>
00188 struct Definition< ::pr2_msgs::PowerState_<ContainerAllocator> > {
00189 static const char* value()
00190 {
00191 return "# This message communicates the state of the PR2's power system.\n\
00192 Header header\n\
00193 float64 power_consumption ## Watts\n\
00194 duration time_remaining ## estimated time to empty or full\n\
00195 string prediction_method ## how time_remaining is being calculated\n\
00196 int8 relative_capacity ## percent of capacity\n\
00197 int8 AC_present ## number of packs detecting AC power, > 0 means plugged in\n\
00198 \n\
00199 ================================================================================\n\
00200 MSG: std_msgs/Header\n\
00201 # Standard metadata for higher-level stamped data types.\n\
00202 # This is generally used to communicate timestamped data \n\
00203 # in a particular coordinate frame.\n\
00204 # \n\
00205 # sequence ID: consecutively increasing ID \n\
00206 uint32 seq\n\
00207 #Two-integer timestamp that is expressed as:\n\
00208 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00209 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00210 # time-handling sugar is provided by the client library\n\
00211 time stamp\n\
00212 #Frame this data is associated with\n\
00213 # 0: no frame\n\
00214 # 1: global frame\n\
00215 string frame_id\n\
00216 \n\
00217 ";
00218 }
00219
00220 static const char* value(const ::pr2_msgs::PowerState_<ContainerAllocator> &) { return value(); }
00221 };
00222
00223 template<class ContainerAllocator> struct HasHeader< ::pr2_msgs::PowerState_<ContainerAllocator> > : public TrueType {};
00224 template<class ContainerAllocator> struct HasHeader< const ::pr2_msgs::PowerState_<ContainerAllocator> > : public TrueType {};
00225 }
00226 }
00227
00228 namespace ros
00229 {
00230 namespace serialization
00231 {
00232
00233 template<class ContainerAllocator> struct Serializer< ::pr2_msgs::PowerState_<ContainerAllocator> >
00234 {
00235 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00236 {
00237 stream.next(m.header);
00238 stream.next(m.power_consumption);
00239 stream.next(m.time_remaining);
00240 stream.next(m.prediction_method);
00241 stream.next(m.relative_capacity);
00242 stream.next(m.AC_present);
00243 }
00244
00245 ROS_DECLARE_ALLINONE_SERIALIZER;
00246 };
00247 }
00248 }
00249
00250 namespace ros
00251 {
00252 namespace message_operations
00253 {
00254
00255 template<class ContainerAllocator>
00256 struct Printer< ::pr2_msgs::PowerState_<ContainerAllocator> >
00257 {
00258 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::pr2_msgs::PowerState_<ContainerAllocator> & v)
00259 {
00260 s << indent << "header: ";
00261 s << std::endl;
00262 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00263 s << indent << "power_consumption: ";
00264 Printer<double>::stream(s, indent + " ", v.power_consumption);
00265 s << indent << "time_remaining: ";
00266 Printer<ros::Duration>::stream(s, indent + " ", v.time_remaining);
00267 s << indent << "prediction_method: ";
00268 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.prediction_method);
00269 s << indent << "relative_capacity: ";
00270 Printer<int8_t>::stream(s, indent + " ", v.relative_capacity);
00271 s << indent << "AC_present: ";
00272 Printer<int8_t>::stream(s, indent + " ", v.AC_present);
00273 }
00274 };
00275
00276
00277 }
00278 }
00279
00280 #endif // PR2_MSGS_MESSAGE_POWERSTATE_H
00281