00001
00002 #ifndef P2OS_DRIVER_MESSAGE_SONARARRAY_H
00003 #define P2OS_DRIVER_MESSAGE_SONARARRAY_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 p2os_driver
00016 {
00017 template <class ContainerAllocator>
00018 struct SonarArray_ : public ros::Message
00019 {
00020 typedef SonarArray_<ContainerAllocator> Type;
00021
00022 SonarArray_()
00023 : header()
00024 , ranges_count(0)
00025 , ranges()
00026 {
00027 }
00028
00029 SonarArray_(const ContainerAllocator& _alloc)
00030 : header(_alloc)
00031 , ranges_count(0)
00032 , ranges(_alloc)
00033 {
00034 }
00035
00036 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00037 ::std_msgs::Header_<ContainerAllocator> header;
00038
00039 typedef int32_t _ranges_count_type;
00040 int32_t ranges_count;
00041
00042 typedef std::vector<double, typename ContainerAllocator::template rebind<double>::other > _ranges_type;
00043 std::vector<double, typename ContainerAllocator::template rebind<double>::other > ranges;
00044
00045
00046 ROS_DEPRECATED uint32_t get_ranges_size() const { return (uint32_t)ranges.size(); }
00047 ROS_DEPRECATED void set_ranges_size(uint32_t size) { ranges.resize((size_t)size); }
00048 ROS_DEPRECATED void get_ranges_vec(std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) const { vec = this->ranges; }
00049 ROS_DEPRECATED void set_ranges_vec(const std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) { this->ranges = vec; }
00050 private:
00051 static const char* __s_getDataType_() { return "p2os_driver/SonarArray"; }
00052 public:
00053 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00054
00055 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00056
00057 private:
00058 static const char* __s_getMD5Sum_() { return "2984921c09aef26ad253c7629937a5bb"; }
00059 public:
00060 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00061
00062 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00063
00064 private:
00065 static const char* __s_getMessageDefinition_() { return "Header header\n\
00066 int32 ranges_count\n\
00067 float64[] ranges\n\
00068 \n\
00069 ================================================================================\n\
00070 MSG: std_msgs/Header\n\
00071 # Standard metadata for higher-level stamped data types.\n\
00072 # This is generally used to communicate timestamped data \n\
00073 # in a particular coordinate frame.\n\
00074 # \n\
00075 # sequence ID: consecutively increasing ID \n\
00076 uint32 seq\n\
00077 #Two-integer timestamp that is expressed as:\n\
00078 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00079 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00080 # time-handling sugar is provided by the client library\n\
00081 time stamp\n\
00082 #Frame this data is associated with\n\
00083 # 0: no frame\n\
00084 # 1: global frame\n\
00085 string frame_id\n\
00086 \n\
00087 "; }
00088 public:
00089 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00090
00091 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00092
00093 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00094 {
00095 ros::serialization::OStream stream(write_ptr, 1000000000);
00096 ros::serialization::serialize(stream, header);
00097 ros::serialization::serialize(stream, ranges_count);
00098 ros::serialization::serialize(stream, ranges);
00099 return stream.getData();
00100 }
00101
00102 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00103 {
00104 ros::serialization::IStream stream(read_ptr, 1000000000);
00105 ros::serialization::deserialize(stream, header);
00106 ros::serialization::deserialize(stream, ranges_count);
00107 ros::serialization::deserialize(stream, ranges);
00108 return stream.getData();
00109 }
00110
00111 ROS_DEPRECATED virtual uint32_t serializationLength() const
00112 {
00113 uint32_t size = 0;
00114 size += ros::serialization::serializationLength(header);
00115 size += ros::serialization::serializationLength(ranges_count);
00116 size += ros::serialization::serializationLength(ranges);
00117 return size;
00118 }
00119
00120 typedef boost::shared_ptr< ::p2os_driver::SonarArray_<ContainerAllocator> > Ptr;
00121 typedef boost::shared_ptr< ::p2os_driver::SonarArray_<ContainerAllocator> const> ConstPtr;
00122 };
00123 typedef ::p2os_driver::SonarArray_<std::allocator<void> > SonarArray;
00124
00125 typedef boost::shared_ptr< ::p2os_driver::SonarArray> SonarArrayPtr;
00126 typedef boost::shared_ptr< ::p2os_driver::SonarArray const> SonarArrayConstPtr;
00127
00128
00129 template<typename ContainerAllocator>
00130 std::ostream& operator<<(std::ostream& s, const ::p2os_driver::SonarArray_<ContainerAllocator> & v)
00131 {
00132 ros::message_operations::Printer< ::p2os_driver::SonarArray_<ContainerAllocator> >::stream(s, "", v);
00133 return s;}
00134
00135 }
00136
00137 namespace ros
00138 {
00139 namespace message_traits
00140 {
00141 template<class ContainerAllocator>
00142 struct MD5Sum< ::p2os_driver::SonarArray_<ContainerAllocator> > {
00143 static const char* value()
00144 {
00145 return "2984921c09aef26ad253c7629937a5bb";
00146 }
00147
00148 static const char* value(const ::p2os_driver::SonarArray_<ContainerAllocator> &) { return value(); }
00149 static const uint64_t static_value1 = 0x2984921c09aef26aULL;
00150 static const uint64_t static_value2 = 0xd253c7629937a5bbULL;
00151 };
00152
00153 template<class ContainerAllocator>
00154 struct DataType< ::p2os_driver::SonarArray_<ContainerAllocator> > {
00155 static const char* value()
00156 {
00157 return "p2os_driver/SonarArray";
00158 }
00159
00160 static const char* value(const ::p2os_driver::SonarArray_<ContainerAllocator> &) { return value(); }
00161 };
00162
00163 template<class ContainerAllocator>
00164 struct Definition< ::p2os_driver::SonarArray_<ContainerAllocator> > {
00165 static const char* value()
00166 {
00167 return "Header header\n\
00168 int32 ranges_count\n\
00169 float64[] ranges\n\
00170 \n\
00171 ================================================================================\n\
00172 MSG: std_msgs/Header\n\
00173 # Standard metadata for higher-level stamped data types.\n\
00174 # This is generally used to communicate timestamped data \n\
00175 # in a particular coordinate frame.\n\
00176 # \n\
00177 # sequence ID: consecutively increasing ID \n\
00178 uint32 seq\n\
00179 #Two-integer timestamp that is expressed as:\n\
00180 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00181 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00182 # time-handling sugar is provided by the client library\n\
00183 time stamp\n\
00184 #Frame this data is associated with\n\
00185 # 0: no frame\n\
00186 # 1: global frame\n\
00187 string frame_id\n\
00188 \n\
00189 ";
00190 }
00191
00192 static const char* value(const ::p2os_driver::SonarArray_<ContainerAllocator> &) { return value(); }
00193 };
00194
00195 template<class ContainerAllocator> struct HasHeader< ::p2os_driver::SonarArray_<ContainerAllocator> > : public TrueType {};
00196 template<class ContainerAllocator> struct HasHeader< const ::p2os_driver::SonarArray_<ContainerAllocator> > : public TrueType {};
00197 }
00198 }
00199
00200 namespace ros
00201 {
00202 namespace serialization
00203 {
00204
00205 template<class ContainerAllocator> struct Serializer< ::p2os_driver::SonarArray_<ContainerAllocator> >
00206 {
00207 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00208 {
00209 stream.next(m.header);
00210 stream.next(m.ranges_count);
00211 stream.next(m.ranges);
00212 }
00213
00214 ROS_DECLARE_ALLINONE_SERIALIZER;
00215 };
00216 }
00217 }
00218
00219 namespace ros
00220 {
00221 namespace message_operations
00222 {
00223
00224 template<class ContainerAllocator>
00225 struct Printer< ::p2os_driver::SonarArray_<ContainerAllocator> >
00226 {
00227 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::p2os_driver::SonarArray_<ContainerAllocator> & v)
00228 {
00229 s << indent << "header: ";
00230 s << std::endl;
00231 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00232 s << indent << "ranges_count: ";
00233 Printer<int32_t>::stream(s, indent + " ", v.ranges_count);
00234 s << indent << "ranges[]" << std::endl;
00235 for (size_t i = 0; i < v.ranges.size(); ++i)
00236 {
00237 s << indent << " ranges[" << i << "]: ";
00238 Printer<double>::stream(s, indent + " ", v.ranges[i]);
00239 }
00240 }
00241 };
00242
00243
00244 }
00245 }
00246
00247 #endif // P2OS_DRIVER_MESSAGE_SONARARRAY_H
00248