21 #include <unordered_set>
89 double s_lower_bound,s_ego,n_ego,ds_ego;
91 ds_ego = vehicle_state.
getvx();
96 std::unordered_set<adore::view::TrafficObject::TTrackingID> parallel_traffic_ids;
110 std::vector<Conflict> conflict_set;
114 if(parallel_traffic_ids.find(element.trackingID_)==parallel_traffic_ids.end())
117 for(
auto& cylinder:element.occupancy_.getLevel(0))
119 double x,
y,s,n,xc,yc,zc;
120 x = cylinder.second.x_;
121 y = cylinder.second.y_;
123 if(s - cylinder.second.rxy_<s_lower_bound)
continue;
125 double d = std::sqrt((
x-xc)*(
x-xc)+(
y-yc)*(
y-yc));
128 conflict_set.push_back(
Conflict(xc,yc,s - cylinder.second.rxy_,n,cylinder.second.t0_,cylinder.second.t1_,cylinder.second.rxy_,element.trackingID_));
133 std::sort(conflict_set.begin(),conflict_set.end(),[](
Conflict a,
Conflict b){return a.s<b.s;});
135 std::cout<<
"-----------------------------------------"<<std::endl;
136 for(
auto& c:conflict_set)
138 std::cout<<
"s="<<c.s-s_lower_bound<<
", t0="<<c.t0-vehicle_state.
getTime()<<
", t1="<<c.t1-vehicle_state.
getTime()<<std::endl;
142 std::vector<adore::env::OccupancyCylinderPrediction> ocps;
143 if(conflict_set.size()>0)
146 auto item = conflict_set[0];
163 for(
const auto&
object:queue)
165 parallel_traffic_ids.insert(
object.getTrackingID());
Definition: crosstraffic_constraint_provider.h:35
adore::env::ThreeLaneViewDecoupled three_lanes_
Definition: crosstraffic_constraint_provider.h:44
virtual void update()
update data, views and recompute constraints
Definition: crosstraffic_constraint_provider.h:73
adore::env::AFactory::TOCPredictionSetWriter * conflict_set_writer_
Definition: crosstraffic_constraint_provider.h:46
void add_ids(std::unordered_set< adore::view::TrafficObject::TTrackingID > ¶llel_traffic_ids, const adore::view::TrafficQueue &queue)
Definition: crosstraffic_constraint_provider.h:161
adore::env::AFactory::TOCPredictionSetReader * prediction_reader_
Definition: crosstraffic_constraint_provider.h:45
double max_centerline_distance_
Definition: crosstraffic_constraint_provider.h:52
adore::params::APLongitudinalPlanner * plplanner_
Definition: crosstraffic_constraint_provider.h:51
adore::params::APVehicle * pvehicle_
Definition: crosstraffic_constraint_provider.h:50
adore::env::OccupancyCylinderPredictionSet ocp_set_
Definition: crosstraffic_constraint_provider.h:48
CrosstrafficConstraintProvider()
Definition: crosstraffic_constraint_provider.h:60
virtual ~CrosstrafficConstraintProvider()
Definition: crosstraffic_constraint_provider.h:55
adore::env::AFactory::TVehicleMotionStateReader * vehicle_state_reader_
Definition: crosstraffic_constraint_provider.h:49
virtual TOCPredictionSetWriter * getConflictSetWriter()=0
virtual TOCPredictionSetReader * getExpectedPredictionSetReader()=0
virtual TVehicleMotionStateReader * getVehicleMotionStateReader()=0
static adore::env::AFactory * get()
Definition: afactory.h:236
Definition: threelaneviewdecoupled.h:32
virtual adore::view::ALaneChangeView * getLeftLaneChange()
Definition: threelaneviewdecoupled.h:412
virtual adore::view::ALaneChangeView * getRightLaneChange()
Definition: threelaneviewdecoupled.h:419
virtual adore::view::ALane * getCurrentLane()
Definition: threelaneviewdecoupled.h:405
void update()
Definition: threelaneviewdecoupled.h:373
Definition: com_patterns.h:68
virtual void getData(T &value)=0
virtual bool hasData() const =0
virtual bool hasUpdate() const =0
Definition: com_patterns.h:97
virtual void write(const T &value)=0
void insert(const VolumeType &volume)
Definition: vectorbasedvolumetree.h:90
virtual APVehicle * getVehicle() const =0
virtual APLongitudinalPlanner * getLongitudinalPlanner() const =0
abstract class containing parameters related to configuring the longitudinal planner
Definition: ap_longitudinal_planner.h:26
virtual double getStopDistanceToConflictPoint() const =0
distance between stop position and conflict point
virtual double getAccLB() const =0
getAccLB returns longitudinal acceleration lower bound
abstract class for vehicle configuration related paremeters
Definition: ap_vehicle.h:29
virtual double get_b() const =0
rear axle to cog
virtual double get_a() const =0
cog to front axle
virtual double get_c() const =0
front axle to front border
static adore::params::AFactory * get()
Definition: afactory.h:103
virtual ALane * getTargetLane()=0
virtual void toRelativeCoordinates(double xe, double ye, double &s, double &n)=0
virtual const TrafficQueue & getOnLaneTraffic() const =0
virtual void toEucledianCoordinates(double s, double n, double &xe, double &ye, double &ze)=0
virtual bool isValid() const =0
std::vector< OccupancyCylinderPrediction > OccupancyCylinderPredictionSet
Definition: occupancycylinderprediction.h:40
std::vector< TrafficObject > TrafficQueue
Definition: trafficobject.h:183
x
Definition: adore_set_goal.py:30
y
Definition: adore_set_goal.py:31
Definition: areaofeffectconverter.h:20
Definition: crosstraffic_constraint_provider.h:38
double x
Definition: crosstraffic_constraint_provider.h:39
Conflict(double x, double y, double s, double n, double t0, double t1, double rxy, adore::view::TrafficObject::TTrackingID id)
Definition: crosstraffic_constraint_provider.h:41
adore::view::TrafficObject::TTrackingID id
Definition: crosstraffic_constraint_provider.h:40
double rxy
Definition: crosstraffic_constraint_provider.h:39
double t1
Definition: crosstraffic_constraint_provider.h:39
double s
Definition: crosstraffic_constraint_provider.h:39
double n
Definition: crosstraffic_constraint_provider.h:39
double y
Definition: crosstraffic_constraint_provider.h:39
double t0
Definition: crosstraffic_constraint_provider.h:39
Definition: occupancycylinderprediction.h:27
int branchID_
Definition: occupancycylinderprediction.h:31
int trackingID_
Definition: occupancycylinderprediction.h:30
adore::mad::OccupancyCylinderTree occupancy_
Definition: occupancycylinderprediction.h:33
float confidence_
Definition: occupancycylinderprediction.h:34
int predecessorID_
Definition: occupancycylinderprediction.h:32
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 getvx() const
Get the longitudinal velocity.
Definition: vehiclemotionstate9d.h:78
double getY() const
Get the y-coordinate.
Definition: vehiclemotionstate9d.h:60
double getTime() const
Get the time.
Definition: vehiclemotionstate9d.h:48
Definition: occupancycylinder.h:25
int TTrackingID
Definition: trafficobject.h:29