23 #ifndef _PLUGINS_COLLI_UTILS_ROB_ROBOSHAPE_COLLI_H_
24 #define _PLUGINS_COLLI_UTILS_ROB_ROBOSHAPE_COLLI_H_
26 #include "roboshape.h"
28 #include <utils/math/angle.h>
49 int readings_per_degree = 1);
60 std::vector<float> robot_lengths_;
62 unsigned int resolution_;
78 int readings_per_degree)
81 resolution_ = readings_per_degree;
82 for (
int i = 0; i < 360 * readings_per_degree; i++) {
83 float anglerad = (i / readings_per_degree) * M_PI / 180.f;
91 robot_lengths_.clear();
111 int number = (int)(angledeg * resolution_);
112 return robot_lengths_[number];
Interface for configuration handling.
This class is mainly the same as the basic class with the difference that all data is precalculated o...
~RoboShapeColli()
Destructor.
float get_robot_length_for_deg(float angledeg)
Returns the robots length for a specific angle.
float get_robot_length_for_rad(float anglerad)
Returns the robots length for a specific angle.
RoboShapeColli(const char *cfg_prefix, Logger *logger, Configuration *config, int readings_per_degree=1)
Constructor.
This is a class containing all roboshape information.
float get_robot_length_for_rad(float anglerad)
return the length of the robot for a specific angle
Fawkes library namespace.
float rad2deg(float rad)
Convert an angle given in radians to degrees.