Wrong LPA and RPA location

The coordinates are also skewed, with both x and y values not near zero. But I'd have to look at the code as to how they're displayed on the head at this stage, probably projected to the intersection of the axis with the surface.

When you said the stylus "looks ok", did you test it in another software? Polhemus' PiMgr also allows you to easily access their hardware's "self tests". Please make sure that you don't have errors there: it's not useful to try to debug software if the hardware is broken.

If you've confirmed the hardware works as expected, including checking coordinates collected in PiMgr for example, then next would be to confirm the Polhemus configuration is correct as I mentioned, including importantly the side of the emitter you're collecting in.

Regarding the configuration, I've edited our code to set more parameters through the serial connection, to avoid having to (re)set them elsewhere. In the Brainstorm file panel_digitize.m, in function CreateSerialConnection, I added these lines to configure the Fastrak - after reviewing the Fastrak manual:

                % Open connection
                fopen(SerialConnection); 
                if strcmp(DigitizeOptions.UnitType,'fastrak')
                    %'c' - Disable Continuous Printing
                    % Required for some configuration options.
                    fprintf(SerialConnection,'c');
                    %'u' - Metric Conversion Units (set units to cm)
                    fprintf(SerialConnection,'u');
                    %'F' - Enable ASCII Output Format
                    fprintf(SerialConnection,'F');
                    %'R' - Reset Alignment Reference Frame
                    fprintf(SerialConnection,'R1');
                    fprintf(SerialConnection,'R2');
                    %'A' - Alignment Reference Frame
                    %'H' - Hemisphere of Operation
                    fprintf(SerialConnection,'H1,0,0,-1'); % -Z hemisphere
                    fprintf(SerialConnection,'H2,0,0,-1'); % -Z hemisphere
                    %'l' - Active Station State
                    % Could check here if 1 and 2 are active.
                    %'N' - Define Tip Offsets % Always factory default on power-up.
                    %    fprintf(SerialConnection,'N1'); data = fscanf(SerialConnection)
                    %    data = '21N  6.344  0.013  0.059
                    %'O' - Output Data List
                    fprintf(SerialConnection,'O1,2,4,1'); % default precision: position, Euler angles, CRLF
                    fprintf(SerialConnection,'O2,2,4,1'); % default precision: position, Euler angles, CRLF
                    %fprintf(SerialConnection,'O1,52,54,51'); % extended precision: position, Euler angles, CRLF
                    %fprintf(SerialConnection,'O2,52,54,51'); % extended precision: position, Euler angles, CRLF
                    %'Q' - Angular Operational Envelope
                    fprintf(SerialConnection,'Q1,180,90,180,-180,-90,-180');
                    fprintf(SerialConnection,'Q2,180,90,180,-180,-90,-180');
                    %'V' - Position Operational Envelope
                    % Could use to warn if too far.
                    fprintf(SerialConnection,'V1,100,100,100,-100,-100,-100');
                    fprintf(SerialConnection,'V2,100,100,100,-100,-100,-100');
                    %'x' - Position Filter Parameters
                    % The macro setting used here also applies to attitude filtering.
                    % 1=none, 2=low, 3=medium (default), 4=high
                    fprintf(SerialConnection,'x3');
                    
                    %'e' - Define Stylus Button Function
                    fprintf(SerialConnection,'e1,1'); % Point mode
                    
                    %'^K' - *Save Operational Configuration
                    % 'ctrl+K' = char(11)
                    %'^Y' - *Reinitialize System
                    % 'ctrl+Y' = char(25)

Pay special attention to the Hemisphere of Operation, and Envelopes, with respect to the relative position and orientation of your emitter and sensors.

1 Like