Class: Pr2_controllers_msgs::SingleJointPositionGoal

Inherits:
ROS::Message
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ SingleJointPositionGoal

Constructor. You can set the default values using keyword operators.

Parameters:

  • args (Hash) (defaults to: {})

    keyword for initializing values

Options Hash (args):

  • :position (float64)

    initialize value

  • :min_duration (duration)

    initialize value

  • :max_velocity (float64)

    initialize value



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_velocityObject

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_durationObject

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

#positionObject

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

.md5sumObject



9
10
11
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 9

def self.md5sum
  "fbaaa562a23a013fd5053e5f72cbb35c"
end

.typeObject



13
14
15
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 13

def self.type
  "pr2_controllers_msgs/SingleJointPositionGoal"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



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

Returns:

  • (Boolean)


17
18
19
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 17

def has_header?
  false
end

#message_definitionObject



21
22
23
24
25
26
27
28
# File 'lib/pr2_controllers_msgs/SingleJointPositionGoal.rb', line 21

def message_definition
  "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
float64 position
duration min_duration
float64 max_velocity

"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    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