7 pcl::KdTreeFLANN<pcl::PointXYZ> kdtree;
8 std::list<SearchMove> acts;
14 kdtree.setInputCloud(Map);
19 for(
double W = Wmin; W <= Wmax; W+=delta)
23 pcl::PointXYZ searchPoint(result.
x, result.
y,0);
24 std::vector<int> pointIdxRadiusSearch;
25 std::vector<float> pointRadiusSquaredDistance;
26 if ( Map->empty() || kdtree.radiusSearch(searchPoint, Threshold, pointIdxRadiusSearch, pointRadiusSquaredDistance) == 0 )
33 for(
double W = Wmin; W <= Wmax; W+=delta)
37 pcl::PointXYZ searchPoint = pcl::PointXYZ(result.
x, result.
y,0);
38 std::vector<int> pointIdxRadiusSearch;
39 std::vector<float> pointRadiusSquaredDistance;
40 if ( Map->empty() || kdtree.radiusSearch(searchPoint, Threshold, pointIdxRadiusSearch, pointRadiusSquaredDistance) == 0 )
46 if(PointTurnsEnabled){
49 pcl::PointXYZ searchPoint(result.
x, result.
y,0);
50 std::vector<int> pointIdxRadiusSearch;
51 std::vector<float> pointRadiusSquaredDistance;
52 if ( Map->empty() || kdtree.radiusSearch(searchPoint, Threshold, pointIdxRadiusSearch, pointRadiusSquaredDistance) == 0 )
57 result = getResult(state, move);
58 searchPoint = pcl::PointXYZ(result.
x, result.
y,0);
59 pointIdxRadiusSearch.clear();
60 pointRadiusSquaredDistance.clear();
61 if ( kdtree.radiusSearch(searchPoint, Threshold, pointIdxRadiusSearch, pointRadiusSquaredDistance) == 0 )
73 if(abs(action.
W) > 1e-10)
76 double R = action.
V / action.
W;
77 double ICCx = state.
x - ( R * cos(M_PI - state.
theta) );
78 double ICCy = state.
y - ( R * sin(M_PI - state.
theta) );
79 using namespace Eigen;
81 double wdt = w*DeltaT;
82 T << cos(wdt), sin(wdt), 0, -sin(wdt), cos(wdt), 0, 0, 0, 1;
83 Vector3d a(state.
x - ICCx, state.
y - ICCy, state.
theta);
85 Vector3d c = b + Vector3d(ICCx, ICCy, wdt);
91 while(result.
theta < 0)
92 result.
theta += 2*M_PI;
93 while(result.
theta > 2*M_PI)
94 result.
theta -= 2*M_PI;
99 result.
x = state.
x + ( cos(M_PI_2 - result.
theta) * action.
V * DeltaT );
100 result.
y = state.
y + ( sin(M_PI_2 - result.
theta) * action.
V * DeltaT );
std::list< SearchMove > getActions(SearchLocation state)
SearchLocation getResult(SearchLocation state, SearchMove action)