MCPcopy Create free account
hub / github.com/ZJU-FAST-Lab/Dftpav / CheckIfCollisionUsingLine

Method CheckIfCollisionUsingLine

src/Plan/traj_planner/src/map_adapter.cpp:117–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117ErrorType TrajPlannerAdapter::CheckIfCollisionUsingLine(const Eigen::Vector2d p1,
118 const Eigen::Vector2d p2, bool* res, double checkl){
119 if (!is_valid_) return kWrongStatus;
120 for(double dl = 0.0; dl < (p2-p1).norm(); dl+=checkl){
121 Eigen::Vector2d pos = (p2-p1)*dl/(p2-p1).norm()+p1;
122 map_->CheckCollisionUsingGlobalPosition(pos,res);
123 if(*res){
124 return kSuccess;
125 }
126 }
127 map_->CheckCollisionUsingGlobalPosition(p2,res);
128 return kSuccess;
129}
130ErrorType TrajPlannerAdapter::GetMovingObsTraj(
131 std::vector<std::vector<common::State>>* sur_trajs){
132 if (!is_valid_) return kWrongStatus;

Callers 1

getRectangleConstMethod · 0.80

Tested by

no test coverage detected