How is the number of sample points returned by waypointTrajectory determined?
Show older comments
Hello,
I want to simulate some synthetic IMU data with the Sensor Fusion and Tracking Toolbox. For this, I provide a trajectory (position and velocities in 3D, such as a circle or helix) to the system object waypointTrajectory. The outputs (acceleration and angular velocity in local navigation coordinate system) of waypointTrajectory can be fed to the imuSensor object that returns accel and gyro readings.
I have a hard time understanding how the number of sample points is determined by the waypointTrajectory object. If I run
trajectory = waypointTrajectory(waypoints, tVec, 'SampleRate', fs, 'AutoPitch', false, 'AutoBank', false, 'Velocities', velocityAtWaypoints);
where waypoints is a 2514x3 array and tVec = 0:1/fs:tEnd is a vector of length 2514, I would expect that running the code below, would return arrays of dimension 2514 x something. However, the arrays only have 2512 elements. Anyone knows why samples are dropped? If I reduce the sampling rate, to 10 Hz only one sample is dropped (instead of 63 x something, I get 62 x someething).
count = 1;
while(~isDone(trajectory))
[position(count,:),orientation(count,:),velocity(count,:),acceleration(count,:),angularVelocity(count,:)] = trajectory();
count = count + 1;
end
Accepted Answer
More Answers (0)
Categories
Find more on Inertial Sensor Fusion 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!