This example inspired by an another post on the NaturalPoint Forum allows you to poll the data of a rigid body trough the NatNet librairy offered in Motive.
Raphael Cherfan (2020). MotiveExample (https://www.mathworks.com/matlabcentral/fileexchange/49085-motiveexample), MATLAB Central File Exchange. Retrieved .
What parameters do I need to enter in the S-Function block, and what input should I give? Thanks
Thanks for your work,
If you want to use several blocks to simultaneously get the positions for several objects you can add these lines to ProcessFrame methods:
function [D] = ProcessFrame( frameOfData,block )
index_obj = block.InputPort(1).Data;
rigidBodyData = frameOfData.RigidBodies(index_obj);
And then don't forget to call :
In Output methods.
Is there anyone who wrote TLC file for this file???
Great work, really useful
only have an issue while trying to run the model in External mode with Windows Real-Time Target.
It's asking for TLC block file. I'm not sure how I should write this specific file?
Inspired: Natural Point Motive (Optitrack) API interface to Matlab and Simulink 64bit by Or Hirshfeld, C-mex S-function interface to Natural Point Motive (Optitrack) in Simulink by Or Hirshfeld, orhirshfeld/Simulink_Motive_API_v3