Class: Player::Sensor
- Inherits:
-
Object
- Object
- Player::Sensor
- Defined in:
- lib/ruby-player/sensor.rb
Instance Attribute Summary collapse
-
#geom ⇒ Object
readonly
Returns the value of attribute geom.
-
#state ⇒ Hash
readonly
State of sensor.
Instance Method Summary collapse
-
#initialize(index, ranger) ⇒ Sensor
constructor
A new instance of Sensor.
-
#intensity ⇒ Float
Intensity data [m].
-
#range ⇒ Float
Range data [m].
Constructor Details
#initialize(index, ranger) ⇒ Sensor
Returns a new instance of Sensor.
23 24 25 26 27 28 29 |
# File 'lib/ruby-player/sensor.rb', line 23 def initialize(index, ranger) @index, @ranger = index, ranger @state = { ranger: 0.0, intensity: 0.0 } @geom = {px: 0.0, py: 0.0, pz: 0.0, proll: 0.0, ppitch: 0.0, pyaw: 0.0, sw: 0.0, sl: 0.0, sh: 0.0 } end |
Instance Attribute Details
#geom ⇒ Object (readonly)
Returns the value of attribute geom.
21 22 23 |
# File 'lib/ruby-player/sensor.rb', line 21 def geom @geom end |
#state ⇒ Hash (readonly)
State of sensor
20 21 22 |
# File 'lib/ruby-player/sensor.rb', line 20 def state @state end |
Instance Method Details
#intensity ⇒ Float
Intensity data [m].
39 40 41 |
# File 'lib/ruby-player/sensor.rb', line 39 def intensity @state[:intensity] end |
#range ⇒ Float
Range data [m]
33 34 35 |
# File 'lib/ruby-player/sensor.rb', line 33 def range @state[:range] end |