Controllers and Drivers
Description
Collaboration diagram for Controllers and Drivers:
Functions | |
double | chrono::synchrono::DistanceToLine (ChVector<> p, ChVector<> l1, ChVector<> l2) |
bool | chrono::synchrono::IsInsideBox (ChVector<> pos, ChVector<> front, ChVector<> back, double width) |
front, back and width define a box, check if pos is inside that box More... | |
bool | chrono::synchrono::IsInsideQuad (ChVector<> pos, ChVector<> sp1, ChVector<> sp2, ChVector<> cp3, ChVector<> cp4) |
Checks if pos is inside the (assumed convex) quadrilateral defined by vectors for each vertex. | |
void | chrono::synchrono::Barycentric (ChVector<> p, ChVector<> a, ChVector<> b, ChVector<> 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, ChVector<> veh_pos, const int &rank, bool &inside_box, int ¤t_lane, int ¤t_approach, int ¤t_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, ChVector<> veh_pos, int ¤t_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, ChVector<> veh_pos, int ¤t_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()
- Parameters
-
p point that the distance is computed from l1 one end of the line l2 other end of the line
◆ IsInsideBox()
bool chrono::synchrono::IsInsideBox | ( | ChVector<> | pos, |
ChVector<> | front, | ||
ChVector<> | back, | ||
double | width | ||
) |
front, back and width define a box, check if pos is inside that box
- Parameters
-
pos vector position to be checked against the box front vector position, line between this and back divides the box into two rectangles back vector defining the back center of the box rectangle width i.e. box_area = width * (front - back).length
◆ UpdateLaneInfoFromMAP()
void chrono::synchrono::UpdateLaneInfoFromMAP | ( | std::shared_ptr< SynMessage > | synmsg, |
ChVector<> | 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
-
synmsg must be castable to type SynMAPMessage veh_pos current GREF vector location of the vehicle rank of the vehicle we are checking [in,out] inside_box whether the vehicle was in the stopping box for this particular lane [in,out] current_lane if we're in a box, which lane that belonged to [in,out] current_approach if we're in a box, which approach that belonged to [in,out] current_intersection if we're in a box, which intersection that belonged to [in,out] dist if vehicle is in box, how far is the vehicle from the box's stopping point (front of the box)