Class: Pr2_controllers_msgs::Pr2GripperCommandResult
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Pr2_controllers_msgs::Pr2GripperCommandResult
- Defined in:
- lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb
Constant Summary collapse
- @@struct_d2C2 =
::ROS::Struct.new("d2C2")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['float64','float64','bool','bool']
Instance Attribute Summary collapse
-
#effort ⇒ Object
Returns the value of attribute effort.
-
#position ⇒ Object
Returns the value of attribute position.
-
#reached_goal ⇒ Object
Returns the value of attribute reached_goal.
-
#stalled ⇒ Object
Returns the value of attribute stalled.
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 = {}) ⇒ Pr2GripperCommandResult
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ Pr2GripperCommandResult
Constructor. You can set the default values using keyword operators.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 43 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:position] @position = args[:position] else @position = 0.0 end if args[:effort] @effort = args[:effort] else @effort = 0.0 end if args[:stalled] @stalled = args[:stalled] else @stalled = false end if args[:reached_goal] @reached_goal = args[:reached_goal] else @reached_goal = false end end |
Instance Attribute Details
#effort ⇒ Object
Returns the value of attribute effort.
29 30 31 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 29 def effort @effort end |
#position ⇒ Object
Returns the value of attribute position.
29 30 31 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 29 def position @position end |
#reached_goal ⇒ Object
Returns the value of attribute reached_goal.
29 30 31 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 29 def reached_goal @reached_goal end |
#stalled ⇒ Object
Returns the value of attribute stalled.
29 30 31 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 29 def stalled @stalled end |
Class Method Details
.md5sum ⇒ Object
8 9 10 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 8 def self.md5sum "e4cbff56d3562bcf113da5a5adeef91f" end |
.type ⇒ Object
12 13 14 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 12 def self.type "pr2_controllers_msgs/Pr2GripperCommandResult" end |
Instance Method Details
#_get_types ⇒ String
internal API method
69 70 71 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 69 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
86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 86 def deserialize(str) begin end_point = 0 start = end_point end_point += ROS::Struct::calc_size('d2C2') (@position, @effort, @stalled, @reached_goal,) = @@struct_d2C2.unpack(str[start..(end_point-1)]) @stalled = bool(@stalled) @reached_goal = bool(@reached_goal) return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
16 17 18 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 16 def has_header? false end |
#message_definition ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 20 def "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== float64 position # The current gripper gap size (in meters) float64 effort # The current effort exerted (in Newtons) bool stalled # True iff the gripper is exerting max effort and not moving bool reached_goal # True iff the gripper position has reached the commanded setpoint " end |
#serialize(buff) ⇒ Object
serialize message into buffer
75 76 77 78 79 80 81 82 |
# File 'lib/pr2_controllers_msgs/Pr2GripperCommandResult.rb', line 75 def serialize(buff) begin buff.write(@@struct_d2C2.pack(@position, @effort, @stalled, @reached_goal)) rescue => exception raise "some erro in serialize: #{exception}" end end |