MATLAB Answers

'SamplesPerFrame' property does not work in kinematicTrajectory function?

6 views (last 30 days)
Xiaohui Wang
Xiaohui Wang on 16 Sep 2020
Commented: Xiaohui Wang on 27 Sep 2020
I am using Matlab R2019b sensor fusion and tracking toolbox, and got the following warning when I set up the 'SamplePerFrame' property of kinematicTrajectory
> trajectory = kinematicTrajectory('SampleRate', 20, 'SamplesPerFrame', 100)
Warning: The SamplesPerFrame property is not relevant in this configuration of the System object.
> In matlab.system.SystemProp/setProperties
In kinematicTrajectory (line 253)
When I run the following command:
>> bodyAcceleration = [5,5,0]; bodyAngularVelocity = [0,0,1];
>> [position,orientation,velocity,acceleration,angularVelocity] = trajectory(bodyAcceleration,bodyAngularVelocity)
I expected the size of position is 100*3, however I only got a single output, is that related to the warning above?
Thank a lot!

Answers (1)

Sai Sri Pathuri
Sai Sri Pathuri on 22 Sep 2020
If you use 'SamplesPerFrame' property with kinematictrajectory system object, you need to set 'AccelerationSource' and 'AngularVelocitySource' to 'Property'.
trajectory = kinematicTrajectory('SampleRate', 20, 'SamplesPerFrame', 100, 'AccelerationSource', 'Property', 'AngularVelocitySource', 'Property');
Here is the link to documentation mentioning this dependency in SamplesPerFrame property section:
Since you have declared AccelerationSource and AngularVelocitySource as properties, you may define them using Acceleration and AngularVelocity properties respectively and then use system object as below.
trajectory = kinematicTrajectory('SampleRate', 20, 'SamplesPerFrame', 100, ....
'AccelerationSource', 'Property', 'AngularVelocitySource', 'Property',...
'Acceleration', [5,5,0], 'AngularVelocity', [0,0,1]);
[position,orientation,velocity,acceleration,angularVelocity] = trajectory();


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!