Class: Pr2_controllers_msgs::SingleJointPositionGoal
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Pr2_controllers_msgs::SingleJointPositionGoal
- Defined in:
- lib/pr2_controllers_msgs/SingleJointPositionGoal.rb
Constant Summary collapse
- @@struct_dl2d =
::ROS::Struct.new("dl2d")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['float64','duration','float64']
Instance Attribute Summary collapse
-
#max_velocity ⇒ Object
Returns the value of attribute max_velocity.
-
#min_duration ⇒ Object
Returns the value of attribute min_duration.
-
#position ⇒ Object
Returns the value of attribute position.
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 = {}) ⇒ SingleJointPositionGoal
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ SingleJointPositionGoal
Constructor. You can set the default values using keyword operators.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 42 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[:min_duration] @min_duration = args[:min_duration] else @min_duration = ROS::Duration.new end if args[:max_velocity] @max_velocity = args[:max_velocity] else @max_velocity = 0.0 end end |
Instance Attribute Details
#max_velocity ⇒ Object
Returns the value of attribute max_velocity.
29 30 31 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 29 def max_velocity @max_velocity end |
#min_duration ⇒ Object
Returns the value of attribute min_duration.
29 30 31 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 29 def min_duration @min_duration end |
#position ⇒ Object
Returns the value of attribute position.
29 30 31 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 29 def position @position end |
Class Method Details
.md5sum ⇒ Object
9 10 11 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 9 def self.md5sum "fbaaa562a23a013fd5053e5f72cbb35c" end |
.type ⇒ Object
13 14 15 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 13 def self.type "pr2_controllers_msgs/SingleJointPositionGoal" end |
Instance Method Details
#_get_types ⇒ String
internal API method
63 64 65 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 63 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
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 80 def deserialize(str) begin if @min_duration == nil @min_duration = ROS::Duration.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('dl2d') (@position, @min_duration.secs, @min_duration.nsecs, @max_velocity,) = @@struct_dl2d.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/SingleJointPositionGoal.rb', line 17 def has_header? false end |
#message_definition ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 21 def "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== float64 position duration min_duration float64 max_velocity " end |
#serialize(buff) ⇒ Object
serialize message into buffer
69 70 71 72 73 74 75 76 |
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 69 def serialize(buff) begin buff.write(@@struct_dl2d.pack(@position, @min_duration.secs, @min_duration.nsecs, @max_velocity)) rescue => exception raise "some erro in serialize: #{exception}" end end |