00001
00002 #ifndef SENSOR_MSGS_MESSAGE_JOINTSTATE_H
00003 #define SENSOR_MSGS_MESSAGE_JOINTSTATE_H
00004 #include <string>
00005 #include <vector>
00006 #include <map>
00007 #include <ostream>
00008 #include "ros/serialization.h"
00009 #include "ros/builtin_message_traits.h"
00010 #include "ros/message_operations.h"
00011 #include "ros/time.h"
00012
00013 #include "ros/macros.h"
00014
00015 #include "ros/assert.h"
00016
00017 #include "std_msgs/Header.h"
00018
00019 namespace sensor_msgs
00020 {
00021 template <class ContainerAllocator>
00022 struct JointState_ {
00023 typedef JointState_<ContainerAllocator> Type;
00024
00025 JointState_()
00026 : header()
00027 , name()
00028 , position()
00029 , velocity()
00030 , effort()
00031 {
00032 }
00033
00034 JointState_(const ContainerAllocator& _alloc)
00035 : header(_alloc)
00036 , name(_alloc)
00037 , position(_alloc)
00038 , velocity(_alloc)
00039 , effort(_alloc)
00040 {
00041 }
00042
00043 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00044 ::std_msgs::Header_<ContainerAllocator> header;
00045
00046 typedef std::vector<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > , typename ContainerAllocator::template rebind<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::other > _name_type;
00047 std::vector<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > , typename ContainerAllocator::template rebind<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::other > name;
00048
00049 typedef std::vector<double, typename ContainerAllocator::template rebind<double>::other > _position_type;
00050 std::vector<double, typename ContainerAllocator::template rebind<double>::other > position;
00051
00052 typedef std::vector<double, typename ContainerAllocator::template rebind<double>::other > _velocity_type;
00053 std::vector<double, typename ContainerAllocator::template rebind<double>::other > velocity;
00054
00055 typedef std::vector<double, typename ContainerAllocator::template rebind<double>::other > _effort_type;
00056 std::vector<double, typename ContainerAllocator::template rebind<double>::other > effort;
00057
00058
00059 ROS_DEPRECATED uint32_t get_name_size() const { return (uint32_t)name.size(); }
00060 ROS_DEPRECATED void set_name_size(uint32_t size) { name.resize((size_t)size); }
00061 ROS_DEPRECATED void get_name_vec(std::vector<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > , typename ContainerAllocator::template rebind<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::other > & vec) const { vec = this->name; }
00062 ROS_DEPRECATED void set_name_vec(const std::vector<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > , typename ContainerAllocator::template rebind<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::other > & vec) { this->name = vec; }
00063 ROS_DEPRECATED uint32_t get_position_size() const { return (uint32_t)position.size(); }
00064 ROS_DEPRECATED void set_position_size(uint32_t size) { position.resize((size_t)size); }
00065 ROS_DEPRECATED void get_position_vec(std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) const { vec = this->position; }
00066 ROS_DEPRECATED void set_position_vec(const std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) { this->position = vec; }
00067 ROS_DEPRECATED uint32_t get_velocity_size() const { return (uint32_t)velocity.size(); }
00068 ROS_DEPRECATED void set_velocity_size(uint32_t size) { velocity.resize((size_t)size); }
00069 ROS_DEPRECATED void get_velocity_vec(std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) const { vec = this->velocity; }
00070 ROS_DEPRECATED void set_velocity_vec(const std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) { this->velocity = vec; }
00071 ROS_DEPRECATED uint32_t get_effort_size() const { return (uint32_t)effort.size(); }
00072 ROS_DEPRECATED void set_effort_size(uint32_t size) { effort.resize((size_t)size); }
00073 ROS_DEPRECATED void get_effort_vec(std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) const { vec = this->effort; }
00074 ROS_DEPRECATED void set_effort_vec(const std::vector<double, typename ContainerAllocator::template rebind<double>::other > & vec) { this->effort = vec; }
00075 private:
00076 static const char* __s_getDataType_() { return "sensor_msgs/JointState"; }
00077 public:
00078 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00079
00080 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00081
00082 private:
00083 static const char* __s_getMD5Sum_() { return "3066dcd76a6cfaef579bd0f34173e9fd"; }
00084 public:
00085 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00086
00087 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00088
00089 private:
00090 static const char* __s_getMessageDefinition_() { return "# This is a message that holds data to describe the state of a set of torque controlled joints. \n\
00091 #\n\
00092 # The state of each joint (revolute or prismatic) is defined by:\n\
00093 # * the position of the joint (rad or m),\n\
00094 # * the velocity of the joint (rad/s or m/s) and \n\
00095 # * the effort that is applied in the joint (Nm or N).\n\
00096 #\n\
00097 # Each joint is uniquely identified by its name\n\
00098 # The header specifies the time at which the joint states were recorded. All the joint states\n\
00099 # in one message have to be recorded at the same time.\n\
00100 #\n\
00101 # This message consists of a multiple arrays, one for each part of the joint state. \n\
00102 # The goal is to make each of the fields optional. When e.g. your joints have no\n\
00103 # effort associated with them, you can leave the effort array empty. \n\
00104 #\n\
00105 # All arrays in this message should have the same size, or be empty.\n\
00106 # This is the only way to uniquely associate the joint name with the correct\n\
00107 # states.\n\
00108 \n\
00109 \n\
00110 Header header\n\
00111 \n\
00112 string[] name\n\
00113 float64[] position\n\
00114 float64[] velocity\n\
00115 float64[] effort\n\
00116 \n\
00117 ================================================================================\n\
00118 MSG: std_msgs/Header\n\
00119 # Standard metadata for higher-level stamped data types.\n\
00120 # This is generally used to communicate timestamped data \n\
00121 # in a particular coordinate frame.\n\
00122 # \n\
00123 # sequence ID: consecutively increasing ID \n\
00124 uint32 seq\n\
00125 #Two-integer timestamp that is expressed as:\n\
00126 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00127 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00128 # time-handling sugar is provided by the client library\n\
00129 time stamp\n\
00130 #Frame this data is associated with\n\
00131 # 0: no frame\n\
00132 # 1: global frame\n\
00133 string frame_id\n\
00134 \n\
00135 "; }
00136 public:
00137 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00138
00139 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00140
00141 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00142 {
00143 ros::serialization::OStream stream(write_ptr, 1000000000);
00144 ros::serialization::serialize(stream, header);
00145 ros::serialization::serialize(stream, name);
00146 ros::serialization::serialize(stream, position);
00147 ros::serialization::serialize(stream, velocity);
00148 ros::serialization::serialize(stream, effort);
00149 return stream.getData();
00150 }
00151
00152 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00153 {
00154 ros::serialization::IStream stream(read_ptr, 1000000000);
00155 ros::serialization::deserialize(stream, header);
00156 ros::serialization::deserialize(stream, name);
00157 ros::serialization::deserialize(stream, position);
00158 ros::serialization::deserialize(stream, velocity);
00159 ros::serialization::deserialize(stream, effort);
00160 return stream.getData();
00161 }
00162
00163 ROS_DEPRECATED virtual uint32_t serializationLength() const
00164 {
00165 uint32_t size = 0;
00166 size += ros::serialization::serializationLength(header);
00167 size += ros::serialization::serializationLength(name);
00168 size += ros::serialization::serializationLength(position);
00169 size += ros::serialization::serializationLength(velocity);
00170 size += ros::serialization::serializationLength(effort);
00171 return size;
00172 }
00173
00174 typedef boost::shared_ptr< ::sensor_msgs::JointState_<ContainerAllocator> > Ptr;
00175 typedef boost::shared_ptr< ::sensor_msgs::JointState_<ContainerAllocator> const> ConstPtr;
00176 boost::shared_ptr<std::map<std::string, std::string> > __connection_header;
00177 };
00178 typedef ::sensor_msgs::JointState_<std::allocator<void> > JointState;
00179
00180 typedef boost::shared_ptr< ::sensor_msgs::JointState> JointStatePtr;
00181 typedef boost::shared_ptr< ::sensor_msgs::JointState const> JointStateConstPtr;
00182
00183
00184 template<typename ContainerAllocator>
00185 std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::JointState_<ContainerAllocator> & v)
00186 {
00187 ros::message_operations::Printer< ::sensor_msgs::JointState_<ContainerAllocator> >::stream(s, "", v);
00188 return s;}
00189
00190 }
00191
00192 namespace ros
00193 {
00194 namespace message_traits
00195 {
00196 template<class ContainerAllocator> struct IsMessage< ::sensor_msgs::JointState_<ContainerAllocator> > : public TrueType {};
00197 template<class ContainerAllocator> struct IsMessage< ::sensor_msgs::JointState_<ContainerAllocator> const> : public TrueType {};
00198 template<class ContainerAllocator>
00199 struct MD5Sum< ::sensor_msgs::JointState_<ContainerAllocator> > {
00200 static const char* value()
00201 {
00202 return "3066dcd76a6cfaef579bd0f34173e9fd";
00203 }
00204
00205 static const char* value(const ::sensor_msgs::JointState_<ContainerAllocator> &) { return value(); }
00206 static const uint64_t static_value1 = 0x3066dcd76a6cfaefULL;
00207 static const uint64_t static_value2 = 0x579bd0f34173e9fdULL;
00208 };
00209
00210 template<class ContainerAllocator>
00211 struct DataType< ::sensor_msgs::JointState_<ContainerAllocator> > {
00212 static const char* value()
00213 {
00214 return "sensor_msgs/JointState";
00215 }
00216
00217 static const char* value(const ::sensor_msgs::JointState_<ContainerAllocator> &) { return value(); }
00218 };
00219
00220 template<class ContainerAllocator>
00221 struct Definition< ::sensor_msgs::JointState_<ContainerAllocator> > {
00222 static const char* value()
00223 {
00224 return "# This is a message that holds data to describe the state of a set of torque controlled joints. \n\
00225 #\n\
00226 # The state of each joint (revolute or prismatic) is defined by:\n\
00227 # * the position of the joint (rad or m),\n\
00228 # * the velocity of the joint (rad/s or m/s) and \n\
00229 # * the effort that is applied in the joint (Nm or N).\n\
00230 #\n\
00231 # Each joint is uniquely identified by its name\n\
00232 # The header specifies the time at which the joint states were recorded. All the joint states\n\
00233 # in one message have to be recorded at the same time.\n\
00234 #\n\
00235 # This message consists of a multiple arrays, one for each part of the joint state. \n\
00236 # The goal is to make each of the fields optional. When e.g. your joints have no\n\
00237 # effort associated with them, you can leave the effort array empty. \n\
00238 #\n\
00239 # All arrays in this message should have the same size, or be empty.\n\
00240 # This is the only way to uniquely associate the joint name with the correct\n\
00241 # states.\n\
00242 \n\
00243 \n\
00244 Header header\n\
00245 \n\
00246 string[] name\n\
00247 float64[] position\n\
00248 float64[] velocity\n\
00249 float64[] effort\n\
00250 \n\
00251 ================================================================================\n\
00252 MSG: std_msgs/Header\n\
00253 # Standard metadata for higher-level stamped data types.\n\
00254 # This is generally used to communicate timestamped data \n\
00255 # in a particular coordinate frame.\n\
00256 # \n\
00257 # sequence ID: consecutively increasing ID \n\
00258 uint32 seq\n\
00259 #Two-integer timestamp that is expressed as:\n\
00260 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00261 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00262 # time-handling sugar is provided by the client library\n\
00263 time stamp\n\
00264 #Frame this data is associated with\n\
00265 # 0: no frame\n\
00266 # 1: global frame\n\
00267 string frame_id\n\
00268 \n\
00269 ";
00270 }
00271
00272 static const char* value(const ::sensor_msgs::JointState_<ContainerAllocator> &) { return value(); }
00273 };
00274
00275 template<class ContainerAllocator> struct HasHeader< ::sensor_msgs::JointState_<ContainerAllocator> > : public TrueType {};
00276 template<class ContainerAllocator> struct HasHeader< const ::sensor_msgs::JointState_<ContainerAllocator> > : public TrueType {};
00277 }
00278 }
00279
00280 namespace ros
00281 {
00282 namespace serialization
00283 {
00284
00285 template<class ContainerAllocator> struct Serializer< ::sensor_msgs::JointState_<ContainerAllocator> >
00286 {
00287 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00288 {
00289 stream.next(m.header);
00290 stream.next(m.name);
00291 stream.next(m.position);
00292 stream.next(m.velocity);
00293 stream.next(m.effort);
00294 }
00295
00296 ROS_DECLARE_ALLINONE_SERIALIZER;
00297 };
00298 }
00299 }
00300
00301 namespace ros
00302 {
00303 namespace message_operations
00304 {
00305
00306 template<class ContainerAllocator>
00307 struct Printer< ::sensor_msgs::JointState_<ContainerAllocator> >
00308 {
00309 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::sensor_msgs::JointState_<ContainerAllocator> & v)
00310 {
00311 s << indent << "header: ";
00312 s << std::endl;
00313 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00314 s << indent << "name[]" << std::endl;
00315 for (size_t i = 0; i < v.name.size(); ++i)
00316 {
00317 s << indent << " name[" << i << "]: ";
00318 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.name[i]);
00319 }
00320 s << indent << "position[]" << std::endl;
00321 for (size_t i = 0; i < v.position.size(); ++i)
00322 {
00323 s << indent << " position[" << i << "]: ";
00324 Printer<double>::stream(s, indent + " ", v.position[i]);
00325 }
00326 s << indent << "velocity[]" << std::endl;
00327 for (size_t i = 0; i < v.velocity.size(); ++i)
00328 {
00329 s << indent << " velocity[" << i << "]: ";
00330 Printer<double>::stream(s, indent + " ", v.velocity[i]);
00331 }
00332 s << indent << "effort[]" << std::endl;
00333 for (size_t i = 0; i < v.effort.size(); ++i)
00334 {
00335 s << indent << " effort[" << i << "]: ";
00336 Printer<double>::stream(s, indent + " ", v.effort[i]);
00337 }
00338 }
00339 };
00340
00341
00342 }
00343 }
00344
00345 #endif // SENSOR_MSGS_MESSAGE_JOINTSTATE_H
00346