Class: Pr2_controllers_msgs::JointTrajectoryGoal

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/pr2_controllers_msgs/JointTrajectoryGoal.rb

Constant Summary collapse

@@struct_L3 =
::ROS::Struct.new("L3")
@@struct_l2 =
::ROS::Struct.new("l2")
@@struct_L =
::ROS::Struct.new("L")
@@slot_types =
['trajectory_msgs/JointTrajectory']

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ JointTrajectoryGoal

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

Parameters:

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

    keyword for initializing values

Options Hash (args):

  • :trajectory (trajectory_msgs/JointTrajectory)

    initialize value



71
72
73
74
75
76
77
78
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 71

def initialize(args={})
  # message fields cannot be None, assign default values for those that are
  if args[:trajectory]
    @trajectory = args[:trajectory]
  else
    @trajectory = Trajectory_msgs::JointTrajectory.new
  end
end

Instance Attribute Details

#trajectoryObject

Returns the value of attribute trajectory.



59
60
61
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 59

def trajectory
  @trajectory
end

Class Method Details

.md5sumObject



12
13
14
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 12

def self.md5sum
  "48a668811b715b51af6b3383511ae27f"
end

.typeObject



16
17
18
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 16

def self.type
  "pr2_controllers_msgs/JointTrajectoryGoal"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



82
83
84
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 82

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


127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 127

def deserialize(str)

  begin
    if @trajectory == nil
      @trajectory = Trajectory_msgs::JointTrajectory.new
    end
    end_point = 0
    start = end_point
    end_point += ROS::Struct::calc_size('L3')
    (@trajectory.header.seq, @trajectory.header.stamp.secs, @trajectory.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
    @trajectory.header.frame_id = str[start..(end_point-1)]
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    @trajectory.joint_names = []
    length.times do
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      start = end_point
      end_point += length
      val1 = str[start..(end_point-1)]
      @trajectory.joint_names.push(val1)
    end
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    @trajectory.points = []
    length.times do
      val1 = Trajectory_msgs::JointTrajectoryPoint.new
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      pattern = "d#{length}"
      start = end_point
      end_point += ROS::Struct::calc_size("#{pattern}")
      val1.positions = str[start..(end_point-1)].unpack(pattern)
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      pattern = "d#{length}"
      start = end_point
      end_point += ROS::Struct::calc_size("#{pattern}")
      val1.velocities = str[start..(end_point-1)].unpack(pattern)
      start = end_point
      end_point += 4
      (length,) = @@struct_L.unpack(str[start..(end_point-1)])
      pattern = "d#{length}"
      start = end_point
      end_point += ROS::Struct::calc_size("#{pattern}")
      val1.accelerations = str[start..(end_point-1)].unpack(pattern)
      _v156 = val1.time_from_start
      _x = _v156
      start = end_point
      end_point += ROS::Struct::calc_size('l2')
      (_x.secs, _x.nsecs,) = @@struct_l2.unpack(str[start..(end_point-1)])
      @trajectory.points.push(val1)
    end
    return self
  rescue => exception
    raise "message DeserializationError: #{exception}" #most likely buffer underfill
  end
end

#has_header?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 20

def has_header?
  false
end

#message_definitionObject



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
55
56
57
58
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 24

def message_definition
  "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
trajectory_msgs/JointTrajectory trajectory

================================================================================
MSG: trajectory_msgs/JointTrajectory
Header header
string[] joint_names
JointTrajectoryPoint[] points
================================================================================
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

================================================================================
MSG: trajectory_msgs/JointTrajectoryPoint
float64[] positions
float64[] velocities
float64[] accelerations
duration time_from_start
"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



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
# File 'lib/pr2_controllers_msgs/JointTrajectoryGoal.rb', line 88

def serialize(buff)
  begin
    buff.write(@@struct_L3.pack(@trajectory.header.seq, @trajectory.header.stamp.secs, @trajectory.header.stamp.nsecs))
    _x = @trajectory.header.frame_id
    length = _x.length
    buff.write([length, _x].pack("La#{length}"))
    length = @trajectory.joint_names.length
    buff.write(@@struct_L.pack(length))
    for val1 in @trajectory.joint_names
      length = val1.length
      buff.write([length, val1].pack("La#{length}"))
    end
    length = @trajectory.points.length
    buff.write(@@struct_L.pack(length))
    for val1 in @trajectory.points
      length = val1.positions.length
      buff.write(@@struct_L.pack(length))
      pattern = "d#{length}"
      buff.write(*val1.positions.pack(pattern))
      length = val1.velocities.length
      buff.write(@@struct_L.pack(length))
      pattern = "d#{length}"
      buff.write(*val1.velocities.pack(pattern))
      length = val1.accelerations.length
      buff.write(@@struct_L.pack(length))
      pattern = "d#{length}"
      buff.write(*val1.accelerations.pack(pattern))
      _v155 = val1.time_from_start
      _x = _v155
      buff.write(@@struct_l2.pack(_x.secs, _x.nsecs))
    end
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end