GithubHelp home page GithubHelp logo

motom-toolbox's People

Contributors

ha5dzs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

motom-toolbox's Issues

Frame Frequency vs. Marker Frequency

Hi,

I am struggling to understand how frame frequency and marker frequency are related. I have tried several values and sometimes the system can not be initiated, and some other times it works and I get the data.

From what I understand, the marker frequency is the one you also specify on NDI, depending on the number of markers you have, and obtained with the formula (frequency = 4600/(n+2.3)).
For my experiment, I put 250Hz. This means that I have one flash of marker every 4ms.

But what is the frame frequency then? I realised that frame frequency * collection time gives you the number of frames of your trials. This means that with a frame frequency of 50Hz (the one you often put in the example scripts), you get one data point every 20ms. And you get for instance 500 frames for a 10sec-long trial.

How do these 2 values reconcile? Is the value for each 20ms, the mean of the 5 points you get (one each 4ms)? Is a random point selected within these 5?

Finally, how do we know the maximum frame frequency you can put without preventing the initialisation.

Thank you for your help!

Error using loadlibrary. Failed to preprocess the input file.

Hi!
I tried to run "RUNME.m", but...

Error using loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:ndopto.h
e:\document\matlab\motom-toolbox-master\source\ndhost.h(134): fatal error C1189: #error: NDI Error - Host not
defined. Options: PLATFORM_X86, PLATFORM_LINUX

Error in RUNME (line 107)
[~, warnings] = loadlibrary('../bin/oapi.dll', '../source/ndopto.h', 'addheader', '../source/ndtypes.h',
'addheader', '../source/ndhost.h', 'addheader', '../source/ndpack.h', 'mfilename','api_prototypes');

The version of the oapi is 3.05.01.0163, matlab is 2015b(32) and vs is 2015(32).
THANKS!

Coordinate system alignment - using 4 Marker Digitizing Probe

Hi Zoltan,
Regarding defining a custom global coordinate system at the start of each test --> previously when I used the First Principles software, I would define an origin, and two of the axes, using a 4 marker digitizing probe (purchased directly from NDI).
Could you please explain the process of defining a custom coordinate system using the API ? Do I need to create a new .ini file for the probe? [We have an Optotrak certus in the lab, and don't have the ndi digitising cube]

Thanks,
Parham.

Error using loadlibrary

Hi there, I've only found this resource created by you yesterday and really thank you for the efforts you've put in to the development.

I have a question as well regarding an error I'm getting in running the RUNME.m. I'm using a Windows 64-bit computer, with 64-bit Matlab 2018b, with OAPI v3.14.10. The error is as follows:

Error using loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:In file included from //uofa/users$/users2/a1763222/Desktop/Optotrak
API/motom-toolbox-master/source/ndtypes.h:7:0,
from \uofa\users$\users2\a1763222\Desktop\Optotrak API\motom-toolbox-master\generated_binaries..\source\ndopto.h:21:
//uofa/users$/users2/a1763222/Desktop/Optotrak API/motom-toolbox-master/source/ndhost.h:153:2: error: #error unknown X86 compiler
#error unknown X86 compiler
^~~~~
Error in RUNME (line 104)
[~, warnings] = loadlibrary('../bin/oapi64.dll', '../source/ndopto.h', 'addheader', '../source/ndtypes.h', 'addheader',
'../source/ndhost.h', 'addheader', '../source/ndpack.h', 'mfilename', 'api_prototypes');

Is it an issue with the compiler being used (MinGW64 Compiler with Windows 10 SDK or later (C++)) ?

Thanks in advance.

Installation issue - oapi.dll & oapi64.dll

Hi there,

I have some issue with the toolbox installation. When running the RUNME script, it seems that it can not find the oapi64.dll. The problem is that I don't have such file in my Optotrak API files. I tried to reinstall oapi, hoping that there would be the possibility to also install a 64-bit version so I can have the oapi64.dll, but there is none.

The lab computer is a win64 (Windows 7), with a 32-bit Matlab 2015a. And we have the Optotrak Application Programmer's Interface v3.7.1 for 32-bit Windows platforms. But apparently it works despite having a win64 system.

Later in the script (l. 83), when it is supposed to select the version of the files (exist('use_64_bits', 'file') == 2), the result is 0 suggesting that it will go for the 32-bit stuff instead (hence the oapi.dll that I have).

My question is the following: can I safely modify the script so that it doesn't look for the oapi64.dll? Or do we need it for another function? Should I rather see with NDI directly so we can also have a 64-bit version?

Many thanks! And sorry for the maybe easy question, but I'm just starting with all this.
Marie

Error attempting to initialize communications with the Optotrak System

Hi,
I get the OAPI V3.1.6, when I run optotrak_startup, I can't initialize communications with the Optotrak System.

20201015-21:48:49.280 [Err] MessageSystem: Failed sending message header.
20201015-21:49:19.324 [Err] MessageSystem: Failed receiving message preamble.
20201015-21:49:19.324 [Err] OAPI error attempting to initialize communications with the Optotrak System
20201015-21:50:57.909 [Wrn] Structure not initialized (ID = 0, should be 386)
20201015-21:51:10.224 [Sts] Found Camera Parameter Set (1, 0, 0) in Camera C3-07148
20201015-21:51:10.224 [Sts] Found Camera Parameter Set (1, 0, 1) in Camera C3-07148
20201015-21:51:10.224 [Sts] Found Camera Parameter Set (3, 0, 0) in Camera C3-07148
20201015-21:51:10.224 [Sts] Found Camera Parameter Set (3, 0, 1) in Camera C3-07148
20201015-21:51:27.918 [Err] MessageSystem: Failed receiving message preamble.
20201015-21:51:27.918 [Err] OAPI error attempting to initialize communications with the Optotrak System

Thank you!

Strange capture volume and mex-file crash with nOptotrakAlignSystem

Hi there, my lab recently obtained the OAPI and thought that your wrapper implementation seemed pretty cool! We are having a few issues though, namely:

  1. When I run example_simple_experiment, it goes through the entire process correctly, but then the collection volume for my markers at the end is 1mm x 1mm x 1mm. I imagine this is because the data is all NaNs. Is there some kind of parameter I can change here to increase the capture volume? I used four real markers in this experiment, and I can see the markers in First Principles, just not in the recording using MOTOM.

  2. My assumption was to try and create a new capture volume using the NDI cube. So I went ahead and tried to run optotrak_align_my_system with the default cube arguments. It fails right at the end, where it tries to call nOptotrakAlignSystem. At this point, MATLAB crashes and I'm given an access violation error. Any ideas here?

Running MATLAB 2018a. Full crash dump attached.
matlab_crash_dump.txt

Rigid Bodies

Hi,

I'm writing because I am confused about rigid bodies and how to deal with them with the toolbox. In my setup I have 5 markers:

  • a head band with a rigid body on it. It is a square with 4 markers, organised exactly in the same order as your fingertip_annotator in the rigid body example list. I created a .rig file with NDI architect, where the origin of the rigid body is the centroid in the middle of the 4 markers

  • a marker placed near the mouth of the subject, which is the marker of interest.

Right now, everything is aligned with the camera and I can record the 5 markers. What I would like is to use the moving rigid body as the reference and to get the coordinates of the marker 5 based in reference to the rigid body (as it is possible to do with NDI).

Since the rigid body is dynamic and will be moving during the experiment, I assume I can not just align the system on it, but should rather use the rigid body functions transformations. Or should I do both even though the rigid body is dynamic?

I referred to the example script for `example_rigid_body_handling_with_buffer. Rigid body was successfully loaded, but when I used the commands to transform the data I get results which make no sense: marker 2 (which is a part of the rigid body, and whose signal is good) is written as NaN and the transformed positions seem wrong. Translation is not on the centroid of the rigid body, as it supposed to be according to the wiki (and in my coordinates of the rigid body). I feel like I misunderstood a big point but I cannot figure this out.

Also, I have a question on real-time: in the case where the real-time loop is slower than the frame rate, and that I don’t have access to all the frames using real-time data, does this mean that there is an issue? For instance my real-time data framecounter is 1*60 double in size, but inside, the value for the column 60 is 1239, which is very close to the 1250 frames I get in the buffered_data. Does this mean that when I plot the real-time data to be sure that I do not lose signal, since the frames are pooled in 60 points, I could miss out a signal loss?

Thank you!

When I run example_simple_experiment.m file, there occurred a series of problems.

Hi!
You foreseed the problem. Are there too many problems to be solved? Thank you for taking the time to answer my questions.

Warning: The data type 'error#32' used by structure OptoNodeInfoStruct does not exist. The structure may not be
usable.

In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The data type 'error#256' used by structure AlignParametersStruct does not exist. The structure may not be
usable.
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The data type 'error#256' used by structure RegisterParametersStruct does not exist. The structure may not
be usable.
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The data type 'error#256' used by structure CalibrigParametersStruct does not exist. The structure may not
be usable.
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The function 'ReadAppParms' was not found in the library
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The function 'ReadAppParms_d' was not found in the library
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The function 'SaveAppParms' was not found in the library
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The function 'SaveAppParms_d' was not found in the library
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The function 'DeleteAppParms' was not found in the library
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The data type 'FcnPtr' used by function OAPIDetermineR does not exist.
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The data type 'FcnPtr' used by function OAPITransformPoint does not exist.
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The data type 'FcnPtr' used by function DetermineR does not exist.
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
Warning: The data type 'FcnPtr' used by function TransformPoint does not exist.
In loadlibrary
In optotrak_startup (line 30)
In example_simple_experiment (line 20)
The optotrak system says: OAPI version check failed on node 0 : fw 3.19 oapi 3.5
Error using optotrak_startup (line 60)
TransputerInitializeSystem failed. Something must have gone very wrong with the initialisation.

Error in example_simple_experiment (line 20)
optotrak_startup;

Alignment trouble

Hi,

I am trying to perform a new alignment, without the NDI cube with a rigid body that I have created on 3D architect, and I have some errors at the very beginning:

Error using optotrak_set_up_system (line 29)
The config file doesn't exist or it can't be read. Have you got permissions?

When looking it up, it seems that it can not find the correct config file. And I don't know what to put in there... In optotrak_align_with_single_camera.m your config file is alignment_settings. But alignment_settings is not in the folder, so I'm not exactly sure what's in there. The only config file in the alignment folder is "this_works_with_the_NDI_cube", so I modified this one to my setup and tried to use it, but it fails so I guess it's not (especially since you commented that you made your alignment config files with 10 markers, and the cube is 16).

original_camera_file = 'standard'; %initially.
config_file = 'alignment_settings'; %I tailored this for my 10 marker setup. Change it to your own. Make sure all markers are visible and bright enough. 

--> What are the specs of this file?

recording_file = sprintf('recording_used_for_alignment_%s.dat', datestr(now, 'yyyy-mm-dd_HH-MM-SS')); %In this case, the local directory.
rigid_body_file = 'PlanFinal_3Markers_mm'; 

-->This is my new rigid body file, built with 3D architect

%rigid_body_file = 'asztal'; %This can be in C:\ngidital\rigid, or local. I chose local.
new_camera_file = sprintf('Aligned_%s.cam', datestr(now, 'yyyy-mm-dd_HH-MM-SS')); %Genreate the new camera file
logfile_name = sprintf('Aligned_%s.log', datestr(now, 'yyyy-mm-dd_HH-MM-SS')); %Genreate the new camera file

%% Step 0. Initialise. Declare useful variables here so I can check what I am meddling with.
optotrak_startup; %Do the reset dance. Make the system beep.
optotrak_set_up_system(original_camera_file, config_file); %Load the settings.
fail = RigidBodyAddFromFile_euler(0, 1, rigid_body_file); % Load a rigid body as well. %% Was commented before
if(fail)
    optotrak_tell_me_what_went_wrong;
    error('Couldn''t add the specified rigid body.')
end

A few lines below you load some parts of the config_file you used, yet I don't find all these info on any other config_file.

% We need to know how the system is initialised. It's in the config file,
% but let's load it here.
fail = 0;
sensors = 0;
odaus = 0;
rigid_bodies = 0;
markers = 0;
frame_rate = 0;
marker_frequency = 0;
threshold = 0;
gain = 0;
are_we_streaming = 0;
duty_cycle = 0;
voltage = 0;
collection_time = 0;
pretrigger_time = 0;
flags = 0;

Sorry if it's a stupid question, but could you tell me what the structure of alignment_settings is supposed to be like? Are the info listed above the only one I need in there?

thanks!

Adapt collection time for each trial

Hi,
I am starting to use the motom toolbox. I am wondering whether it is possible to change the collection time for each trial. Indeed I have two type trials of different time lenght but I am struggling to find a solution to record those trials with timing I expect.
Best,
Simon

real time checking of markers visibility

Hi,
I used to check markers visibility with First Principles before starting my experiment. It allows to correct enventually the markers position by getting real time information about their visibility. However the trial license is now over. Thus, I am wondering if there is a motom function that allows to get such real time information ?
Best,
Simon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.