Fixed neighbours pos clearing.

This commit is contained in:
vivek-shankar 2018-06-12 14:30:14 -04:00
parent 3154976e8a
commit 66cb2df693
3 changed files with 9 additions and 1 deletions

View File

@ -101,6 +101,10 @@ void neighbour_pos_callback(int id, float range, float bearing, float elevation)
* update neighbors from in msgs
*/
void update_neighbors(buzzvm_t vm);
/*
*Clear neighbours struct
*/
void clear_neighbours_pos();
/*
* closure to add a neighbor status
*/

View File

@ -651,7 +651,10 @@ void neighbour_pos_callback(int id, float range, float bearing, float elevation)
neighbors_map.erase(it);
neighbors_map.insert(make_pair(id, pos_arr));
}
// Clear neighbours pos
void clear_neighbours_pos(){
neighbors_map.clear();
}
// update at each step the VM table
void update_neighbors(buzzvm_t vm)
{

View File

@ -732,6 +732,7 @@ void roscontroller::maintain_pos(int tim_step)
if (timer_step >= BUZZRATE)
{
neighbours_pos_map.clear();
buzzuav_closures::clear_neighbours_pos();
// raw_neighbours_pos_map.clear(); // TODO: currently not a problem, but
// have to clear !
timer_step = 0;