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> 53 int readings_per_degree = 1 )
throw (
int);
57 float get_robot_length_for_rad(
float anglerad );
60 float get_robot_length_for_deg(
float angledeg );
64 std::vector< float > robot_lengths_;
66 unsigned int resolution_;
81 RoboShapeColli::RoboShapeColli(
const char * cfg_prefix,
84 int readings_per_degree )
throw (
int)
87 resolution_ = readings_per_degree;
88 for (
int i = 0; i < 360*readings_per_degree; i++ ) {
89 float anglerad = (i / readings_per_degree) * M_PI / 180.f;
90 robot_lengths_.push_back( this->RoboShape::get_robot_length_for_rad( anglerad ) );
96 RoboShapeColli::~RoboShapeColli()
98 robot_lengths_.clear();
106 RoboShapeColli::get_robot_length_for_rad(
float anglerad )
108 return (this->get_robot_length_for_deg(
rad2deg( anglerad ) ));
116 RoboShapeColli::get_robot_length_for_deg(
float angledeg )
118 int number = (int)(angledeg*resolution_);
119 return robot_lengths_[number];
Fawkes library namespace.
float rad2deg(float rad)
Convert an angle given in radians to degrees.
This is a class containing all roboshape information.
This class is mainly the same as the basic class with the difference that all data is precalculated o...
Interface for configuration handling.