Class: Pr2_controllers_msgs::JointControllerState
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Pr2_controllers_msgs::JointControllerState
- Defined in:
- lib/pr2_controllers_msgs/JointControllerState.rb
Constant Summary collapse
- @@struct_L3 =
::ROS::Struct.new("L3")
- @@struct_d10 =
::ROS::Struct.new("d10")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['Header','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64']
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#d ⇒ Object
Returns the value of attribute d.
-
#error ⇒ Object
Returns the value of attribute error.
-
#header ⇒ Object
Returns the value of attribute header.
-
#i ⇒ Object
Returns the value of attribute i.
-
#i_clamp ⇒ Object
Returns the value of attribute i_clamp.
-
#p ⇒ Object
Returns the value of attribute p.
-
#process_value ⇒ Object
Returns the value of attribute process_value.
-
#process_value_dot ⇒ Object
Returns the value of attribute process_value_dot.
-
#set_point ⇒ Object
Returns the value of attribute set_point.
-
#time_step ⇒ Object
Returns the value of attribute time_step.
Class Method Summary collapse
Instance Method Summary collapse
-
#_get_types ⇒ String
internal API method.
-
#deserialize(str) ⇒ Object
unpack serialized message in str into this message instance @param [String] str: byte array of serialized message.
- #has_header? ⇒ Boolean
-
#initialize(args = {}) ⇒ JointControllerState
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ JointControllerState
Constructor. You can set the default values using keyword operators.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 77 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:header] @header = args[:header] else @header = Std_msgs::Header.new end if args[:set_point] @set_point = args[:set_point] else @set_point = 0.0 end if args[:process_value] @process_value = args[:process_value] else @process_value = 0.0 end if args[:process_value_dot] @process_value_dot = args[:process_value_dot] else @process_value_dot = 0.0 end if args[:error] @error = args[:error] else @error = 0.0 end if args[:time_step] @time_step = args[:time_step] else @time_step = 0.0 end if args[:command] @command = args[:command] else @command = 0.0 end if args[:p] @p = args[:p] else @p = 0.0 end if args[:i] @i = args[:i] else @i = 0.0 end if args[:d] @d = args[:d] else @d = 0.0 end if args[:i_clamp] @i_clamp = args[:i_clamp] else @i_clamp = 0.0 end end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def command @command end |
#d ⇒ Object
Returns the value of attribute d.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def d @d end |
#error ⇒ Object
Returns the value of attribute error.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def error @error end |
#header ⇒ Object
Returns the value of attribute header.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def header @header end |
#i ⇒ Object
Returns the value of attribute i.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def i @i end |
#i_clamp ⇒ Object
Returns the value of attribute i_clamp.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def i_clamp @i_clamp end |
#p ⇒ Object
Returns the value of attribute p.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def p @p end |
#process_value ⇒ Object
Returns the value of attribute process_value.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def process_value @process_value end |
#process_value_dot ⇒ Object
Returns the value of attribute process_value_dot.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def process_value_dot @process_value_dot end |
#set_point ⇒ Object
Returns the value of attribute set_point.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def set_point @set_point end |
#time_step ⇒ Object
Returns the value of attribute time_step.
55 56 57 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 55 def time_step @time_step end |
Class Method Details
.md5sum ⇒ Object
9 10 11 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 9 def self.md5sum "c0d034a7bf20aeb1c37f3eccb7992b69" end |
.type ⇒ Object
13 14 15 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 13 def self.type "pr2_controllers_msgs/JointControllerState" end |
Instance Method Details
#_get_types ⇒ String
internal API method
138 139 140 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 138 def _get_types @slot_types end |
#deserialize(str) ⇒ Object
unpack serialized message in str into this message instance
@param [String] str: byte array of serialized message
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 159 def deserialize(str) begin if @header == nil @header = Std_msgs::Header.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L3') (@header.seq, @header.stamp.secs, @header.stamp.nsecs,) = @@struct_L3.unpack(str[start..(end_point-1)]) start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length @header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('d10') (@set_point, @process_value, @process_value_dot, @error, @time_step, @command, @p, @i, @d, @i_clamp,) = @@struct_d10.unpack(str[start..(end_point-1)]) return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
17 18 19 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 17 def has_header? true end |
#message_definition ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 21 def "Header header float64 set_point float64 process_value float64 process_value_dot float64 error float64 time_step float64 command float64 p float64 i float64 d float64 i_clamp ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id " end |
#serialize(buff) ⇒ Object
serialize message into buffer
144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/pr2_controllers_msgs/JointControllerState.rb', line 144 def serialize(buff) begin buff.write(@@struct_L3.pack(@header.seq, @header.stamp.secs, @header.stamp.nsecs)) _x = @header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_d10.pack(@set_point, @process_value, @process_value_dot, @error, @time_step, @command, @p, @i, @d, @i_clamp)) rescue => exception raise "some erro in serialize: #{exception}" end end |