54 auto read_result = adore::mad::CsvReader::get_data<double>(file_watch_path);
56 if (read_result.size() % 5 == 0)
61 while(index < read_result.size())
63 datapoint.
value = read_result[index++];
64 datapoint.
startX = read_result[index++];
65 datapoint.
startY = read_result[index++];
66 datapoint.
stopX = read_result[index++];
67 datapoint.
stopY = read_result[index++];
69 limits.push_back(datapoint);
74 std::cerr <<
"ERROR speedlimit csv might be corrupted, the count of numbers is not divisible by 5";
85 double x = motion_state.
getX();
86 double y = motion_state.
getY();
95 double abs1 = std::abs(
x - item.startX);
96 double abs2 = std::abs(
y - item.startY);
97 double abs3 = std::abs(
x - item.stopX);
98 double abs4 = std::abs(
y - item.stopY);
100 if (((abs1*abs1 + abs2*abs2) < visibilty_radius*visibilty_radius) or ((abs3*abs3 + abs4*abs4) < visibilty_radius*visibilty_radius))
108 std::cout <<
"Speed_limit_feed was full, data lost\n";
A node to gather speed limit data and provide it e.g. for laneview computation.
Definition: speedlimit_provider.h:40
adore::env::TSpeedLimitBundle limits
Definition: speedlimit_provider.h:43
adore::env::AFactory::TSpeedLimitWriter * speed_limit_writer_
Definition: speedlimit_provider.h:46
SpeedLimitProvider(std::string file_watch_path)
Definition: speedlimit_provider.h:50
void run()
Definition: speedlimit_provider.h:78
std::string file_watch_path_
Definition: speedlimit_provider.h:44
adore::env::AFactory::TVehicleMotionStateReader * motion_state_reader_
Definition: speedlimit_provider.h:45
virtual TSpeedLimitWriter * getSpeedLimitWriter()=0
virtual TVehicleMotionStateReader * getVehicleMotionStateReader()=0
static adore::env::AFactory * get()
Definition: afactory.h:236
Definition: com_patterns.h:68
virtual void getData(T &value)=0
Definition: com_patterns.h:97
virtual void write(const T &value)=0
virtual bool canWriteMore() const =0
virtual APMapProvider * getMapProvider() const =0
virtual double getVisibiltyRadius() const =0
static adore::params::AFactory * get()
Definition: afactory.h:103
std::vector< SpeedLimit > TSpeedLimitBundle
Definition: speedlimit.h:49
x
Definition: adore_set_goal.py:30
y
Definition: adore_set_goal.py:31
Definition: areaofeffectconverter.h:20
Definition: speedlimit.h:31
double startX
Definition: speedlimit.h:41
double value
Definition: speedlimit.h:40
double stopY
Definition: speedlimit.h:44
TSpeedLimitID id
Definition: speedlimit.h:45
double stopX
Definition: speedlimit.h:43
double startY
Definition: speedlimit.h:42
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