Hi Yaaqob,
The question of whether to use all the waypoints from your RRT-connect path as control points, or to select some, depends on the trade-off between smoothness and adherence to the original path.
In the first case, if you select all (xi,yi) points from your RRT-connect path as control points for the B-spline, the result will likely closely follow the original path. However, the resulting curve may not be smooth and could have overfitting to the noisy or unnecessary waypoints.
In the latter case,choosing a subset of control points would capture the essential shape of the path, while ignoring any points that are unnecessary or noisy. However it can miss some important details of the curve.
To select a subset of control points, you can use following criterias:
- Curvature-based Selection: Points where the curvature changes significantly are good candidates for control points.
- Uniform Spacing: This helps to evenly distribute the control points and avoid clustering too many control points in certain areas of the path.
- Smoothing with a Threshold: If some parts of the path have too many points, you might want to eliminate intermediate points that are not contributing significantly to the path’s shape.
- Algorithmic Approach: There are also optimization algorithms that can choose control points based on minimizing the difference between the original path and the smoothed curve.
The given figure demonstrates the difference between using all points as control points and using a subset of control points, selected with uniform spacing, for B-spline smoothing.
I hope this addresses your query.