SWARM-Bot Firmware
v1.0
Mobile robot OS - Embedded C/C++
|
Header file for odometry.c. More...
#include "__swarm_wold__.h"
Go to the source code of this file.
Macros | |
#define | __ENC_TICK_THETA_FOR_OMEGA 190399 |
Threshold value for encoder ticks used to calculate angular velocity. More... | |
#define | __ENC_TICK_THETA 0.1904 |
Conversion factor from encoder ticks to radians. More... | |
#define | __PM_lower_bound 200 |
Lower bound for potentiometer readings. More... | |
#define | __PM_upper_bound 800 |
Upper bound for potentiometer readings. More... | |
#define | __PM_SAMPLE_COUNT 5 |
Number of samples taken for potentiometer readings. More... | |
#define | __PM_SLOPE 1 |
Slope for potentiometer readings, in radians per volt per overflow. More... | |
#define | FORWARD 1 |
Constant used to indicate forward motion. More... | |
#define | BACKWARD -1 |
Constant used to indicate backward motion. More... | |
Functions | |
float | _theta_A (void) |
Returns the absolute rotation angle of motor A. More... | |
float | _theta_B (void) |
Returns the absolute rotation angle of motor B. More... | |
float | _omega_from_enc_A (void) |
Returns the angular velocity of motor A based on encoder readings. More... | |
float | _omega_from_enc_B (void) |
Returns the angular velocity of motor B based on encoder readings. More... | |
float | _omega_from_PM_A (void) |
Returns the angular velocity of motor A based on potentiometer readings. More... | |
float | _omega_from_PM_B (void) |
Returns the angular velocity of motor B based on potentiometer readings. More... | |
float | _omega_comp_A (void) |
Returns the complementary filter for the angular velocity of motor A. More... | |
float | omega_comp_B (void) |
Returns the complementary filter for the angular velocity of motor B. More... | |
int32_t | _ticksA () |
Returns the number of encoder ticks for motor A since boot. More... | |
int32_t | _ticksB () |
Returns the number of encoder ticks for motor A since boot. More... | |
void | _insertion_sort (uint16_t arr[], int n) |
Indertio sort algorithm. Faster for small array sizes. More... | |
Header file for odometry.c.
$RCSfile$
Definition in file __odometry__.h.
#define __ENC_TICK_THETA 0.1904 |
Conversion factor from encoder ticks to radians.
#define __ENC_TICK_THETA_FOR_OMEGA 190399 |
Threshold value for encoder ticks used to calculate angular velocity.
#define __PM_lower_bound 200 |
Lower bound for potentiometer readings.
#define __PM_SAMPLE_COUNT 5 |
Number of samples taken for potentiometer readings.
#define __PM_SLOPE 1 |
Slope for potentiometer readings, in radians per volt per overflow.
#define __PM_upper_bound 800 |
Upper bound for potentiometer readings.
#define BACKWARD -1 |
Constant used to indicate backward motion.
#define FORWARD 1 |
Constant used to indicate forward motion.
void _insertion_sort | ( | uint16_t | arr[], |
int | n | ||
) |
Indertio sort algorithm. Faster for small array sizes.
[in] | arr | pointer to start of sorting |
[in] | n | offset from |
arr[] |
float _omega_comp_A | ( | void | ) |
Returns the complementary filter for the angular velocity of motor A.
This function uses both encoder and potentiometer readings to calculate a more accurate estimate of the angular velocity of motor A.
float _omega_from_enc_A | ( | void | ) |
Returns the angular velocity of motor A based on encoder readings.
This function measures the time between consecutive encoder ticks to determine the angular velocity of motor A.
float _omega_from_enc_B | ( | void | ) |
Returns the angular velocity of motor B based on encoder readings.
This function measures the time between consecutive encoder ticks to determine the angular velocity of motor B.
float _omega_from_PM_A | ( | void | ) |
Returns the angular velocity of motor A based on potentiometer readings.
This function uses the potentiometer readings of motor A to determine its angular velocity.
float _omega_from_PM_B | ( | void | ) |
Returns the angular velocity of motor B based on potentiometer readings.
This function uses the potentiometer readings of motor B to determine its angular velocity.
float _theta_A | ( | void | ) |
Returns the absolute rotation angle of motor A.
float _theta_B | ( | void | ) |
Returns the absolute rotation angle of motor B.
int32_t _ticksA | ( | ) |
int32_t _ticksB | ( | ) |
float omega_comp_B | ( | void | ) |
Returns the complementary filter for the angular velocity of motor B.
This function uses both encoder and potentiometer readings to calculate a more accurate estimate of the angular velocity of motor B.