00001
00002 #ifndef PR2_MSGS_MESSAGE_POWERBOARDSTATE_H
00003 #define PR2_MSGS_MESSAGE_POWERBOARDSTATE_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 PowerBoardState_ : public ros::Message
00019 {
00020 typedef PowerBoardState_<ContainerAllocator> Type;
00021
00022 PowerBoardState_()
00023 : header()
00024 , name()
00025 , serial_num(0)
00026 , input_voltage(0.0)
00027 , master_state(0)
00028 , circuit_state()
00029 , circuit_voltage()
00030 , run_stop(false)
00031 , wireless_stop(false)
00032 {
00033 circuit_state.assign(0);
00034 circuit_voltage.assign(0.0);
00035 }
00036
00037 PowerBoardState_(const ContainerAllocator& _alloc)
00038 : header(_alloc)
00039 , name(_alloc)
00040 , serial_num(0)
00041 , input_voltage(0.0)
00042 , master_state(0)
00043 , circuit_state()
00044 , circuit_voltage()
00045 , run_stop(false)
00046 , wireless_stop(false)
00047 {
00048 circuit_state.assign(0);
00049 circuit_voltage.assign(0.0);
00050 }
00051
00052 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00053 ::std_msgs::Header_<ContainerAllocator> header;
00054
00055 typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _name_type;
00056 std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > name;
00057
00058 typedef uint32_t _serial_num_type;
00059 uint32_t serial_num;
00060
00061 typedef double _input_voltage_type;
00062 double input_voltage;
00063
00064 typedef int8_t _master_state_type;
00065 int8_t master_state;
00066
00067 typedef boost::array<int8_t, 3> _circuit_state_type;
00068 boost::array<int8_t, 3> circuit_state;
00069
00070 typedef boost::array<double, 3> _circuit_voltage_type;
00071 boost::array<double, 3> circuit_voltage;
00072
00073 typedef uint8_t _run_stop_type;
00074 uint8_t run_stop;
00075
00076 typedef uint8_t _wireless_stop_type;
00077 uint8_t wireless_stop;
00078
00079 enum { STATE_NOPOWER = 0 };
00080 enum { STATE_STANDBY = 1 };
00081 enum { STATE_PUMPING = 2 };
00082 enum { STATE_ON = 3 };
00083 enum { STATE_ENABLED = 3 };
00084 enum { STATE_DISABLED = 4 };
00085 enum { MASTER_NOPOWER = 0 };
00086 enum { MASTER_STANDBY = 1 };
00087 enum { MASTER_ON = 2 };
00088 enum { MASTER_OFF = 3 };
00089 enum { MASTER_SHUTDOWN = 4 };
00090
00091 ROS_DEPRECATED uint32_t get_circuit_state_size() const { return (uint32_t)circuit_state.size(); }
00092 ROS_DEPRECATED uint32_t get_circuit_voltage_size() const { return (uint32_t)circuit_voltage.size(); }
00093 private:
00094 static const char* __s_getDataType_() { return "pr2_msgs/PowerBoardState"; }
00095 public:
00096 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00097
00098 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00099
00100 private:
00101 static const char* __s_getMD5Sum_() { return "08899b671e6a1a449e7ce0000da8ae7b"; }
00102 public:
00103 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00104
00105 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00106
00107 private:
00108 static const char* __s_getMessageDefinition_() { return "# This message communicates the state of the PR2's power board.\n\
00109 int8 STATE_NOPOWER=0\n\
00110 int8 STATE_STANDBY=1\n\
00111 int8 STATE_PUMPING=2\n\
00112 int8 STATE_ON=3\n\
00113 int8 STATE_ENABLED=3 # Preferred over STATE_ON, keeping STATE_ON for backcompat\n\
00114 int8 STATE_DISABLED=4\n\
00115 \n\
00116 int8 MASTER_NOPOWER=0\n\
00117 int8 MASTER_STANDBY=1\n\
00118 int8 MASTER_ON=2\n\
00119 int8 MASTER_OFF=3\n\
00120 int8 MASTER_SHUTDOWN=4\n\
00121 \n\
00122 Header header\n\
00123 string name # Name with serial number\n\
00124 uint32 serial_num # Serial number for this board's message\n\
00125 float64 input_voltage # Input voltage to power board\n\
00126 \n\
00127 # Master States:\n\
00128 # MASTER_NOPOWER, MASTER_STANDBY, MASTER_ON, MASTER_OFF, MASTER_SHUTDOWN \n\
00129 int8 master_state # The master state machine's state in the powerboard\n\
00130 \n\
00131 # Circuit States:\n\
00132 # STATE_NOPOWER, STATE_STANDBY, STATE_PUMPING, STATE_ON, STATE_DISABLED\n\
00133 int8[3] circuit_state # One of the above states\n\
00134 float64[3] circuit_voltage # Output voltage of each circuit\n\
00135 \n\
00136 # True if robot should be enabled\n\
00137 bool run_stop #Note - if the wireless run-stop is hit, this will be unobservable\n\
00138 bool wireless_stop \n\
00139 \n\
00140 ================================================================================\n\
00141 MSG: std_msgs/Header\n\
00142 # Standard metadata for higher-level stamped data types.\n\
00143 # This is generally used to communicate timestamped data \n\
00144 # in a particular coordinate frame.\n\
00145 # \n\
00146 # sequence ID: consecutively increasing ID \n\
00147 uint32 seq\n\
00148 #Two-integer timestamp that is expressed as:\n\
00149 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00150 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00151 # time-handling sugar is provided by the client library\n\
00152 time stamp\n\
00153 #Frame this data is associated with\n\
00154 # 0: no frame\n\
00155 # 1: global frame\n\
00156 string frame_id\n\
00157 \n\
00158 "; }
00159 public:
00160 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00161
00162 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00163
00164 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00165 {
00166 ros::serialization::OStream stream(write_ptr, 1000000000);
00167 ros::serialization::serialize(stream, header);
00168 ros::serialization::serialize(stream, name);
00169 ros::serialization::serialize(stream, serial_num);
00170 ros::serialization::serialize(stream, input_voltage);
00171 ros::serialization::serialize(stream, master_state);
00172 ros::serialization::serialize(stream, circuit_state);
00173 ros::serialization::serialize(stream, circuit_voltage);
00174 ros::serialization::serialize(stream, run_stop);
00175 ros::serialization::serialize(stream, wireless_stop);
00176 return stream.getData();
00177 }
00178
00179 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00180 {
00181 ros::serialization::IStream stream(read_ptr, 1000000000);
00182 ros::serialization::deserialize(stream, header);
00183 ros::serialization::deserialize(stream, name);
00184 ros::serialization::deserialize(stream, serial_num);
00185 ros::serialization::deserialize(stream, input_voltage);
00186 ros::serialization::deserialize(stream, master_state);
00187 ros::serialization::deserialize(stream, circuit_state);
00188 ros::serialization::deserialize(stream, circuit_voltage);
00189 ros::serialization::deserialize(stream, run_stop);
00190 ros::serialization::deserialize(stream, wireless_stop);
00191 return stream.getData();
00192 }
00193
00194 ROS_DEPRECATED virtual uint32_t serializationLength() const
00195 {
00196 uint32_t size = 0;
00197 size += ros::serialization::serializationLength(header);
00198 size += ros::serialization::serializationLength(name);
00199 size += ros::serialization::serializationLength(serial_num);
00200 size += ros::serialization::serializationLength(input_voltage);
00201 size += ros::serialization::serializationLength(master_state);
00202 size += ros::serialization::serializationLength(circuit_state);
00203 size += ros::serialization::serializationLength(circuit_voltage);
00204 size += ros::serialization::serializationLength(run_stop);
00205 size += ros::serialization::serializationLength(wireless_stop);
00206 return size;
00207 }
00208
00209 typedef boost::shared_ptr< ::pr2_msgs::PowerBoardState_<ContainerAllocator> > Ptr;
00210 typedef boost::shared_ptr< ::pr2_msgs::PowerBoardState_<ContainerAllocator> const> ConstPtr;
00211 };
00212 typedef ::pr2_msgs::PowerBoardState_<std::allocator<void> > PowerBoardState;
00213
00214 typedef boost::shared_ptr< ::pr2_msgs::PowerBoardState> PowerBoardStatePtr;
00215 typedef boost::shared_ptr< ::pr2_msgs::PowerBoardState const> PowerBoardStateConstPtr;
00216
00217
00218 template<typename ContainerAllocator>
00219 std::ostream& operator<<(std::ostream& s, const ::pr2_msgs::PowerBoardState_<ContainerAllocator> & v)
00220 {
00221 ros::message_operations::Printer< ::pr2_msgs::PowerBoardState_<ContainerAllocator> >::stream(s, "", v);
00222 return s;}
00223
00224 }
00225
00226 namespace ros
00227 {
00228 namespace message_traits
00229 {
00230 template<class ContainerAllocator>
00231 struct MD5Sum< ::pr2_msgs::PowerBoardState_<ContainerAllocator> > {
00232 static const char* value()
00233 {
00234 return "08899b671e6a1a449e7ce0000da8ae7b";
00235 }
00236
00237 static const char* value(const ::pr2_msgs::PowerBoardState_<ContainerAllocator> &) { return value(); }
00238 static const uint64_t static_value1 = 0x08899b671e6a1a44ULL;
00239 static const uint64_t static_value2 = 0x9e7ce0000da8ae7bULL;
00240 };
00241
00242 template<class ContainerAllocator>
00243 struct DataType< ::pr2_msgs::PowerBoardState_<ContainerAllocator> > {
00244 static const char* value()
00245 {
00246 return "pr2_msgs/PowerBoardState";
00247 }
00248
00249 static const char* value(const ::pr2_msgs::PowerBoardState_<ContainerAllocator> &) { return value(); }
00250 };
00251
00252 template<class ContainerAllocator>
00253 struct Definition< ::pr2_msgs::PowerBoardState_<ContainerAllocator> > {
00254 static const char* value()
00255 {
00256 return "# This message communicates the state of the PR2's power board.\n\
00257 int8 STATE_NOPOWER=0\n\
00258 int8 STATE_STANDBY=1\n\
00259 int8 STATE_PUMPING=2\n\
00260 int8 STATE_ON=3\n\
00261 int8 STATE_ENABLED=3 # Preferred over STATE_ON, keeping STATE_ON for backcompat\n\
00262 int8 STATE_DISABLED=4\n\
00263 \n\
00264 int8 MASTER_NOPOWER=0\n\
00265 int8 MASTER_STANDBY=1\n\
00266 int8 MASTER_ON=2\n\
00267 int8 MASTER_OFF=3\n\
00268 int8 MASTER_SHUTDOWN=4\n\
00269 \n\
00270 Header header\n\
00271 string name # Name with serial number\n\
00272 uint32 serial_num # Serial number for this board's message\n\
00273 float64 input_voltage # Input voltage to power board\n\
00274 \n\
00275 # Master States:\n\
00276 # MASTER_NOPOWER, MASTER_STANDBY, MASTER_ON, MASTER_OFF, MASTER_SHUTDOWN \n\
00277 int8 master_state # The master state machine's state in the powerboard\n\
00278 \n\
00279 # Circuit States:\n\
00280 # STATE_NOPOWER, STATE_STANDBY, STATE_PUMPING, STATE_ON, STATE_DISABLED\n\
00281 int8[3] circuit_state # One of the above states\n\
00282 float64[3] circuit_voltage # Output voltage of each circuit\n\
00283 \n\
00284 # True if robot should be enabled\n\
00285 bool run_stop #Note - if the wireless run-stop is hit, this will be unobservable\n\
00286 bool wireless_stop \n\
00287 \n\
00288 ================================================================================\n\
00289 MSG: std_msgs/Header\n\
00290 # Standard metadata for higher-level stamped data types.\n\
00291 # This is generally used to communicate timestamped data \n\
00292 # in a particular coordinate frame.\n\
00293 # \n\
00294 # sequence ID: consecutively increasing ID \n\
00295 uint32 seq\n\
00296 #Two-integer timestamp that is expressed as:\n\
00297 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00298 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00299 # time-handling sugar is provided by the client library\n\
00300 time stamp\n\
00301 #Frame this data is associated with\n\
00302 # 0: no frame\n\
00303 # 1: global frame\n\
00304 string frame_id\n\
00305 \n\
00306 ";
00307 }
00308
00309 static const char* value(const ::pr2_msgs::PowerBoardState_<ContainerAllocator> &) { return value(); }
00310 };
00311
00312 template<class ContainerAllocator> struct HasHeader< ::pr2_msgs::PowerBoardState_<ContainerAllocator> > : public TrueType {};
00313 template<class ContainerAllocator> struct HasHeader< const ::pr2_msgs::PowerBoardState_<ContainerAllocator> > : public TrueType {};
00314 }
00315 }
00316
00317 namespace ros
00318 {
00319 namespace serialization
00320 {
00321
00322 template<class ContainerAllocator> struct Serializer< ::pr2_msgs::PowerBoardState_<ContainerAllocator> >
00323 {
00324 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00325 {
00326 stream.next(m.header);
00327 stream.next(m.name);
00328 stream.next(m.serial_num);
00329 stream.next(m.input_voltage);
00330 stream.next(m.master_state);
00331 stream.next(m.circuit_state);
00332 stream.next(m.circuit_voltage);
00333 stream.next(m.run_stop);
00334 stream.next(m.wireless_stop);
00335 }
00336
00337 ROS_DECLARE_ALLINONE_SERIALIZER;
00338 };
00339 }
00340 }
00341
00342 namespace ros
00343 {
00344 namespace message_operations
00345 {
00346
00347 template<class ContainerAllocator>
00348 struct Printer< ::pr2_msgs::PowerBoardState_<ContainerAllocator> >
00349 {
00350 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::pr2_msgs::PowerBoardState_<ContainerAllocator> & v)
00351 {
00352 s << indent << "header: ";
00353 s << std::endl;
00354 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00355 s << indent << "name: ";
00356 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.name);
00357 s << indent << "serial_num: ";
00358 Printer<uint32_t>::stream(s, indent + " ", v.serial_num);
00359 s << indent << "input_voltage: ";
00360 Printer<double>::stream(s, indent + " ", v.input_voltage);
00361 s << indent << "master_state: ";
00362 Printer<int8_t>::stream(s, indent + " ", v.master_state);
00363 s << indent << "circuit_state[]" << std::endl;
00364 for (size_t i = 0; i < v.circuit_state.size(); ++i)
00365 {
00366 s << indent << " circuit_state[" << i << "]: ";
00367 Printer<int8_t>::stream(s, indent + " ", v.circuit_state[i]);
00368 }
00369 s << indent << "circuit_voltage[]" << std::endl;
00370 for (size_t i = 0; i < v.circuit_voltage.size(); ++i)
00371 {
00372 s << indent << " circuit_voltage[" << i << "]: ";
00373 Printer<double>::stream(s, indent + " ", v.circuit_voltage[i]);
00374 }
00375 s << indent << "run_stop: ";
00376 Printer<uint8_t>::stream(s, indent + " ", v.run_stop);
00377 s << indent << "wireless_stop: ";
00378 Printer<uint8_t>::stream(s, indent + " ", v.wireless_stop);
00379 }
00380 };
00381
00382
00383 }
00384 }
00385
00386 #endif // PR2_MSGS_MESSAGE_POWERBOARDSTATE_H
00387