Controllers and Drivers

Description

Collaboration diagram for Controllers and Drivers:

Functions

double chrono::synchrono::DistanceToLine (ChVector3d p, ChVector3d l1, ChVector3d l2)
 
bool chrono::synchrono::IsInsideBox (ChVector3d pos, ChVector3d front, ChVector3d back, double width)
 front, back and width define a box, check if pos is inside that box More...
 
bool chrono::synchrono::IsInsideQuad (ChVector3d pos, ChVector3d sp1, ChVector3d sp2, ChVector3d cp3, ChVector3d cp4)
 Checks if pos is inside the (assumed convex) quadrilateral defined by vectors for each vertex.
 
void chrono::synchrono::Barycentric (ChVector3d p, ChVector3d a, ChVector3d b, ChVector3d c, double &u, double &v, double &w)
 Compute barycentric coordinates (u, v, w) for point p with respect to triangle (a, b, c)
 
void chrono::synchrono::UpdateLaneInfoFromMAP (std::shared_ptr< SynMessage > synmsg, ChVector3d veh_pos, const int &rank, bool &inside_box, int &current_lane, int &current_approach, int &current_intersection, double &dist)
 update inside_box, dist and current_* variables based on info from a MAP message More...
 
void chrono::synchrono::UpdateInsideBoxFromApproachMessage (std::shared_ptr< SynApproachMessage > app_msg, ChVector3d veh_pos, int &current_lane, bool &inside_box, double &dist)
 update current_lane, inside_box and dist based on info from an Approach Message
 
void chrono::synchrono::UpdateInsideBoxFromMessage (std::shared_ptr< SynMessage > synmsg, ChVector3d veh_pos, int &current_lane, bool &inside_box, double &dist)
 calls UpdateInsideBoxFromApproachMessage
 
LaneColor chrono::synchrono::GetLaneColorFromMessage (std::shared_ptr< SynMessage > synmsg, const int intersection, const int approach, const int lane)
 Given an intersection, approach and lane, parse a SPAT message (synmsg) and return the lane color.
 

Function Documentation

◆ DistanceToLine()

double chrono::synchrono::DistanceToLine ( ChVector3d  p,
ChVector3d  l1,
ChVector3d  l2 
)
Parameters
ppoint that the distance is computed from
l1one end of the line
l2other end of the line

◆ IsInsideBox()

bool chrono::synchrono::IsInsideBox ( ChVector3d  pos,
ChVector3d  front,
ChVector3d  back,
double  width 
)

front, back and width define a box, check if pos is inside that box

Parameters
posvector position to be checked against the box
frontvector position, line between this and back divides the box into two rectangles
backvector defining the back center of the box rectangle
widthi.e. box_area = width * (front - back).length

◆ UpdateLaneInfoFromMAP()

void chrono::synchrono::UpdateLaneInfoFromMAP ( std::shared_ptr< SynMessage synmsg,
ChVector3d  veh_pos,
const int &  rank,
bool &  inside_box,
int &  current_lane,
int &  current_approach,
int &  current_intersection,
double &  dist 
)

update inside_box, dist and current_* variables based on info from a MAP message

Parameters
synmsgmust be castable to type SynMAPMessage
veh_poscurrent GREF vector location of the vehicle
rankof the vehicle we are checking
[in,out]inside_boxwhether the vehicle was in the stopping box for this particular lane
[in,out]current_laneif we're in a box, which lane that belonged to
[in,out]current_approachif we're in a box, which approach that belonged to
[in,out]current_intersectionif we're in a box, which intersection that belonged to
[in,out]distif vehicle is in box, how far is the vehicle from the box's stopping point (front of the box)