Hi Ameet,<div><br></div><div>Observer will not be updated if Aurora tool goes 'out of volume'.</div><div><br></div><div>You can check the validity of the time stamp to verify that:</div><div><br></div><div><div> igstk::Transform transform = transformObserver->GetTransform();</div>
<div> if( !transform.IsValidNow() )</div><div> {</div><div> // Invalid transforms</div><div> {</div><div><br></div><div><br></div>Patrick</div><div><br><div class="gmail_quote">On Tue, Jul 26, 2011 at 2:49 PM, Jain, Ameet <span dir="ltr"><<a href="mailto:ameet.jain@philips.com">ameet.jain@philips.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Thanks for your email Patrick. However, this did not solve the issue. Seems like the observer is not getting updated for some reason. It continues to report the same value.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Do you know if the observer gets updated if the Aurora tool goes ‘out of volume’?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Ameet<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><u></u> <u></u></span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> Patrick Cheng [mailto:<a href="mailto:patrick.p.cheng@gmail.com" target="_blank">patrick.p.cheng@gmail.com</a>] <br>
<b>Sent:</b> Monday, July 25, 2011 11:03 AM<br><b>To:</b> Jain, Ameet<br><b>Cc:</b> <a href="mailto:igstk-users@public.kitware.com" target="_blank">igstk-users@public.kitware.com</a><br><b>Subject:</b> Re: [IGSTK-Users] EM tracking giving the same readings<u></u><u></u></span></p>
</div><div><div></div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Hi Ameet,<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The code spinet you provided is probably not complete. The while loop doesn't seem to be correct.<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Try use this workflow:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">loop{<u></u><u></u></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div><p class="MsoNormal"> observer->Clear();<u></u><u></u></p></div><div><p class="MsoNormal"> trackerTool->RequestGetTransformToParent();<u></u><u></u></p>
</div><div><p class="MsoNormal"> if (observer->GotTransform())<u></u><u></u></p></div><div><p class="MsoNormal"> {<u></u><u></u></p></div><div><p class="MsoNormal"> ... <u></u><u></u></p></div><div><p class="MsoNormal">
}<u></u><u></u></p></div><div><p class="MsoNormal"> else<u></u><u></u></p></div><div><p class="MsoNormal"> {<u></u><u></u></p></div><div><p class="MsoNormal"> ...<u></u><u></u></p></div><div><p class="MsoNormal">
}<u></u><u></u></p></div><div><p class="MsoNormal"> }<u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Let me know how it goes,<u></u><u></u></p></div><div><p class="MsoNormal">
<u></u> <u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">Patrick<u></u><u></u></p><div><p class="MsoNormal">On Fri, Jul 22, 2011 at 3:52 PM, Jain, Ameet <<a href="mailto:ameet.jain@philips.com" target="_blank">ameet.jain@philips.com</a>> wrote:<u></u><u></u></p>
<div><div><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Hi all,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D">I am having an issue in trying to use IGSTK for EM tracking a large tool with multiple 5DOFs. It starts to track the sensors alright, but then after some point it starts giving me the same tracked information for all sensors - i.e. it repeats the previous value continuously for hours. My feeling is that it gets a ‘bad fit’ at some point and then the sensor location does not get updated after that. </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">The code where I update the tracking info for each tool is below. Do you think this is not the correct way to implement the update?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">auroraTrackerTool[i]->RequestGetTransformToParent();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">while(!TransformObserver[i]->GotTransform());</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::Transform transform = TransformObserver[i]->GetTransform();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::Transform::VectorType t = transform.GetTranslation();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::Transform::VersorType r = transform.GetRotation();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Your help is much appreciated,</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D">Thanks a lot in advance,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Ameet Jain</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><b><u><span style="font-size:11.0pt;color:#1F497D">PS: The code for initialization of the Aurora is below, in case you see some error there</span></u></b><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::SerialCommunication::PortNumberType AURORAPORT = (igstk::SerialCommunication::PortNumberType)6; </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::SerialCommunication::Pointer serialCommAurora;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::AuroraTracker::Pointer tracker;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::AuroraTrackerTool::Pointer auroraTrackerTool[16];</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">igstk::TransformObserver::Pointer TransformObserver[16]; </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">void openauroraport()</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">{</span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D"> serialCommAurora = igstk::SerialCommunication::New(); </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> serialCommAurora->SetPortNumber( AURORAPORT );</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> serialCommAurora->SetParity( igstk::SerialCommunication::NoParity );</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> serialCommAurora->SetBaudRate( igstk::SerialCommunication::BaudRate115200 );</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> serialCommAurora->SetDataBits( igstk::SerialCommunication::DataBits8 );</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> serialCommAurora->SetStopBits( igstk::SerialCommunication::StopBits1 );</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> serialCommAurora->SetHardwareHandshake( igstk::SerialCommunication::HandshakeOff );</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> serialCommAurora->OpenCommunication();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> tracker = igstk::AuroraTracker::New();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> std::cout << "SetCommunication()" << std::endl;</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> tracker->SetCommunication( serialCommAurora );</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> std::cout << "RequestOpen()" << std::endl;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> tracker->RequestOpen();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> for (int count_port = 0; count_port < 4; count_port++){</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port] = igstk::AuroraTrackerTool::New();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port]->RequestSelect5DOFTrackerTool();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port]->RequestSetPortNumber( count_port );</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port]->RequestSetChannelNumber( 0 );</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port]->RequestConfigure();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port]->RequestAttachToTracker( tracker );</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port + 1] = igstk::AuroraTrackerTool::New();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port + 1]->RequestSelect5DOFTrackerTool();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port + 1]->RequestSetPortNumber( count_port );</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port + 1]->RequestSetChannelNumber( 1 );</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port + 1]->RequestConfigure();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> auroraTrackerTool[2*count_port + 1]->RequestAttachToTracker( tracker );</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> std::cout << "Initialized Port" << count_port << std::endl;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> }</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> for (int count_port = 0; count_port < 4; count_port++){</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> TransformObserver[2*count_port] = igstk::TransformObserver::New();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> TransformObserver[2*count_port]->ObserveTransformEventsFrom(auroraTrackerTool[2*count_port]);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> TransformObserver[2*count_port + 1] = igstk::TransformObserver::New();</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> TransformObserver[2*count_port + 1]->ObserveTransformEventsFrom(auroraTrackerTool[2*count_port + 1]);</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> std::cout << "Assigned Observer" << count_port << std::endl;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> }</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal">
<span style="font-size:11.0pt;color:#1F497D"> tracker->RequestStartTracking();</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> std::cout << "Requested Tracking" << std::endl;</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">}</span><u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p>
<div class="MsoNormal" align="center" style="text-align:center"><hr size="2" width="100%" align="center"></div><p class="MsoNormal"><span style="font-size:7.5pt;color:gray">The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.</span><u></u><u></u></p>
</div><p class="MsoNormal"><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users</a><u></u><u></u></p>
</div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></blockquote></div><br></div>