'SamplesPerFrame' property does not work in kinematicTrajectory function?

5 vues (au cours des 30 derniers jours)
Xiaohui Wang
Xiaohui Wang le 16 Sep 2020
Commenté : Xiaohui Wang le 27 Sep 2020
Hi,
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!

Réponses (1)

Sai Sri Pathuri
Sai Sri Pathuri le 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: https://in.mathworks.com/help/nav/ref/kinematictrajectory-system-object.html#mw_7550710d-cdce-4092-9ffc-efd20e1ef0d8
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();

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by