libkovan  1
The kovan standard library
Depth Sensor

Functions

VF EXPORT_SYM int depth_open ()
 
VF EXPORT_SYM int depth_close ()
 
VF EXPORT_SYM DepthResolution get_depth_resolution ()
 
VF EXPORT_SYM int set_depth_resolution (DepthResolution resolution)
 
VF EXPORT_SYM int set_depth_orientation (int orientation)
 
VF EXPORT_SYM int get_depth_orientation ()
 
VF EXPORT_SYM int depth_update ()
 
VF EXPORT_SYM int get_depth_image_height ()
 
VF EXPORT_SYM int get_depth_image_width ()
 
VF EXPORT_SYM int get_depth_value (int row, int column)
 
VF EXPORT_SYM point3 get_depth_world_point (int row, int column)
 
VF EXPORT_SYM int get_depth_world_point_x (int row, int column)
 
VF EXPORT_SYM int get_depth_world_point_y (int row, int column)
 
VF EXPORT_SYM int get_depth_world_point_z (int row, int column)
 
VF EXPORT_SYM int depth_scanline_update (int row)
 
VF EXPORT_SYM int get_depth_scanline_object_count ()
 
VF EXPORT_SYM point3 get_depth_scanline_object_center (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_center_x (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_center_y (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_center_z (int object_num)
 
VF EXPORT_SYM point3 get_depth_scanline_object_nearest (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_nearest_x (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_nearest_y (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_nearest_z (int object_num)
 
VF EXPORT_SYM point3 get_depth_scanline_object_farthest (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_farthest_x (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_farthest_y (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_farthest_z (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_size (int object_num)
 
VF EXPORT_SYM int get_depth_scanline_object_angle (int object_num)
 

Detailed Description

Function Documentation

VF EXPORT_SYM int depth_close ( )

Closes the depth sensor

Returns
1 on success, 0 otherwise
VF EXPORT_SYM int depth_open ( )

Opens the depth sensor. This is the first function which has to be called before any other function!

Returns
1 on success, 0 otherwise
VF EXPORT_SYM int depth_scanline_update ( int  row)

Selects a row for further processing by get_depth_scanline functions.

Returns
1 on success, 0 otherwise
Note
the row/column index starts with 0
Calls the depth_update() will invalidate the scanline selection.
VF EXPORT_SYM int depth_update ( )

Pulls a new depth image from the depth sensor for future processing.

Returns
1 on success, 0 otherwise
VF EXPORT_SYM int get_depth_image_height ( )

Returns the height of the depth image stored by depth_update in pixel

Returns
Height of the depth image in pixel or 0 if no depth image was saved
See also
depth_update
VF EXPORT_SYM int get_depth_image_width ( )

Returns the width of the depth image stored by depth_update in pixel

Returns
Width of the depth image in pixel or 0 if no depth image was saved
See also
depth_update
VF EXPORT_SYM int get_depth_orientation ( )

Gets the depth image orientation

Returns
Depth image orientation or 0xFFFF in case of an error
VF EXPORT_SYM DepthResolution get_depth_resolution ( )

Get the current depth image resolution

Returns
The current depth image resolution
See also
set_depth_resolution
depth_update
VF EXPORT_SYM int get_depth_scanline_object_angle ( int  object_num)

Retrieve the given object's angle in degrees.

Returns
The object's angle from the camera, or -1 on error.
Note
An object angle of 0 degrees is parallel to the camera.
VF EXPORT_SYM point3 get_depth_scanline_object_center ( int  object_num)

Retrieve the given object's center x offset from the camera.

Returns
The offset from the center of the Xtion sensor, or (-1, -1, -1) on error.
VF EXPORT_SYM int get_depth_scanline_object_center_x ( int  object_num)

Retrieve the given object's center x offset from the camera.

Returns
The x offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_center_y ( int  object_num)

Retrieve the given object's center y offset from the camera.

Returns
The object's center y offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_center_z ( int  object_num)

Retrieve the given object's center z offset from the camera.

Returns
The object's center z offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_count ( )

Retrieve the number of objects detected on the selected scanline.

Returns
The number of objects detected, or -1 on error
VF EXPORT_SYM point3 get_depth_scanline_object_farthest ( int  object_num)

Retrieve the given object's farthest x offset from the camera.

Returns
The object's farthest x offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_farthest_x ( int  object_num)

Retrieve the given object's farthest x offset from the camera.

Returns
The object's farthest x offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_farthest_y ( int  object_num)

Retrieve the given object's farthest y offset from the camera.

Returns
The object's farthest y offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_farthest_z ( int  object_num)

Retrieve the given object's farthest z offset from the camera.

Returns
The object's farthest z offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM point3 get_depth_scanline_object_nearest ( int  object_num)

Retrieve the given object's nearest offset from the camera.

Returns
The object's nearest offset from the center of the Xtion sensor, or (-1, -1, -1) on error.
VF EXPORT_SYM int get_depth_scanline_object_nearest_x ( int  object_num)

Retrieve the given object's nearest x offset from the camera.

Returns
The object's nearest x offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_nearest_y ( int  object_num)

Retrieve the given object's nearest y offset from the camera.

Returns
The object's nearest y offset from the center of the Xtion sensor, or -1 on error.
VF EXPORT_SYM int get_depth_scanline_object_nearest_z ( int  object_num)

Retrieve the given object's nearest offset from the camera.

Returns
The object's nearest offset from the center of the Xtion sensor, or (-1, -1, -1) on error.
VF EXPORT_SYM int get_depth_scanline_object_size ( int  object_num)

Retrieve the given object's size in mm.

Returns
The object's size in mm, or -1 on error.
VF EXPORT_SYM int get_depth_value ( int  row,
int  column 
)

Returns the depth value of a depth pixel.

Parameters
rowRow index of the depth pixel
columnColumn index of the depth pixel
Returns
The depth value in millimeters or INVALID_COORDINATE if no depth image was saved or if the depth value is not visible by the depth sensor
Note
the row/column index starts with 0
See also
depth_image_get_height
depth_image_get_width
VF EXPORT_SYM point3 get_depth_world_point ( int  row,
int  column 
)

Returns the world coordinates of the specified point.

Parameters
rowRow index of the depth pixel
columnColumn index of the depth pixel
Returns
The world coordinates in millimeters or (-1, -1, -1) if no depth image was saved or if the depth value is not visible by the depth sensor
Note
the row/column index starts with 0
VF EXPORT_SYM int get_depth_world_point_x ( int  row,
int  column 
)

Returns the x world coordinate of the specified point.

Parameters
rowRow index of the depth pixel
columnColumn index of the depth pixel
Returns
The x world coordinate in millimeters or -1 if no depth image was saved or if the depth value is not visible by the depth sensor
Note
the row/column index starts with 0
VF EXPORT_SYM int get_depth_world_point_y ( int  row,
int  column 
)

Returns the y world coordinate of the specified point.

Parameters
rowRow index of the depth pixel
columnColumn index of the depth pixel
Returns
The y world coordinate in millimeters or -1 if no depth image was saved or if the depth value is not visible by the depth sensor
Note
the row/column index starts with 0
VF EXPORT_SYM int get_depth_world_point_z ( int  row,
int  column 
)

Returns the z world coordinate of the specified point.

Parameters
rowRow index of the depth pixel
columnColumn index of the depth pixel
Returns
The z world coordinate in millimeters or -1 if no depth image was saved or if the depth value is not visible by the depth sensor
Note
the row/column index starts with 0
VF EXPORT_SYM int set_depth_orientation ( int  orientation)

Sets the depth image orientation

Parameters
orientationDepth image orientation
Returns
1 on success, 0 otherwise
Note
Only 0 and 180 degree are supported yet
VF EXPORT_SYM int set_depth_resolution ( DepthResolution  resolution)

Set the current depth image resolution.

Parameters
resolutionNew depth image resolution
Returns
1 on success, 0 otherwise
See also
get_depth_resolution
depth_update