Method: Visualization_msgs::InteractiveMarker#deserialize
- Defined in:
- lib/visualization_msgs/InteractiveMarker.rb
#deserialize(str) ⇒ Object
unpack serialized message in str into this message instance
@param [String] str: byte array of serialized message
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
# File 'lib/visualization_msgs/InteractiveMarker.rb', line 468 def deserialize(str) begin if @header == nil @header = Std_msgs::Header.new end if @pose == nil @pose = Geometry_msgs::Pose.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L3') (@header.seq, @header.stamp.secs, @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 @header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('d7') (@pose.position.x, @pose.position.y, @pose.position.z, @pose.orientation.x, @pose.orientation.y, @pose.orientation.z, @pose.orientation.w,) = @@struct_d7.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 @name = 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 @description = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('f') (@scale,) = @@struct_f.unpack(str[start..(end_point-1)]) start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) @menu_entries = [] length.times do val1 = Visualization_msgs::MenuEntry.new _x = val1 start = end_point end_point += ROS::Struct::calc_size('L2') (_x.id, _x.parent_id,) = @@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 val1.title = 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 val1.command = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('C') (val1.command_type,) = @@struct_C.unpack(str[start..(end_point-1)]) @menu_entries.push(val1) end start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) @controls = [] length.times do val1 = Visualization_msgs::InteractiveMarkerControl.new start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length val1.name = str[start..(end_point-1)] _v52 = val1.orientation _x = _v52 start = end_point end_point += ROS::Struct::calc_size('d4') (_x.x, _x.y, _x.z, _x.w,) = @@struct_d4.unpack(str[start..(end_point-1)]) _x = val1 start = end_point end_point += ROS::Struct::calc_size('C3') (_x.orientation_mode, _x.interaction_mode, _x.always_visible,) = @@struct_C3.unpack(str[start..(end_point-1)]) val1.always_visible = bool(val1.always_visible) start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) val1.markers = [] length.times do val2 = Visualization_msgs::Marker.new _v53 = val2.header start = end_point end_point += ROS::Struct::calc_size('L') (_v53.seq,) = @@struct_L.unpack(str[start..(end_point-1)]) _v54 = _v53.stamp _x = _v54 start = end_point end_point += ROS::Struct::calc_size('L2') (_x.secs, _x.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 _v53.frame_id = 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 val2.ns = str[start..(end_point-1)] _x = val2 start = end_point end_point += ROS::Struct::calc_size('l3') (_x.id, _x.type, _x.action,) = @@struct_l3.unpack(str[start..(end_point-1)]) _v55 = val2.pose _v56 = _v55.position _x = _v56 start = end_point end_point += ROS::Struct::calc_size('d3') (_x.x, _x.y, _x.z,) = @@struct_d3.unpack(str[start..(end_point-1)]) _v57 = _v55.orientation _x = _v57 start = end_point end_point += ROS::Struct::calc_size('d4') (_x.x, _x.y, _x.z, _x.w,) = @@struct_d4.unpack(str[start..(end_point-1)]) _v58 = val2.scale _x = _v58 start = end_point end_point += ROS::Struct::calc_size('d3') (_x.x, _x.y, _x.z,) = @@struct_d3.unpack(str[start..(end_point-1)]) _v59 = val2.color _x = _v59 start = end_point end_point += ROS::Struct::calc_size('f4') (_x.r, _x.g, _x.b, _x.a,) = @@struct_f4.unpack(str[start..(end_point-1)]) _v60 = val2.lifetime _x = _v60 start = end_point end_point += ROS::Struct::calc_size('l2') (_x.secs, _x.nsecs,) = @@struct_l2.unpack(str[start..(end_point-1)]) start = end_point end_point += ROS::Struct::calc_size('C') (val2.frame_locked,) = @@struct_C.unpack(str[start..(end_point-1)]) val2.frame_locked = bool(val2.frame_locked) start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) val2.points = [] length.times do val3 = Geometry_msgs::Point.new _x = val3 start = end_point end_point += ROS::Struct::calc_size('d3') (_x.x, _x.y, _x.z,) = @@struct_d3.unpack(str[start..(end_point-1)]) val2.points.push(val3) end start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) val2.colors = [] length.times do val3 = Std_msgs::ColorRGBA.new _x = val3 start = end_point end_point += ROS::Struct::calc_size('f4') (_x.r, _x.g, _x.b, _x.a,) = @@struct_f4.unpack(str[start..(end_point-1)]) val2.colors.push(val3) end start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length val2.text = 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 val2.mesh_resource = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('C') (val2.,) = @@struct_C.unpack(str[start..(end_point-1)]) val2. = bool(val2.) val1.markers.push(val2) end start = end_point end_point += ROS::Struct::calc_size('C') (val1.independent_marker_orientation,) = @@struct_C.unpack(str[start..(end_point-1)]) val1.independent_marker_orientation = bool(val1.independent_marker_orientation) start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length val1.description = str[start..(end_point-1)] @controls.push(val1) end return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |