I want to define my custom state space in matlab for my robot,i followed this tutorial ,https://in.mathworks.com/help/nav/ref/nav.statespace-class.html
3 次查看(过去 30 天)
显示 更早的评论
In this as soon as i include this line
matlabshared.planning.internal.EnforceScalarHandle
it starts throwing error like illegal use of classdef ,kindly tell whats the solution to this problem
0 个评论
回答(1 个)
Cameron Stabile
2021-12-7
编辑:Cameron Stabile
2021-12-7
Hi Mukund,
Without any reproduction code it is hard to determine the problem. If you have not done so already, my suggestion would be to call createPlanningTemplate from your command line:
>> createPlanningTemplate()
This should create a new file which contains the definition to a generic state-space class named "MyCustomStateSpace". Save this file under the same name (i.e. MyCustomStateSpace.m) and you should be able to create an instance of the newly defined state-space:
ss = MyCustomStateSpace
If this works, then you should be able to edit the newly saved state-space to suit your needs, and note that you can also generate a default state-validator using the same template:
createPlanningTemplate('StateValidator')
Please let us know if this resolves the issue.
Best,
Cameron
2 个评论
Cameron Stabile
2021-12-16
Hi Mukund,
It's unclear whether your last post was a self-answer to your original question, or additional information. Did commenting out the line resolve the problem for you?
One thing to note - if your original file looked like the following:
classdef MyCustomStateSpace < nav.StateSpace
matlabshared.planning.internal.EnforceScalarHandle
properties
UniformDistribution
...
Then you would likely have needed "& ..." at the end of the first line to continue inheriting from additional classes:
classdef MyCustomStateSpace < nav.StateSpace & ...
matlabshared.planning.internal.EnforceScalarHandle
properties
UniformDistribution
...
If the issue has been resolved, please mark this question as "Answered", otherwise let us know if you are encountering further problems.
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!