Class: Phidgets::Spatial::SpatialGyroAxes
- Inherits:
-
Object
- Object
- Phidgets::Spatial::SpatialGyroAxes
- Defined in:
- lib/phidgets-ffi/spatial.rb
Overview
This class represents an axis of gyroscope for a PhidgetSpatial. All the properties of an gyroscope axis are stored and modified in this class.
Constant Summary collapse
- Klass =
Phidgets::FFI::CPhidgetSpatial
Instance Method Summary collapse
-
#angular_rate ⇒ Float
Returns the angular rate of rotation for the gyro axis, in degress per second, or raises an error.
-
#angular_rate_max ⇒ Float
Returns the maximum supported angular rate for the gyro axis, or raises an error.
-
#angular_rate_min ⇒ Float
Returns the minimum supported angular rate for the gyro axis, or raises an error.
-
#index ⇒ Integer
Returns index of the gyroscope axis, or raises an error.
-
#inspect ⇒ Object
Displays data for the gyroscope axis.
Instance Method Details
#angular_rate ⇒ Float
Returns the angular rate of rotation for the gyro axis, in degress per second, or raises an error.
278 279 280 281 282 |
# File 'lib/phidgets-ffi/spatial.rb', line 278 def angular_rate ptr = ::FFI::MemoryPointer.new(:double) Klass.getAngularRate(@handle, @index, ptr) ptr.get_double(0) end |
#angular_rate_max ⇒ Float
Returns the maximum supported angular rate for the gyro axis, or raises an error.
285 286 287 288 289 |
# File 'lib/phidgets-ffi/spatial.rb', line 285 def angular_rate_max ptr = ::FFI::MemoryPointer.new(:double) Klass.getAngularRateMax(@handle, @index, ptr) ptr.get_double(0) end |
#angular_rate_min ⇒ Float
Returns the minimum supported angular rate for the gyro axis, or raises an error.
292 293 294 295 296 |
# File 'lib/phidgets-ffi/spatial.rb', line 292 def angular_rate_min ptr = ::FFI::MemoryPointer.new(:double) Klass.getAngularRateMin(@handle, @index, ptr) ptr.get_double(0) end |
#index ⇒ Integer
Returns index of the gyroscope axis, or raises an error.
273 274 275 |
# File 'lib/phidgets-ffi/spatial.rb', line 273 def index @index end |
#inspect ⇒ Object
Displays data for the gyroscope axis
268 269 270 |
# File 'lib/phidgets-ffi/spatial.rb', line 268 def inspect "#<#{self.class} @angular_rate=#{angular_rate}, @angular_rate_max=#{angular_rate_max}, @angular_rate_min=#{angular_rate_min}" end |