![]() |
Smart Minotaur
|
Calculates the histogramm values. Mehr ...
#include <MapCreator.hpp>
Öffentliche Methoden | |
| MapCreator (int width, int height) | |
| MapCreator (Map p_map) | |
| void | setSensorDistances (int sensor, float x, float y) |
| Sets the distances of the sensors to the mid of the robot. | |
| void | step (const int p_sensor, const int p_distance) |
| Uses the given sensor data to increment the values in the histogramm. | |
| void | calculateObstaclePosition (const int sensor, int measuredDistance) |
| void | incrementCells (int position_y, int position_x, int quality) |
| void | generateCone (float p_angle, float p_realDistance, int *p_pos_x, int *p_pos_y) |
| float | checkAngle (float p_angle) |
| bool | checkForInvalidValues (int *p_pos_x, int *p_pos_y) |
| void | calculateDistances (float p_angle, float p_realDistance, float *p_dist_x, float *p_dist_y, int index) |
| void | setPosition (RobotPosition p_position) |
| Sets the position of the robot. | |
| Map * | getMap () |
| Grants access to the Map object containing the histogramm. | |
| void | createTextFile (const char *path) |
| int | getXOffset () |
| int | getYOffset () |
Calculates the histogramm values.
This class manages and processes a Map (histogramm field) object and calculates the values of the cells of the map.
| Map * minotaur::MapCreator::getMap | ( | ) |
| void minotaur::MapCreator::setPosition | ( | RobotPosition | p_position | ) |
Sets the position of the robot.
This information is needed during step() to calculate which cells have to be incremented.
| p_position | current position of the robot. |
| void minotaur::MapCreator::setSensorDistances | ( | int | sensor, |
| float | x, | ||
| float | y | ||
| ) |
Sets the distances of the sensors to the mid of the robot.
Sets the Distance from Zero sensor = Number of sensor -> 1 = frontsensor -> 2 = sensor on the right -> 3 = sensor on the left x = Distance in x direction y = Distance in y direction.
These values are considered during step() to calculate which cells have to be incremented.
| sensor | index of sensor (left,right,front) |
| x | distance to robot in x-direction (vertically) |
| y | distance to robot in y-direction (horizontally) |
| void minotaur::MapCreator::step | ( | const int | p_sensor, |
| const int | p_distance | ||
| ) |
Uses the given sensor data to increment the values in the histogramm.
| p_sensor | index of sensor (left,right,front) |
| p_distance | measured distance in cm |