Class: Pr2_controllers_msgs::JointTrajectoryAction
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Pr2_controllers_msgs::JointTrajectoryAction
- Defined in:
- lib/pr2_controllers_msgs/JointTrajectoryAction.rb
Constant Summary collapse
- @@struct_L3 =
::ROS::Struct.new("L3")
- @@struct_C =
::ROS::Struct.new("C")
- @@struct_L2 =
::ROS::Struct.new("L2")
- @@struct_l2 =
::ROS::Struct.new("l2")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['pr2_controllers_msgs/JointTrajectoryActionGoal','pr2_controllers_msgs/JointTrajectoryActionResult','pr2_controllers_msgs/JointTrajectoryActionFeedback']
Instance Attribute Summary collapse
-
#action_feedback ⇒ Object
Returns the value of attribute action_feedback.
-
#action_goal ⇒ Object
Returns the value of attribute action_goal.
-
#action_result ⇒ Object
Returns the value of attribute action_result.
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 = {}) ⇒ JointTrajectoryAction
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ JointTrajectoryAction
Constructor. You can set the default values using keyword operators.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 164 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:action_goal] @action_goal = args[:action_goal] else @action_goal = Pr2_controllers_msgs::JointTrajectoryActionGoal.new end if args[:action_result] @action_result = args[:action_result] else @action_result = Pr2_controllers_msgs::JointTrajectoryActionResult.new end if args[:action_feedback] @action_feedback = args[:action_feedback] else @action_feedback = Pr2_controllers_msgs::JointTrajectoryActionFeedback.new end end |
Instance Attribute Details
#action_feedback ⇒ Object
Returns the value of attribute action_feedback.
148 149 150 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 148 def action_feedback @action_feedback end |
#action_goal ⇒ Object
Returns the value of attribute action_goal.
148 149 150 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 148 def action_goal @action_goal end |
#action_result ⇒ Object
Returns the value of attribute action_result.
148 149 150 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 148 def action_result @action_result end |
Class Method Details
.md5sum ⇒ Object
21 22 23 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 21 def self.md5sum "368cde325f76ad543f39a85373230b73" end |
.type ⇒ Object
25 26 27 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 25 def self.type "pr2_controllers_msgs/JointTrajectoryAction" end |
Instance Method Details
#_get_types ⇒ String
internal API method
185 186 187 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 185 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
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 262 def deserialize(str) begin if @action_goal == nil @action_goal = Pr2_controllers_msgs::JointTrajectoryActionGoal.new end if @action_result == nil @action_result = Pr2_controllers_msgs::JointTrajectoryActionResult.new end if @action_feedback == nil @action_feedback = Pr2_controllers_msgs::JointTrajectoryActionFeedback.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L3') (@action_goal.header.seq, @action_goal.header.stamp.secs, @action_goal.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 @action_goal.header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('L2') (@action_goal.goal_id.stamp.secs, @action_goal.goal_id.stamp.nsecs,) = @@struct_L2.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 @action_goal.goal_id.id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('L3') (@action_goal.goal.trajectory.header.seq, @action_goal.goal.trajectory.header.stamp.secs, @action_goal.goal.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 @action_goal.goal.trajectory.header.frame_id = str[start..(end_point-1)] start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) @action_goal.goal.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)] @action_goal.goal.trajectory.joint_names.push(val1) end start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) @action_goal.goal.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) _v154 = val1.time_from_start _x = _v154 start = end_point end_point += ROS::Struct::calc_size('l2') (_x.secs, _x.nsecs,) = @@struct_l2.unpack(str[start..(end_point-1)]) @action_goal.goal.trajectory.points.push(val1) end start = end_point end_point += ROS::Struct::calc_size('L3') (@action_result.header.seq, @action_result.header.stamp.secs, @action_result.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 @action_result.header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('L2') (@action_result.status.goal_id.stamp.secs, @action_result.status.goal_id.stamp.nsecs,) = @@struct_L2.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 @action_result.status.goal_id.id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('C') (@action_result.status.status,) = @@struct_C.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 @action_result.status.text = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('L3') (@action_feedback.header.seq, @action_feedback.header.stamp.secs, @action_feedback.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 @action_feedback.header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('L2') (@action_feedback.status.goal_id.stamp.secs, @action_feedback.status.goal_id.stamp.nsecs,) = @@struct_L2.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 @action_feedback.status.goal_id.id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('C') (@action_feedback.status.status,) = @@struct_C.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 @action_feedback.status.text = str[start..(end_point-1)] return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
29 30 31 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 29 def has_header? false end |
#message_definition ⇒ Object
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 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 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 33 def "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== JointTrajectoryActionGoal action_goal JointTrajectoryActionResult action_result JointTrajectoryActionFeedback action_feedback ================================================================================ MSG: pr2_controllers_msgs/JointTrajectoryActionGoal # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== Header header actionlib_msgs/GoalID goal_id JointTrajectoryGoal goal ================================================================================ 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: actionlib_msgs/GoalID # The stamp should store the time at which this goal was requested. # It is used by an action server when it tries to preempt all # goals that were requested before a certain time time stamp # The id provides a way to associate feedback and # result message with specific goal requests. The id # specified must be unique. string id ================================================================================ MSG: pr2_controllers_msgs/JointTrajectoryGoal # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== trajectory_msgs/JointTrajectory trajectory ================================================================================ MSG: trajectory_msgs/JointTrajectory Header header string[] joint_names JointTrajectoryPoint[] points ================================================================================ MSG: trajectory_msgs/JointTrajectoryPoint float64[] positions float64[] velocities float64[] accelerations duration time_from_start ================================================================================ MSG: pr2_controllers_msgs/JointTrajectoryActionResult # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== Header header actionlib_msgs/GoalStatus status JointTrajectoryResult result ================================================================================ MSG: actionlib_msgs/GoalStatus GoalID goal_id uint8 status uint8 PENDING = 0 # The goal has yet to be processed by the action server uint8 ACTIVE = 1 # The goal is currently being processed by the action server uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing # and has since completed its execution (Terminal State) uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) uint8 ABORTED = 4 # The goal was aborted during execution by the action server due # to some failure (Terminal State) uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, # because the goal was unattainable or invalid (Terminal State) uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing # and has not yet completed execution uint8 RECALLING = 7 # The goal received a cancel request before it started executing, # but the action server has not yet confirmed that the goal is canceled uint8 RECALLED = 8 # The goal received a cancel request before it started executing # and was successfully cancelled (Terminal State) uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be # sent over the wire by an action server #Allow for the user to associate a string with GoalStatus for debugging string text ================================================================================ MSG: pr2_controllers_msgs/JointTrajectoryResult # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== ================================================================================ MSG: pr2_controllers_msgs/JointTrajectoryActionFeedback # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== Header header actionlib_msgs/GoalStatus status JointTrajectoryFeedback feedback ================================================================================ MSG: pr2_controllers_msgs/JointTrajectoryFeedback # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== " end |
#serialize(buff) ⇒ Object
serialize message into buffer
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/pr2_controllers_msgs/JointTrajectoryAction.rb', line 191 def serialize(buff) begin buff.write(@@struct_L3.pack(@action_goal.header.seq, @action_goal.header.stamp.secs, @action_goal.header.stamp.nsecs)) _x = @action_goal.header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_L2.pack(@action_goal.goal_id.stamp.secs, @action_goal.goal_id.stamp.nsecs)) _x = @action_goal.goal_id.id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_L3.pack(@action_goal.goal.trajectory.header.seq, @action_goal.goal.trajectory.header.stamp.secs, @action_goal.goal.trajectory.header.stamp.nsecs)) _x = @action_goal.goal.trajectory.header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) length = @action_goal.goal.trajectory.joint_names.length buff.write(@@struct_L.pack(length)) for val1 in @action_goal.goal.trajectory.joint_names length = val1.length buff.write([length, val1].pack("La#{length}")) end length = @action_goal.goal.trajectory.points.length buff.write(@@struct_L.pack(length)) for val1 in @action_goal.goal.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)) _v153 = val1.time_from_start _x = _v153 buff.write(@@struct_l2.pack(_x.secs, _x.nsecs)) end buff.write(@@struct_L3.pack(@action_result.header.seq, @action_result.header.stamp.secs, @action_result.header.stamp.nsecs)) _x = @action_result.header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_L2.pack(@action_result.status.goal_id.stamp.secs, @action_result.status.goal_id.stamp.nsecs)) _x = @action_result.status.goal_id.id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_C.pack(@action_result.status.status)) _x = @action_result.status.text length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_L3.pack(@action_feedback.header.seq, @action_feedback.header.stamp.secs, @action_feedback.header.stamp.nsecs)) _x = @action_feedback.header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_L2.pack(@action_feedback.status.goal_id.stamp.secs, @action_feedback.status.goal_id.stamp.nsecs)) _x = @action_feedback.status.goal_id.id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_C.pack(@action_feedback.status.status)) _x = @action_feedback.status.text length = _x.length buff.write([length, _x].pack("La#{length}")) rescue => exception raise "some erro in serialize: #{exception}" end end |