Class: Rclrb::Clock

Inherits:
Object
  • Object
show all
Defined in:
lib/rclrb/clock.rb

Overview

Represent a clock, instead of creating directly, use RosClock or SystemClock

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Clock

Returns a new instance of Clock.



6
7
8
9
# File 'lib/rclrb/clock.rb', line 6

def initialize(type)
  @handle = CApi::RclClockT.new
  CApi.handle_result(CApi.rcl_clock_init(type, @handle, CApi.rcutils_get_default_allocator()))
end

Instance Attribute Details

#handleObject (readonly)

Returns the value of attribute handle.



5
6
7
# File 'lib/rclrb/clock.rb', line 5

def handle
  @handle
end