|
Sentis-ToF-M100 API
1.0.0
API_for_using_the_Bluetechnix_Sentis_ToF_M100_camera
|
#include <GL/glut.h>#include <GL/gl.h>#include <GL/glu.h>#include <stdlib.h>#include <m100api.h>#include <stdio.h>#include <stdarg.h>#include <math.h>#include <iostream>
Macros | |
| #define | TICKS_PER_SECOND 20 |
| #define | LEN 8192 |
| #define | VSNPRINTF vsnprintf |
Functions | |
| int | initCamera (T_SENTIS_HANDLE *handle) |
| Helper method that starts the connection with the camera and set default image_data format. More... | |
| int | getFrame (T_SENTIS_HANDLE handle) |
| Get a fame from the camera and save it in the global buffer variable. More... | |
| int | stopCamera (T_SENTIS_HANDLE handle) |
| Close the connections with the camera and set free data structures. More... | |
| void | init () |
| Called before main loop to set up the program. | |
| void | reshape (int w, int h) |
| Called every time a window is resized to resize the projection matrix. | |
| void | camera (void) |
| void | printv (va_list args, const char *format) |
| Print axis names. | |
| void | print (const char *format,...) |
| Loop for print axis names. | |
| void | drawAxes () |
| draw axes at defined position More... | |
| void | display (int value) |
| Called at the start of the program, after a glutPostRedisplay() and during idle to display a frame. | |
| void | firstDisplay () |
| Called at the start of the program. | |
| void | mouseMovement (int x, int y) |
| Called after mouse click. It calculates the movement of the mouse and redisplay the scene. | |
| void | mouse (int button, int state, int x, int y) |
| Callback for mouse clicks. | |
| void | keyboard (unsigned char key, int x, int y) |
| Callback for normal key pressed. | |
| void | windowSpecial (int key, int x, int y) |
| Callback for arrow keys. | |
| int | main (int argc, char **argv) |
Variables | |
| const int | TIMER_MILLISECONDS = 100 / TICKS_PER_SECOND |
| float | xpos = 0 |
| float | ypos = 0 |
| float | zpos = 0 |
| float | xrot = 0 |
| float | yrot = 0 |
| float | angle =0.0 |
| float | lastx |
| float | lasty |
| double | dim =300.0 |
| int | windowWidth =512 |
| int | windowHeight =512 |
| int | moving = 0 |
| int | toggleAxes = 1 |
| T_SENTIS_HANDLE | handler |
| T_ERROR_CODE | error |
| #define TICKS_PER_SECOND 20 |
Example application for the sentis-ToF-m100 camera API
This application shows an OpenGl view which displays 3D images based in distance values. It uses the distances + amplitudes data format. The view displays a grid of 160cmX120cm and the X axis shows the depth ~300cm.
The amplitude values are used to set the color (gray) intensity of the image.
| void drawAxes | ( | ) |
draw axes at defined position
We have a grid of 160cm*120cm. The depth of the X axis is set to 250cm
| int getFrame | ( | T_SENTIS_HANDLE | handle | ) |
Get a fame from the camera and save it in the global buffer variable.
| [in] | T_SENTIS_HANDLE | Camera handler. |
| int initCamera | ( | T_SENTIS_HANDLE * | handle | ) |
Helper method that starts the connection with the camera and set default image_data format.
| [in,out] | T_SENTIS_HANDLE | * Camera handler. |
| int stopCamera | ( | T_SENTIS_HANDLE | handle | ) |
Close the connections with the camera and set free data structures.
| [in] | T_SENTIS_HANDLE | Camera handler. |
1.8.3.1