Class: Tf::FrameGraphResponse

Inherits:
ROS::Message
  • Object
show all
Defined in:
lib/tf/FrameGraph.rb

Constant Summary collapse

@@struct_L =
::ROS::Struct.new("L")
@@slot_types =
['string']

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ FrameGraphResponse

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

Parameters:

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

    keyword for initializing values

Options Hash (args):

  • :dot_graph (string)

    initialize value



101
102
103
104
105
106
107
108
# File 'lib/tf/FrameGraph.rb', line 101

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

Instance Attribute Details

#dot_graphObject

Returns the value of attribute dot_graph.



91
92
93
# File 'lib/tf/FrameGraph.rb', line 91

def dot_graph
  @dot_graph
end

Class Method Details

.md5sumObject



73
74
75
# File 'lib/tf/FrameGraph.rb', line 73

def self.md5sum
  "c4af9ac907e58e906eb0b6e3c58478c0"
end

.typeObject



77
78
79
# File 'lib/tf/FrameGraph.rb', line 77

def self.type
  "tf/FrameGraphResponse"
end

Instance Method Details

#_get_typesString

internal API method

Returns:

  • (String)

    Message type string.



112
113
114
# File 'lib/tf/FrameGraph.rb', line 112

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


131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/tf/FrameGraph.rb', line 131

def deserialize(str)

  begin
    end_point = 0
    start = end_point
    end_point += 4
    (length,) = @@struct_L.unpack(str[start..(end_point-1)])
    start = end_point
    end_point += length
    @dot_graph = str[start..(end_point-1)]
    return self
  rescue => exception
    raise "message DeserializationError: #{exception}" #most likely buffer underfill
  end
end

#has_header?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/tf/FrameGraph.rb', line 81

def has_header?
  false
end

#message_definitionObject



85
86
87
88
89
90
# File 'lib/tf/FrameGraph.rb', line 85

def message_definition
  "string dot_graph


"
end

#serialize(buff) ⇒ Object

serialize message into buffer

Parameters:

  • buff (IO)

    buffer



118
119
120
121
122
123
124
125
126
127
# File 'lib/tf/FrameGraph.rb', line 118

def serialize(buff)
  begin
    _x = @dot_graph
    length = _x.length
    buff.write([length, _x].pack("La#{length}"))
  rescue => exception
    raise "some erro in serialize: #{exception}"

  end
end