72 void do_run(
double x,
double y,
double r, std::vector<adore::env::BorderBased::Border*> &newBorders, std::vector<adore::env::BorderBased::BorderID> &outdatedBorders, std::vector<adore::env::BorderBased::BorderID> &updatedBorders,
int MAX_SEND_NUMBER = 40)
74 static int MIN_DELETE_NUMBER = 5;
76 outdatedBorders.clear();
77 updatedBorders.clear();
82 for(
auto it = invisible.begin(); it!=invisible.end(); it++)
84 outdatedBorders.push_back((*it)->m_id);
96 newBorders.push_back(border);
100 if(newCount >= MAX_SEND_NUMBER - MIN_DELETE_NUMBER)
106 else if(newCount >= MAX_SEND_NUMBER)
115 for(
int i = 0; i < MAX_SEND_NUMBER - newCount ;i++)
195 std::queue<adore::env::BorderBased::BorderID>().swap(
m_updateQueue);
197 for(;its.first!=its.second;its.first++)
199 auto b = its.first->second;
226 for(;itpair.first!=itpair.second;itpair.first++)
228 auto border = itpair.
first->second;
229 if(!border->typeIsChangeable())
continue;
231 auto b = itpair.first->second->m_id;
262 for(;itpair.first!=itpair.second;itpair.first++)
264 auto b = itpair.
first->second;
272 void run(
double x,
double y,
double r, std::vector<adore::env::BorderBased::Border*> &newBorders, std::vector<adore::env::BorderBased::BorderID> &outdatedBorders, std::vector<adore::env::BorderBased::BorderID> &updatedBorders,
int MAX_SEND_NUMBER = 40)
274 do_run(
x,
y,
r, newBorders, outdatedBorders, updatedBorders, MAX_SEND_NUMBER);
287 void run(
double x,
double y,
double r, std::vector<adore::env::BorderBased::Border*> &newBorders, std::vector<adore::env::BorderBased::BorderID> &outdatedBorders,
int MAX_SEND_NUMBER = 40)
289 std::vector<adore::env::BorderBased::BorderID> dummyDelete;
290 do_run(
x,
y,
r, newBorders, outdatedBorders, dummyDelete, MAX_SEND_NUMBER);
303 for(
auto b = vec.begin(); b!= vec.end(); b++)
305 if((*b)->typeIsChangeable())
342 for(;itpair.first!=itpair.second;itpair.first++)
344 if(itpair.first->second->typeIsChangeable())
346 itpair.
first->second->m_type = t;
357 LOG_T(
"Enter function.");
363 for(
auto b = startingBorders.begin(); b!=startingBorders.end(); b++)
365 if((*b)->typeIsChangeable())
373 for(
auto b = endingBorders.begin(); b!=endingBorders.end(); b++)
375 if((*b)->typeIsChangeable())
381 LOG_T(
"Border Sizes: %i, %i", startingProfile.size(), endingProfile.size());
383 if(startingProfile.size()==0 or endingProfile.size()==0 or startingProfile.size()!=endingProfile.size() or btcp.
borderTypeProfile.size()<startingProfile.size())
385 LOG_E(
"BorderTypeChangeProfile is inconsistent.");
389 for(
int i=0; i<startingProfile.size(); i++)
391 auto startingBorder = startingProfile.at(i);
392 auto endingBorder = endingProfile.at(i);
394 targetBorder.push_back(endingBorder);
395 std::deque<BorderBased::BorderID> path;
399 LOG_W(
"BorderTypeChangeProfile path between borders was not found.");
401 LOG_T(
"Path size: %i", path.size());
403 for(
auto id=path.begin();
id!=path.end();
id++)
efficiently store borders in boost R-tree
Definition: borderset.h:99
void clear()
remove all borders from this, delete object if this is owner
Definition: borderset.h:284
BorderSubSet getBordersAtPoint(double x, double y, double max_lane_width)
get all borders at the given point
Definition: borderset.h:403
bool findPathBetweenBorders(BorderID curID, std::deque< BorderID > &solvedList, std::vector< Border * > targets, size_t searchDepth=10)
find path between a starting border and a list of possible target borders in a recursive manner
Definition: borderset.h:308
itCoordinate2Border getSuccessors(Border *b)
get an interator pair for all borders which follow after b
Definition: borderset.h:996
void insert_border(Border *b, bool force_insert=false)
insert new border into this
Definition: borderset.h:225
itRegion2Border getBordersInRegion(double x0, double x1, double y0, double y1)
get all borders in this within region
Definition: borderset.h:370
BorderIteratorPair2 getAllBorders()
get all borders in this
Definition: borderset.h:356
Border * getBorder(const BorderID &id) const
retrieve a border by ID
Definition: borderset.h:628
bool hasBorder(const BorderID &id) const
check whether a border exists in the set
Definition: borderset.h:966
void erase_border(const BorderID &oldID)
erase border from this
Definition: borderset.h:269
BorderSubSet getBorderSetOutsideRegion(double x0, double x1, double y0, double y1)
get all borders outside of region in BorderSubSet
Definition: borderset.h:443
void deepBorderCopy(BorderSet ©)
generate a complete copy including copies of objects the pointers point to
Definition: borderset.h:1507
BorderSubSet getIndexableNeighbors(Border *b)
returns the given border and all parallel borders with a changeable type, ordered from leftmost to ri...
Definition: borderset.h:1303
Automatically manage local map and necessary updates based on vehicle position and last state of obje...
Definition: map_border_management.h:37
void deleteBordersInRegion(double x0, double x1, double y0, double y1)
removes borders in region from global and local map
Definition: map_border_management.h:223
void init(adore::env::BorderBased::BorderSet *baseSet)
initialization routine with base map
Definition: map_border_management.h:164
std::queue< adore::env::BorderBased::BorderID > m_updateQueue
Definition: map_border_management.h:48
void initBaseSet(adore::env::BorderBased::BorderSet *baseSet)
initialization of internal sets
Definition: map_border_management.h:65
adore::env::BorderBased::Border * getBorder(adore::env::BorderBased::BorderID &bId)
Direct access to border in global map for auxiliary uses like plotting.
Definition: map_border_management.h:175
void changeBorderType(adore::env::BorderBased::BorderType::TYPE t, double x0, double x1, double y0, double y1)
change border type of borders in region to given type
Definition: map_border_management.h:339
env::BorderBased::BorderSubSet getBordersAtPoint(double x, double y)
Get borders at given point.
Definition: map_border_management.h:154
adore::env::BorderBased::BorderSet m_localSet
Definition: map_border_management.h:45
void changeBorderType(adore::env::BorderBased::BorderType::TYPE t, double x, double y)
change border type of border at exactly the given position
Definition: map_border_management.h:300
MapBorderManagement()
Construct a new Map Border Management object.
Definition: map_border_management.h:132
adore::env::BorderBased::BorderSet m_baseSet
Definition: map_border_management.h:39
void changeBorderType(adore::env::BorderBased::BorderID id, adore::env::BorderBased::BorderType::TYPE t)
change border type of border identified by id
Definition: map_border_management.h:320
env::BorderBased::itCoordinate2Border getSuccessors(env::BorderBased::Border *b)
Get successors of a given border from global set.
Definition: map_border_management.h:142
void changeBorderType(BorderTypeChangeProfile btcp)
change border type based on BorderTypeChangeProfile struct
Definition: map_border_management.h:355
void reset()
undo all changes to global map and clears local map
Definition: map_border_management.h:193
void addBordersInRegion(double x0, double x1, double y0, double y1)
add formerly deleted borders in a given region into global map from base map
Definition: map_border_management.h:259
void initGlobalSet()
initialization of global set
Definition: map_border_management.h:55
void clearLocalMap()
clear local map
Definition: map_border_management.h:184
adore::env::BorderBased::BorderSet m_globalSet
Definition: map_border_management.h:42
void do_run(double x, double y, double r, std::vector< adore::env::BorderBased::Border * > &newBorders, std::vector< adore::env::BorderBased::BorderID > &outdatedBorders, std::vector< adore::env::BorderBased::BorderID > &updatedBorders, int MAX_SEND_NUMBER=40)
Definition: map_border_management.h:72
adore::env::BorderBased::BorderSet * getGlobalMap()
Definition: map_border_management.h:210
void run(double x, double y, double r, std::vector< adore::env::BorderBased::Border * > &newBorders, std::vector< adore::env::BorderBased::BorderID > &outdatedBorders, int MAX_SEND_NUMBER=40)
reduced run method, receive new visible borders and now outdated borders
Definition: map_border_management.h:287
void run(double x, double y, double r, std::vector< adore::env::BorderBased::Border * > &newBorders, std::vector< adore::env::BorderBased::BorderID > &outdatedBorders, std::vector< adore::env::BorderBased::BorderID > &updatedBorders, int MAX_SEND_NUMBER=40)
Definition: map_border_management.h:272
#define LOG_T(...)
log on trace level
Definition: csvlog.h:28
#define LOG_W(...)
log on warning level
Definition: csvlog.h:46
#define LOG_E(...)
log on error level
Definition: csvlog.h:55
TYPE
This enum holds the different types of borders.
Definition: border.h:37
std::vector< Border * > BorderSubSet
Definition: borderset.h:92
std::vector< double > getCornerPoints(double x, double y, double r)
Get corner points vector from center point and radius.
Definition: map_auxiliary.h:34
x0
Definition: adore_set_goal.py:25
x
Definition: adore_set_goal.py:30
y0
Definition: adore_set_goal.py:26
y
Definition: adore_set_goal.py:31
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
r
Definition: adore_suppress_lanechanges.py:209
Definition: areaofeffectconverter.h:20
This struct identifies a Border by the coordinates of the starting and the end point.
Definition: borderid.h:31
The border struct contains data of the smallest.
Definition: border.h:62
Tborderpath * m_path
Definition: border.h:70
BorderType::TYPE m_type
Definition: border.h:71
bool typeIsChangeable()
Check whether type is Changeable.
Definition: border.h:278
This struct represents 3-dimensional coordines.
Definition: coordinate.h:34
double m_Y
Definition: coordinate.h:35
double m_X
Definition: coordinate.h:35
T1 first
Definition: borderset.h:47
Definition: map_border_management.h:27
std::vector< BorderBased::BorderType::TYPE > borderTypeProfile
Definition: map_border_management.h:30
BorderBased::Coordinate end
Definition: map_border_management.h:29
BorderBased::Coordinate start
Definition: map_border_management.h:28