|
HoloLib
High-performance holonomic (X-Drive) control library for VEX V5
|
Handles resetting the robot's odometry using distance sensors. More...
#include <distanceReset.h>
Public Member Functions | |
| DistanceReset (Chassis *robot_chassis, const std::vector< DistanceSensor > &robot_sensors, float heading_tolerance=40.0, float filter_range=3.5) | |
| Construct a DistanceReset handler. | |
| distancePose | update (bool setPose=false, bool filter=true) |
| Updates position using all configured sensors. | |
| distancePose | update (const std::vector< bool > &use_flags, bool setPose=false, bool filter=true) |
| Updates position using a specific set of sensors by flags. | |
| distancePose | updateSpecific (const std::vector< DistanceSensor > &active_sensors, bool setPose, bool filter) |
| Updates position using an explicitly provided list of active sensors. | |
Handles resetting the robot's odometry using distance sensors.
It calculates the absolute position on the field using distance to walls.
Definition at line 32 of file distanceReset.h.
| DistanceReset::DistanceReset | ( | Chassis * | robot_chassis, |
| const std::vector< DistanceSensor > & | robot_sensors, | ||
| float | heading_tolerance = 40.0, |
||
| float | filter_range = 3.5 |
||
| ) |
Construct a DistanceReset handler.
| robot_chassis | Pointer to the chassis object. |
| robot_sensors | Vector of DistanceSensor configurations. |
| heading_tolerance | Tolerance in degrees for the sensor to be considered perpendicular to the wall. |
| filter_range | Maximum acceptable deviation from the current odometry reading. |
| distancePose DistanceReset::update | ( | bool | setPose = false, |
| bool | filter = true |
||
| ) |
Updates position using all configured sensors.
| setPose | If true, automatically updates the chassis odometry with the calculated position. |
| filter | If true, applies filtering based on filter_range. |
| distancePose DistanceReset::update | ( | const std::vector< bool > & | use_flags, |
| bool | setPose = false, |
||
| bool | filter = true |
||
| ) |
Updates position using a specific set of sensors by flags.
| use_flags | Boolean flags corresponding to each configured sensor (true to use). |
| setPose | If true, automatically updates the chassis odometry. |
| filter | If true, applies filtering. |
| distancePose DistanceReset::updateSpecific | ( | const std::vector< DistanceSensor > & | active_sensors, |
| bool | setPose, | ||
| bool | filter | ||
| ) |
Updates position using an explicitly provided list of active sensors.
| active_sensors | Vector of sensors to use for this update. |
| setPose | If true, automatically updates the chassis odometry. |
| filter | If true, applies filtering. |