Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cisst Trackers need easy way to get multiple frames at same timestamp #40

Open
pkazanzides opened this issue Nov 9, 2015 · 1 comment

Comments

@pkazanzides
Copy link
Contributor

There is a serious need to get multiple rigid body frames that correspond to the same timestamp.

@marcinbalicki
Copy link
Contributor

Since the tracker frames are all in the same state table and updated at the same time, it is possible to use table index accessed through any interface to access the frame with the same timestamp from another interface. A single method to get all frames would be nice.

I have added the state table index accessor to the state table.
jhu-saw/sawNDITracker@dc19615

Here is an example in python that retrieves 3 tracking body frames corresponding to a single acquisition
:

# INIT
    #create an interface for the tracked pointer body
        trackedBodyName = 'Tool'
        self.ToolBody = proxyComponent.AddInterfaceRequiredAndConnect((name, trackedBodyName))

        #create an interface for the tracked pointer body
        trackedBodyName = 'Arm'
        self.ArmBody = proxyComponent.AddInterfaceRequiredAndConnect((name, trackedBodyName))

        #create an interface for the tracked pointer body
        trackedBodyName = 'Base'
        self.BaseBody = proxyComponent.AddInterfaceRequiredAndConnect((name, trackedBodyName))

        self.GetArmPoseQR = self.ArmBody.GetFunctionQualifiedRead('GetPositionCartesian')
        self.GetArmPoseQR.UpdateFromC();

        self.GetToolPoseQR = self.ToolBody.GetFunctionQualifiedRead('GetPositionCartesian')
        self.GetToolPoseQR.UpdateFromC();

        self.GetBasePoseQR = self.BaseBody.GetFunctionQualifiedRead('GetPositionCartesian')
        self.GetBasePoseQR.UpdateFromC();

 def GetAllPoses(self):
        stateIndex = self.ToolBody.GetTableIndex()
        trTool = self.ConvertPosCartToFrame(self.GetToolPoseQR(stateIndex))
        trArm = self.ConvertPosCartToFrame(self.GetArmPoseQR(stateIndex))
        trBase = self.ConvertPosCartToFrame(self.GetBasePoseQR(stateIndex))
        return trTool, trArm, trBase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants