I want to modify how inbuilt function plannerRRT takes nearest neighbours with some kinematic constraints
1 次查看(过去 30 天)
显示 更早的评论
This is the code of the function in plannerRRT in matlab ,i want to modify this function such that it chooses nearest neighbours which satisfy a kinematic constraint,
function [newNodeId, statusCode, treeInternal] = extend(obj, randState, treeInternal)
%extend The RRT "Extend" routine
statusCode = obj.InProgress;
newNodeId = nan;
idx = treeInternal.nearestNeighbor(randState);
nnState = treeInternal.getNodeState(idx);
d = obj.StateSpace.distance(randState, nnState);
newState = randState;
here is the function now how do i change this as its using property of treeinternal as nearest neighbors?
0 个评论
回答(1 个)
Cameron Stabile
2021-12-16
Hi Mukund,
The distance and connection method between states in plannerRRT is controlled by the nav.StateSpace that it accepts. If the planner is given a stateSpaceSE2 object, then states are connected via linear interpolation, whereas a planner constructed with stateSpaceDubins object connects two states with a Dubins path.
In both cases, the distance method of the state-space will return the length of the segment connecting the two states, and the connection-mechanism inside the interpolate method determines the shape of the segment, and is also responsible for evaluating the segment at provided lengths.
One important assumption with these Geometric Planners is that the state-space must be able to connect any two states given to it. This means the segment connecting two states should inherently enforce any kinematic constraints you have defined (similar to how the Dubins/ReedsShepp curves enforce a MinTurningRadius constraint).
If you don't mind me asking, what kind of constraints are you trying to enforce? Do you have a method for connecting states analytically which implicitly honors your kinematic constraint, akin to the Dubins example above?
Thanks in advance,
Cameron
2 个评论
Cameron Stabile
2021-12-16
Thank you for the clarification Mukund.
Do you by any chance have access to the UAV Toolbox? The feature you are requesting sounds quite similar to an example-helper they created in the Motion Planning with RRT for Fixed-Wing UAV example.
That state-space uses the uavDubinsConnection under the hood, which is effectively a 3D version of the dubinsConnection found in NAV. It should produce C1 continuous curves and allow you to provide kinematic constraints in the form of MinTurnRadius, MaxRollAngle, and FlightPathAngleLimit.
My suggestion would be to try out that helper file and see if it suits your needs, and perhaps build off that example if you have additional requirements that aren't being met.
I have also submitted an enhancement request to make this an official feature. The development team will review it alongside other such requests and may choose to expose this in a future release.
Best,
Cameron
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Motion Planning 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!