![]() |
embedded system library for e-puck
1.0.1
A redesigned API library for the e-puck robot platform
|
Go to the source code of this file.
Data Structures | |
struct | el_ir_proximity_param |
struct | el_ir_proximity_data |
Enumerations | |
enum | el_ir_proximity_mode { EL_IR_PROXIMITY_PASSIVE = 0, EL_IR_PROXIMITY_PULSE = 1, EL_IR_PROXIMITY_EMIT = 2, EL_IR_PROXIMITY_COMMUNICATION = 3 } |
enum | el_ir_proximity_output { EL_IR_AMBIENT, EL_IR_REFLECTION, EL_IR_DATA, EL_IR_ALL_3V } |
Functions | |
void | el_enable_ir_proximity (void) |
enable the proximity sensors module | |
void | el_disable_ir_proximity (void) |
disable the proximity sensors module | |
el_ir_proximity_param * | el_ir_proximity_options () |
get the pointer to a static instance of el_ir_proximity_param More... | |
void | el_ir_proximity_options_apply () |
apply the settings stored in el_ir_proximity_options directly More... | |
void | el_ir_proximity_options_reset () |
reset the settings stored in el_ir_proximity_options to default More... | |
void | el_config_ir_proximity (const el_ir_proximity_param *p) |
apply the settings in the given structure More... | |
int | el_ir_proximity_get (el_index i, el_ir_proximity_output u, el_int16 *out) |
get output value(s) from a accelerometer More... | |
el_uint32 | el_ir_proximity_get_counter () |
get total number of samples obtained since initialization More... | |
enum el_ir_proximity_mode |
This enum is used in el_ir_proximity_param to specify the working mode of the IR proximity sensors.
Explanation for each of the working mode can be found in the introduction section of Infrared Proximity Sensors.
This enum is used in el_ir_proximity_get to select the output type to get.
Explanation for each of output group can be found in the introduction section of Infrared Proximity Sensors.
Enumerator | |
---|---|
EL_IR_AMBIENT |
get the ambient output |
EL_IR_REFLECTION |
get the reflection output |
EL_IR_DATA |
get the data encoded (not implemented yet) |
EL_IR_ALL_3V |
get all of the three outputs |
el_ir_proximity_param* el_ir_proximity_options | ( | ) |
get the pointer to a static instance of el_ir_proximity_param
void el_ir_proximity_options_apply | ( | ) |
apply the settings stored in el_ir_proximity_options directly
This function is equivalent to "el_config_ir_proximity( el_ir_proximity_options() )".
void el_ir_proximity_options_reset | ( | ) |
reset the settings stored in el_ir_proximity_options to default
This function can be used in combination with el_ir_proximity_options_apply when the default configuration need to be used.
void el_config_ir_proximity | ( | const el_ir_proximity_param * | p | ) |
apply the settings in the given structure
p | pointer to the data structure |
The default setting of the ir proximity sensors can be represented by following code:
int el_ir_proximity_get | ( | el_index | i, |
el_ir_proximity_output | u, | ||
el_int16 * | out | ||
) |
get output value(s) from a accelerometer
i | index of the sensor |
u | output type (see el_ir_proximity_output) |
out | pointer to a variable or an array of variables to store the output value(s). |
See Component Index for the index of each of the proximity sensors.
The dimension the data pointed by "out" depends on the number of output values. For example, when one type of output of all eight proximity sensors need to be stored, "out" needs to point to an array of eight el_int16.
When all types of outputs of all eight proximity sensors need to be stored, An array of el_ir_proximity_data should be used because the output values will be interlaced. For example:
At present, the refreshing rate of the proximity sensors are 30 Hz, regardless of the working mode. Thus, a trigger with the event EL_EVENT_IR_PROXIMITY_UPDATE will be triggered 30 times per second.
el_uint32 el_ir_proximity_get_counter | ( | ) |
get total number of samples obtained since initialization
When enabled, sampling frequency of the ir proximity sensors are 30Hz.