void InsertEntityNotificationHandler(InsertSimulationEntity ins)
        {
            _entity = (SonarEntity)ins.Body;
            _entity.ServiceContract = Contract.Identifier;

            // CreateDefaultState();

            RaycastProperties raycastProperties = new RaycastProperties();

            raycastProperties.StartAngle     = (float)-_state.AngularRange / 2.0f;
            raycastProperties.EndAngle       = (float)_state.AngularRange / 2.0f;
            raycastProperties.AngleIncrement = (float)_state.AngularResolution;
            // raycastProperties.Range = LASER_RANGE;
            raycastProperties.Range = SONAR_RANGE;
            // Raul - This should be the pose of the sonar transducer.
            // Raul - I consider 8 Sonar transducers rays in the P3DX frontal ring
            // Raul - coming from a common central point.
            raycastProperties.OriginPose = new Pose();

            _entity.RaycastProperties = raycastProperties;
            _entity.Register(_raycastResults);

            // attach handler to raycast results port
            Activate(Arbiter.Receive(true, _raycastResults, RaycastResultsHandler));
        }
        void InsertEntityNotificationHandler(InsertSimulationEntity ins)
        {
            _entity = (SonarEntity)ins.Body;
            _entity.ServiceContract = Contract.Identifier;

            // CreateDefaultState();

            RaycastProperties raycastProperties = new RaycastProperties();            
            raycastProperties.StartAngle = (float) -_state.AngularRange / 2.0f;
            raycastProperties.EndAngle = (float) _state.AngularRange / 2.0f;
            raycastProperties.AngleIncrement = (float)_state.AngularResolution;
            // raycastProperties.Range = LASER_RANGE;
            raycastProperties.Range = SONAR_RANGE;
            // Raul - This should be the pose of the sonar transducer.
            // Raul - I consider 8 Sonar transducers rays in the P3DX frontal ring
            // Raul - coming from a common central point.
            raycastProperties.OriginPose = new Pose();

            _entity.RaycastProperties = raycastProperties;
            _entity.Register(_raycastResults);

            // attach handler to raycast results port
            Activate(Arbiter.Receive(true, _raycastResults, RaycastResultsHandler));
        }
 void DeleteEntityNotificationHandler(DeleteSimulationEntity del)
 {
     _entity = null;
 }
 void DeleteEntityNotificationHandler(DeleteSimulationEntity del)
 {
     _entity = null;
 }