[IGSTK-Users] State machine error in Landmark3DRegistration

Vincent Gratsac vincent.gratsac at irisa.fr
Tue Jan 19 06:31:36 EST 2010


Hi all,

Our application uses the Landmark3DRegistration class. A critical errar 
occurs when trying to reset it (by calling RequestReset()) :

> 2010 janv. 19 11:20:13  :    (CRITICAL) In class 
> Landmark3DRegistration Error: attempt to invoke SelectInitialState()  
> but the machine is ready to go  There is no reason for invoking 
> SelectInitialState() after  SetReadyToRun(). Something should be wrong 
> in the logic of your state machine programming.

When looking at the igstLandmark3DRegistration.cxx file, there is a call 
to SelectInitialState() which should probably not be there.
> /* The "ResetRegsitration" method empties the landmark point
> containers to start the process again */
> void 
> Landmark3DRegistration::ResetRegistrationProcessing()
> {
>   igstkLogMacro( DEBUG, "igstk::Landmark3DRegistration::"
>                  "ResetRegistrationProcessing called...\n");
>
>   //Empty the image and tracker landmark containers
>   while( m_ImageLandmarks.size() > 0 )
>     {
>     m_ImageLandmarks.pop_back();
>     }
>   while( m_TrackerLandmarks.size() > 0 )
>     {
>     m_TrackerLandmarks.pop_back();
>     }
>
>   //Reset the transform
>   TransformType::ParametersType parameters ( 
>                                m_Transform->GetNumberOfParameters() );
>
>   parameters[0] = 0.0;
>   parameters[1] = 0.0;
>   parameters[2] = 1.0;
>   parameters[3] = 0.0;
>   parameters[4] = 0.0;
>   parameters[5] = 0.0;
>
>   m_Transform->SetParameters( parameters );
>   
>   m_StateMachine.SelectInitialState( m_IdleState );
> }
I think that this is a bug, but fortunately, it has no impact on the use 
of this class.

Regards,

Vincent Gratsac






More information about the IGSTK-Users mailing list