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 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Cameron Stabile
on 7 Dec 2021
Edited: Cameron Stabile
on 7 Dec 2021
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 Comments
Cameron Stabile
on 16 Dec 2021
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
See Also
Categories
Find more on Motion Planning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!