00001
00002
00003 package ros.pkg.sensor_msgs.msg;
00004
00005 import java.nio.ByteBuffer;
00006
00007 public class JointState extends ros.communication.Message {
00008
00009 public ros.pkg.std_msgs.msg.Header header = new ros.pkg.std_msgs.msg.Header();
00010 public java.util.ArrayList<java.lang.String> name = new java.util.ArrayList<java.lang.String>();
00011 public double[] position = new double[0];
00012 public double[] velocity = new double[0];
00013 public double[] effort = new double[0];
00014
00015 public JointState() {
00016 }
00017
00018 public static java.lang.String __s_getDataType() { return "sensor_msgs/JointState"; }
00019 public java.lang.String getDataType() { return __s_getDataType(); }
00020 public static java.lang.String __s_getMD5Sum() { return "3066dcd76a6cfaef579bd0f34173e9fd"; }
00021 public java.lang.String getMD5Sum() { return __s_getMD5Sum(); }
00022 public static java.lang.String __s_getMessageDefinition() { return "# This is a message that holds data to describe the state of a set of torque controlled joints. \n" +
00023 "#\n" +
00024 "# The state of each joint (revolute or prismatic) is defined by:\n" +
00025 "# * the position of the joint (rad or m),\n" +
00026 "# * the velocity of the joint (rad/s or m/s) and \n" +
00027 "# * the effort that is applied in the joint (Nm or N).\n" +
00028 "#\n" +
00029 "# Each joint is uniquely identified by its name\n" +
00030 "# The header specifies the time at which the joint states were recorded. All the joint states\n" +
00031 "# in one message have to be recorded at the same time.\n" +
00032 "#\n" +
00033 "# This message consists of a multiple arrays, one for each part of the joint state. \n" +
00034 "# The goal is to make each of the fields optional. When e.g. your joints have no\n" +
00035 "# effort associated with them, you can leave the effort array empty. \n" +
00036 "#\n" +
00037 "# All arrays in this message should have the same size, or be empty.\n" +
00038 "# This is the only way to uniquely associate the joint name with the correct\n" +
00039 "# states.\n" +
00040 "\n" +
00041 "\n" +
00042 "Header header\n" +
00043 "\n" +
00044 "string[] name\n" +
00045 "float64[] position\n" +
00046 "float64[] velocity\n" +
00047 "float64[] effort\n" +
00048 "\n" +
00049 "================================================================================\n" +
00050 "MSG: std_msgs/Header\n" +
00051 "# Standard metadata for higher-level stamped data types.\n" +
00052 "# This is generally used to communicate timestamped data \n" +
00053 "# in a particular coordinate frame.\n" +
00054 "# \n" +
00055 "# sequence ID: consecutively increasing ID \n" +
00056 "uint32 seq\n" +
00057 "#Two-integer timestamp that is expressed as:\n" +
00058 "# * stamp.secs: seconds (stamp_secs) since epoch\n" +
00059 "# * stamp.nsecs: nanoseconds since stamp_secs\n" +
00060 "# time-handling sugar is provided by the client library\n" +
00061 "time stamp\n" +
00062 "#Frame this data is associated with\n" +
00063 "# 0: no frame\n" +
00064 "# 1: global frame\n" +
00065 "string frame_id\n" +
00066 "\n" +
00067 ""; }
00068 public java.lang.String getMessageDefinition() { return __s_getMessageDefinition(); }
00069
00070 public JointState clone() {
00071 JointState c = new JointState();
00072 c.deserialize(serialize(0));
00073 return c;
00074 }
00075
00076 public void setTo(ros.communication.Message m) {
00077 deserialize(m.serialize(0));
00078 }
00079
00080 public int serializationLength() {
00081 int __l = 0;
00082 __l += header.serializationLength();
00083 __l += 4;
00084 for(java.lang.String val : name) {
00085 __l += 4 + val.length();
00086 }
00087 __l += 4 + position.length * 8;
00088 __l += 4 + velocity.length * 8;
00089 __l += 4 + effort.length * 8;
00090 return __l;
00091 }
00092
00093 public void serialize(ByteBuffer bb, int seq) {
00094 header.serialize(bb, seq);
00095 bb.putInt(name.size());
00096 for(java.lang.String val : name) {
00097 Serialization.writeString(bb, val);
00098 }
00099 bb.putInt(position.length);
00100 for(double val : position) {
00101 bb.putDouble(val);
00102 }
00103 bb.putInt(velocity.length);
00104 for(double val : velocity) {
00105 bb.putDouble(val);
00106 }
00107 bb.putInt(effort.length);
00108 for(double val : effort) {
00109 bb.putDouble(val);
00110 }
00111 }
00112
00113 public void deserialize(ByteBuffer bb) {
00114 header.deserialize(bb);
00115
00116 int __name_len = bb.getInt();
00117 name = new java.util.ArrayList<java.lang.String>(__name_len);
00118 for(int __i=0; __i<__name_len; __i++) {
00119 name.add(Serialization.readString(bb));
00120 }
00121
00122 int __position_len = bb.getInt();
00123 position = new double[__position_len];
00124 for(int __i=0; __i<__position_len; __i++) {
00125 position[__i] = bb.getDouble();
00126 }
00127
00128 int __velocity_len = bb.getInt();
00129 velocity = new double[__velocity_len];
00130 for(int __i=0; __i<__velocity_len; __i++) {
00131 velocity[__i] = bb.getDouble();
00132 }
00133
00134 int __effort_len = bb.getInt();
00135 effort = new double[__effort_len];
00136 for(int __i=0; __i<__effort_len; __i++) {
00137 effort[__i] = bb.getDouble();
00138 }
00139 }
00140
00141 @SuppressWarnings("all")
00142 public boolean equals(Object o) {
00143 if(!(o instanceof JointState))
00144 return false;
00145 JointState other = (JointState) o;
00146 return
00147 header.equals(other.header) &&
00148 name.equals(other.name) &&
00149 java.util.Arrays.equals(position, other.position) &&
00150 java.util.Arrays.equals(velocity, other.velocity) &&
00151 java.util.Arrays.equals(effort, other.effort) &&
00152 true;
00153 }
00154
00155 @SuppressWarnings("all")
00156 public int hashCode() {
00157 final int prime = 31;
00158 int result = 1;
00159 long tmp;
00160 result = prime * result + (this.header == null ? 0 : this.header.hashCode());
00161 result = prime * result + (this.name == null ? 0 : this.name.hashCode());
00162 result = prime * result + java.util.Arrays.hashCode(this.position);
00163 result = prime * result + java.util.Arrays.hashCode(this.velocity);
00164 result = prime * result + java.util.Arrays.hashCode(this.effort);
00165 return result;
00166 }
00167 }
00168