![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
with class
Dependencies: ISR_Mini-explorer mbed
Fork of VirtualForces by
Diff: Map.cpp
- Revision:
- 35:68f9edbb3cff
- Parent:
- 34:c208497dd079
- Child:
- 39:890439b495e3
diff -r c208497dd079 -r 68f9edbb3cff Map.cpp --- a/Map.cpp Fri Jun 09 14:30:21 2017 +0000 +++ b/Map.cpp Sun Jun 11 22:40:37 2017 +0000 @@ -38,24 +38,10 @@ return 1-1/(1+exp(lt)); } - -//returns the log value that the cell is occupied from the probability value [0,1] -float Map::proba_to_log(float p){ - return log(p/(1-p)); -} - void Map::update_cell_value(int widthIndice,int heightIndice ,float proba){ this->cellsLogValues[widthIndice][heightIndice]=this->cellsLogValues[widthIndice][heightIndice]+this->proba_to_log(proba)+this->initialLogValues[widthIndice][heightIndice];//map is filled as map[0][0] get the data for the point closest to the origin } -float Map::robot_x_coordinate_in_world(float robot_x, float robot_y){ - return this->nbCellWidth*this->sizeCellWidth-robot_y; -} - -float Map::robot_y_coordinate_in_world(float robot_x, float robot_y){ - return robot_x; -} - float Map::cell_width_coordinate_to_world(int i){ return this->sizeCellWidth/2+i*this->sizeCellWidth; } @@ -68,8 +54,22 @@ return this->log_to_proba(this->cellsLogValues[widthIndice][heightIndice]); } +//returns the log value that the cell is occupied from the probability value [0,1] +float Map::proba_to_log(float p){ + return log(p/(1-p)); +} + /* +float Map::robot_x_coordinate_in_world(float robot_x, float robot_y){ + return this->nbCellWidth*this->sizeCellWidth-robot_y; +} + +float Map::robot_y_coordinate_in_world(float robot_x, float robot_y){ + return robot_x; +} + + void MiniExplorerCoimbra::print_final_map() { float currProba; pc.printf("\n\r");