82 std::string trackConfig =
"";
83 std::stringstream trackstream(trackConfigs);
84 while(std::getline(trackstream,trackConfig,
';'))
87 std::stringstream trackConfigStream(trackConfig);
88 bool transform =
false;
89 std::string xodrFilename =
"";
90 std::string r2sReflineFilename =
"";
91 std::string r2sLaneFilename =
"";
92 std::string token =
"";
93 while(std::getline(trackConfigStream,token,
','))
97 LOG_W(
"Unrecognizable token: %s", token.c_str());
100 if(token.compare(
"transform")==0)
104 else if(token.substr(token.size()-5,5).compare(
".xodr")==0)
106 xodrFilename = token;
110 if(token.substr(token.size()-5,5).compare(
".r2sr")==0)
112 r2sReflineFilename = token;
114 else if(token.substr(token.size()-5,5).compare(
".r2sl")==0)
116 r2sLaneFilename = token;
120 LOG_W(
"Unrecognizable token: %s", token.c_str());
128 if(!xodrFilename.empty())
134 LOG_I(
"Processing file %s ...", xodrFilename.c_str());
135 converter.
convert(xodrFilename.c_str(),&partialSet,transform);
138 catch(
const std::exception& e)
140 LOG_E(
"Could not parse file %s", xodrFilename.c_str());
141 std::cout << e.what() <<
'\n';
146 for(;its.first!=its.second;its.first++)
153 else if(!(r2sReflineFilename.empty() || r2sLaneFilename.empty()))
157 LOG_I(
"Processing files %s and %s ...", r2sReflineFilename.c_str(), r2sLaneFilename.c_str());
159 converter.
convert(r2sReflineFilename,r2sLaneFilename, partialSet);
164 LOG_E(
"Could not parse R2S files %s and %s", r2sReflineFilename.c_str(), r2sLaneFilename.c_str());
169 for(;its.first!=its.second;its.first++)
177 LOG_E(
"Could not parse configuration: %s", trackConfig.c_str());
218 std::vector<env::BorderBased::BorderID> outdatedBorders;
219 std::vector<env::BorderBased::BorderID> updatedBorders;
231 LOG_E(
"Received Message.");
239 for(
auto b = newBorders.begin(); b!=newBorders.end(); b++)
243 for(
auto b = updatedBorders.begin(); b!=updatedBorders.end(); b++)
256 auto rule = it.current()->second;
base class for middleware dependent implementations of the map provider module
Definition: map_provider.h:37
Config config_
Definition: map_provider.h:53
adore::env::PrecedenceSet precedence_set_
Definition: map_provider.h:62
unsigned int subscriber_count_
Definition: map_provider.h:78
MapProvider(std::string trackConfigs, adore::env::PrecedenceSet *pset, Config config)
Definition: map_provider.h:183
DLR_TS::PlotLab::FigureStubZMQ * figure_
Definition: map_provider.h:76
adore::env::PrecedenceSet precedence_set_local_
Definition: map_provider.h:63
adore::mad::AReader< adore::env::VehicleMotionState9d > * motion_state_reader_
Definition: map_provider.h:65
adore::mad::AFeed< adore::env::BorderTypeChangeProfile > * border_type_change_feed_
Definition: map_provider.h:67
DLR_TS::PlotLab::FigureStubFactory * figure_factory_
Definition: map_provider.h:75
adore::env::MapBorderManagement map_management_
Definition: map_provider.h:61
params::APMapProvider * params_
Definition: map_provider.h:60
void setConfig(Config config)
Definition: map_provider.h:55
virtual void run()
update function
Definition: map_provider.h:214
void parseTrackConfigs(std::string trackConfigs, env::BorderBased::BorderSet &targetSet)
Definition: map_provider.h:80
adore::env::AFactory::TBorderWriter * border_output_
Definition: map_provider.h:70
adore::env::AFactory::TPrecedenceRuleWriter * precedence_output_
Definition: map_provider.h:72
virtual TPrecedenceRuleWriter * getPrecedenceRuleWriter()=0
virtual TBorderTypeChangeProfileFeed * getBorderTypeChangeProfileFeed()=0
virtual TVehicleMotionStateReader * getVehicleMotionStateReader()=0
virtual TBorderWriter * getBorderWriter()=0
efficiently store borders in boost R-tree
Definition: borderset.h:99
void rotate(double psi, double rot_x=0.0, double rot_y=0.0)
Definition: borderset.h:156
void insert_border(Border *b, bool force_insert=false)
insert new border into this
Definition: borderset.h:225
BorderIteratorPair2 getAllBorders()
get all borders in this
Definition: borderset.h:356
void setIsOwner(bool isOwner)
set whether this owns objects in pointers
Definition: borderset.h:214
void translate(double trans_x, double trans_y, double trans_z)
Definition: borderset.h:171
static adore::env::AFactory * get()
Definition: afactory.h:236
Automatically manage local map and necessary updates based on vehicle position and last state of obje...
Definition: map_border_management.h:37
void init(adore::env::BorderBased::BorderSet *baseSet)
initialization routine with base map
Definition: map_border_management.h:164
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 x, double y)
change border type of border at exactly the given position
Definition: map_border_management.h:300
void reset()
undo all changes to global map and clears local map
Definition: map_border_management.h:193
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, std::vector< adore::env::BorderBased::BorderID > &updatedBorders, int MAX_SEND_NUMBER=40)
Definition: map_border_management.h:272
PrecedenceSet contains PrecedenceRules, indexed by the area they affect.
Definition: precedence.h:179
bool contains(const PrecedenceRule &rule)
check whether a rule is contained
Definition: precedence.h:313
void refocus(double x0, double y0, double x1, double y1)
removes all rules outside of a region
Definition: precedence.h:395
itRegion2PrecedenceRT getRulesInRegion(double x0, double y0, double x1, double y1) const
returns a subset of rules in a region
Definition: precedence.h:345
void insertRule(const PrecedenceRule &rule)
inserts a copy of the given rule into container
Definition: precedence.h:291
void init(PrecedenceSet *other)
initialize by copying entries
Definition: precedence.h:300
input: 2 files, reference lines and borders output: border file
Definition: r2s2borderbased.h:31
void convert(std::string referenceLineFile, std::string laneBorderFile, env::BorderBased::BorderSet &targetset)
convert to borders
Definition: r2s2borderbased.cpp:182
OpenDRIVE converter from file to object sets.
Definition: xodr2borderbased.h:43
struct adore::if_xodr::XODR2BorderBasedConverter::@1 sampling
sampling configuration object
double numberOfPointsPerBorder
Definition: xodr2borderbased.h:75
void convert(const char *filename, adore::env::BorderBased::BorderSet *target_set, adore::env::TCDSet *tcdSet, adore::env::BorderBased::LanePositionedObjectSet *stoplineSet, adore::env::BorderBased::ParkingSpotSet *parkingSpotSet, BorderIDTranslation *idTranslation, double *x0, double *y0, bool transform=false)
full conversion of OpenDRIVE map to object representations
Definition: xodr2borderbased.cpp:26
virtual void getNext(T &value)=0
virtual bool hasNext() const =0
virtual void getData(T &value)=0
Definition: com_patterns.h:97
virtual void write(const T &value)=0
virtual uint32_t getNumberOfSubscribers() const
Definition: com_patterns.h:118
virtual APMapProvider * getMapProvider() const =0
abstract class containing parameters to configure aspects of the map provider
Definition: ap_map_provider.h:25
virtual bool getActivatePlotting() const =0
virtual int getXODRLoaderPointsPerBorder() const =0
virtual double getVisibiltyRadius() const =0
static adore::params::AFactory * get()
Definition: afactory.h:103
#define LOG_W(...)
log on warning level
Definition: csvlog.h:46
#define LOG_I(...)
log on info level
Definition: csvlog.h:37
#define LOG_E(...)
log on error level
Definition: csvlog.h:55
void plotBorderSet(adore::env::BorderBased::BorderSet &borderSet, DLR_TS::PlotLab::AFigureStub *figure)
Definition: plot_border.h:194
std::vector< Border * > BorderSubSet
Definition: borderset.h:92
x0
Definition: adore_set_goal.py:25
y0
Definition: adore_set_goal.py:26
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
Definition: areaofeffectconverter.h:20
Definition: map_provider.h:40
double trans_z_
Definition: map_provider.h:41
double rot_psi_
Definition: map_provider.h:41
double trans_x_
Definition: map_provider.h:41
double rot_z_
Definition: map_provider.h:41
double rot_x_
Definition: map_provider.h:41
double trans_y_
Definition: map_provider.h:41
double rot_y_
Definition: map_provider.h:41
Config()
Definition: map_provider.h:42
Definition: map_border_management.h:27
T1 & current()
Definition: precedence.h:226
This struct holds the motion state of the vehicle in 9d.
Definition: vehiclemotionstate9d.h:39
double getX() const
Get the x-coordinate.
Definition: vehiclemotionstate9d.h:54
double getY() const
Get the y-coordinate.
Definition: vehiclemotionstate9d.h:60