Module: Freenect::Driver
Defined Under Namespace
Classes: FreenectFormat, FreenectFrameMode, FreenectRawTiltState
Constant Summary collapse
- FREENECT_COUNTS_PER_G =
Ticks per G for accelerometer as set per www.kionix.com/Product%20Sheets/KXSD9%20Product%20Brief.pdf
819
- FREENECT_DEVICE_FLAGS =
Flags representing devices to open when freenect_open_device() is called. In particular, this allows libfreenect to grab only a subset of the devices in the Kinect, so you could (for instance) use libfreenect to handle audio and motor support while letting OpenNI have access to the cameras. If a device is not supported on a particular platform, its flag will be ignored.
enum( :freenect_device_motor, 0x01, :freenect_device_camaers, 0x02, :freenect_device_audio, 0x04 )
- FREENECT_RESOLUTION =
Enumeration of available resolutions. Not all available resolutions are actually supported for all video formats. Frame modes may not perfectly match resolutions. For instance, FREENECT_RESOLUTION_MEDIUM is 640x488 for the IR camera.
enum( :freenect_resolution_low, 0, # QVGA - 320x240 :freenect_resolution_medium, 1, # VGA - 640x480 :freenect_resolution_high, 2, # SXGA - 1280x1024 :freenect_resolution_dummy, 2147483647 # Dummy value to force enum to be 32 bits wide )
- FREENECT_VIDEO_FORMAT =
Enumeration of video frame information states. See openkinect.org/wiki/Protocol_Documentation#RGB_Camera for more information.
enum( :freenect_video_rgb, 0, # Decompressed RGB mode (demosaicing done by libfreenect) :freenect_video_bayer, 1, # Bayer compressed mode (raw information from camera) :freenect_video_ir_8bit, 2, # 8-bit IR mode :freenect_video_ir_10bit, 3, # 10-bit IR mode :freenect_video_ir_10bit_packed, 4, # 10-bit packed IR mode :freenect_video_yuv_rgb, 5, # YUV RGB mode :freenect_video_yuv_raw, 6, # YUV Raw mode :freenect_video_dummy, 2147483647 # Dummy value to force enum to be 32 bits wide )
- FREENECT_DEPTH_FORMAT =
Enumeration of depth frame states See openkinect.org/wiki/Protocol_Documentation#RGB_Camera for more information.
enum( :freenect_depth_11bit, 0, # 11 bit depth information in one uint16_t/pixel :freenect_depth_10bit, 1, # 10 bit depth information in one uint16_t/pixel :freenect_depth_11bit_packed, 2, # 11 bit packed depth information :freenect_depth_10bit_packed, 3, # 10 bit packed depth information :freenet_depth_dummy, 2147483647 # Dummy value to force enum to be 32 bits wide )
- FREENECT_LED_OPTIONS =
Enumeration of LED states See openkinect.org/wiki/Protocol_Documentation#Setting_LED for more information.
enum( :led_off, 0, # Turn LED off :led_green, 1, # Turn LED to Green :led_red, 2, # Turn LED to Red :led_yellow, 3, # Turn LED to Yellow :led_blink_green, 4, # Make LED blink Green :led_blink_red_yellow, 6 # Make LED blink Red/Yellow )
- FREENECT_TILT_STATUS_CODE =
Enumeration of tilt motor status
enum( :tilt_status_stopped, 0x00, # Tilt motor is stopped :tilt_status_limit, 0x01, # Tilt motor has reached movement limit :tilt_status_moving, 0x04 # Tilrequire 'ffi't motor is currently moving to new position )
- FREENECT_LOGLEVEL =
Enumeration of message logging levels
enum( :freenect_log_fatal, 0, # Log for crashing/non-recoverable errors :freenect_log_error, 1, # Log for major errors :freenect_log_warning, 2, # Log for warning messages :freenect_log_notice, 3, # Log for important messages :freenect_log_info, 3, # Log for normal messages :freenect_log_debug, 5, # Log for useful development messages :freenect_log_spew, 6, # Log for slightly less useful messages :freenect_log_flood, 7 # Log EVERYTHING. May slow performance. )
Instance Method Summary collapse
-
#freenect_find_depth_mode ⇒ Object
Convenience function to return a mode descriptor matching the specified resolution and depth camera pixel format, if one exists.
-
#freenect_find_video_mode ⇒ Object
Convenience function to return a mode descriptor matching the specified resolution and video camera pixel format, if one exists.
-
#freenect_get_current_depth_mode ⇒ Object
Get the frame descriptor of the current depth mode for the specified freenect device.
-
#freenect_get_current_video_mode ⇒ Object
Get the frame descriptor of the current video mode for the specified freenect device.
-
#freenect_get_depth_mode ⇒ Object
Get the frame descriptor of the nth supported depth mode for the depth camera.
-
#freenect_get_depth_mode_count ⇒ Object
Get the number of depth camera modes supported by the driver.
-
#freenect_get_tilt_degs ⇒ Object
Return the tilt state, in degrees with respect to the horizon.
-
#freenect_get_tilt_state ⇒ Object
Retrieve the tilt state from a device.
-
#freenect_get_tilt_status ⇒ Object
Return the movement state of the tilt motor (moving, stopped, etc…).
-
#freenect_get_user ⇒ Object
Retrieve the pointer to user data from the device struct.
-
#freenect_get_video_mode ⇒ Object
Get the frame descriptor of the nth supported video mode for the video camera.
-
#freenect_get_video_mode_count ⇒ Object
Get the number of video camera modes supported by the driver.
-
#freenect_init ⇒ Object
Initialize a freenect context and do any setup required for platform specific USB libraries.
-
#freenect_num_devices ⇒ Object
Return the number of kinect devices currently connected to the system.
-
#freenect_open_device ⇒ Object
Opens a kinect device via a context.
-
#freenect_process_events ⇒ Object
Calls the platform specific usb event processor.
-
#freenect_set_depth_mode ⇒ Object
Sets the current depth mode for the specified device.
-
#freenect_set_led ⇒ Object
Set the state of the LED.
-
#freenect_set_tilt_degs ⇒ Object
Set the tilt state of the device, in degrees with respect to the horizon.
-
#freenect_set_video_buffer ⇒ Object
Set the buffer to store depth information to.
-
#freenect_set_video_mode ⇒ Object
Sets the current video mode for the specified device.
-
#freenect_shutdown ⇒ Object
Closes the device if it is open, and frees the context.
-
#freenect_start_depth ⇒ Object
Start the depth information stream for a device.
-
#freenect_start_video ⇒ Object
Start the video information stream for a device.
-
#freenect_stop_depth ⇒ Object
Stop the depth information stream for a device.
-
#freenect_stop_video ⇒ Object
Stop the video information stream for a device.
-
#freenect_update_tilt_state ⇒ Object
Updates the accelerometer state using a blocking control message call.
Instance Method Details
#freenect_find_depth_mode ⇒ Object
Convenience function to return a mode descriptor matching the specified resolution and depth camera pixel format, if one exists.
409 |
# File 'lib/freenect/driver.rb', line 409 attach_function :freenect_find_depth_mode, [FREENECT_RESOLUTION, FREENECT_DEPTH_FORMAT], FreenectFrameMode.by_value |
#freenect_find_video_mode ⇒ Object
Convenience function to return a mode descriptor matching the specified resolution and video camera pixel format, if one exists.
400 |
# File 'lib/freenect/driver.rb', line 400 attach_function :freenect_find_video_mode, [FREENECT_RESOLUTION, FREENECT_VIDEO_FORMAT], FreenectFrameMode.by_value |
#freenect_get_current_depth_mode ⇒ Object
Get the frame descriptor of the current depth mode for the specified freenect device.
333 |
# File 'lib/freenect/driver.rb', line 333 attach_function :freenect_get_current_depth_mode, [:freenect_device], FreenectFrameMode.by_value |
#freenect_get_current_video_mode ⇒ Object
Get the frame descriptor of the current video mode for the specified freenect device.
325 |
# File 'lib/freenect/driver.rb', line 325 attach_function :freenect_get_current_video_mode, [:freenect_device], FreenectFrameMode.by_value |
#freenect_get_depth_mode ⇒ Object
Get the frame descriptor of the nth supported depth mode for the depth camera.
391 |
# File 'lib/freenect/driver.rb', line 391 attach_function :freenect_get_depth_mode, [:int], FreenectFrameMode.by_value |
#freenect_get_depth_mode_count ⇒ Object
Get the number of depth camera modes supported by the driver. This includes both RGB and IR modes.
383 |
# File 'lib/freenect/driver.rb', line 383 attach_function :freenect_get_depth_mode_count, [], :int |
#freenect_get_tilt_degs ⇒ Object
Return the tilt state, in degrees with respect to the horizon
288 |
# File 'lib/freenect/driver.rb', line 288 attach_function :freenect_get_tilt_degs, [FreenectRawTiltState], :double |
#freenect_get_tilt_state ⇒ Object
Retrieve the tilt state from a device
281 |
# File 'lib/freenect/driver.rb', line 281 attach_function :freenect_get_tilt_state, [:freenect_device], FreenectRawTiltState |
#freenect_get_tilt_status ⇒ Object
Return the movement state of the tilt motor (moving, stopped, etc…)
freenect_tilt_st:freenect_get_tilt_statusatus_code enum for more info.
308 |
# File 'lib/freenect/driver.rb', line 308 attach_function :freenect_get_tilt_status, [FreenectRawTiltState], FREENECT_TILT_STATUS_CODE |
#freenect_get_user ⇒ Object
Retrieve the pointer to user data from the device struct
205 |
# File 'lib/freenect/driver.rb', line 205 attach_function :freenect_get_user, [:freenect_device], :pointer |
#freenect_get_video_mode ⇒ Object
Get the frame descriptor of the nth supported video mode for the video camera.
378 |
# File 'lib/freenect/driver.rb', line 378 attach_function :freenect_get_video_mode, [:int], FreenectFrameMode.by_value |
#freenect_get_video_mode_count ⇒ Object
Get the number of video camera modes supported by the driver. This includes both RGB and IR modes.
370 |
# File 'lib/freenect/driver.rb', line 370 attach_function :freenect_get_video_mode_count, [], :int |
#freenect_init ⇒ Object
Initialize a freenect context and do any setup required for platform specific USB libraries.
128 |
# File 'lib/freenect/driver.rb', line 128 attach_function :freenect_init, [:freenect_context, :freenect_usb_context], :int |
#freenect_num_devices ⇒ Object
Return the number of kinect devices currently connected to the system
164 |
# File 'lib/freenect/driver.rb', line 164 attach_function :freenect_num_devices, [:freenect_context], :int |
#freenect_open_device ⇒ Object
Opens a kinect device via a context. Index specifies the index of the device on the current state of the bus. Bus resets may cause indexes to shift.
185 |
# File 'lib/freenect/driver.rb', line 185 attach_function :freenect_open_device, [:freenect_context, :freenect_device, :int], :int |
#freenect_process_events ⇒ Object
Calls the platform specific usb event processor
156 |
# File 'lib/freenect/driver.rb', line 156 attach_function :freenect_process_events, [:freenect_context], :int |
#freenect_set_depth_mode ⇒ Object
Sets the current depth mode for the specified device. The mode cannot be changed while streaming is active.
354 |
# File 'lib/freenect/driver.rb', line 354 attach_function :freenect_set_depth_mode, [:freenect_device, FreenectFrameMode.by_value], :int |
#freenect_set_led ⇒ Object
Set the state of the LED. Uses blocking control message call to update device.
317 |
# File 'lib/freenect/driver.rb', line 317 attach_function :freenect_set_led, [:freenect_device, FREENECT_LED_OPTIONS], :int |
#freenect_set_tilt_degs ⇒ Object
Set the tilt state of the device, in degrees with respect to the horizon. Uses blocking control message call to update device. Function return does not reflect state of device, device may still be moving to new position after the function returns. Use freenect_get_tilt_status() to find current movement state.
300 |
# File 'lib/freenect/driver.rb', line 300 attach_function :freenect_set_tilt_degs, [:freenect_device, :double], :int |
#freenect_set_video_buffer ⇒ Object
Set the buffer to store depth information to. Size of buffer is dependant on video format. See FREENECT_VIDEO_*_SIZE defines for more information.
237 |
# File 'lib/freenect/driver.rb', line 237 attach_function :freenect_set_video_buffer, [:freenect_device, :pointer], :int |
#freenect_set_video_mode ⇒ Object
Sets the current video mode for the specified device. If the freenect_frame_mode specified is not one provided by the driver e.g. from freenect_get_video_mode() or freenect_find_video_mode() then behavior is undefined. The current video mode cannot be changed while streaming is active.
345 |
# File 'lib/freenect/driver.rb', line 345 attach_function :freenect_set_video_mode, [:freenect_device, FreenectFrameMode.by_value], :int |
#freenect_shutdown ⇒ Object
Closes the device if it is open, and frees the context
135 |
# File 'lib/freenect/driver.rb', line 135 attach_function :freenect_shutdown, [:freenect_context], :int |
#freenect_start_depth ⇒ Object
Start the depth information stream for a device.
244 |
# File 'lib/freenect/driver.rb', line 244 attach_function :freenect_start_depth, [:freenect_device], :int |
#freenect_start_video ⇒ Object
Start the video information stream for a device.
251 |
# File 'lib/freenect/driver.rb', line 251 attach_function :freenect_start_video, [:freenect_device], :int |
#freenect_stop_depth ⇒ Object
Stop the depth information stream for a device
258 |
# File 'lib/freenect/driver.rb', line 258 attach_function :freenect_stop_depth, [:freenect_device], :int |
#freenect_stop_video ⇒ Object
Stop the video information stream for a device
265 |
# File 'lib/freenect/driver.rb', line 265 attach_function :freenect_stop_video, [:freenect_device], :int |
#freenect_update_tilt_state ⇒ Object
Updates the accelerometer state using a blocking control message call.
device struct.
274 |
# File 'lib/freenect/driver.rb', line 274 attach_function :freenect_update_tilt_state, [:freenect_device], :int |