예제 #1
0
 public IEnumerator <ITask> SetDriveSpeedHandler(drive.SetDriveSpeed setDriveSpeed)
 {
     ValidateDriveConfiguration(true);
     _state.TimeStamp = DateTime.Now;
     LogError("Drive speed is not implemented");
     throw new NotImplementedException();
 }
        public IEnumerator <ITask> SetSpeedHandler(diffdrive.SetDriveSpeed setSpeed)
        {
            if (_entity == null)
            {
                throw new InvalidOperationException("Simulation entity not registered with service");
            }

            if (!_state.IsEnabled)
            {
                setSpeed.ResponsePort.Post(Fault.FromException(new Exception("Drive is not enabled.")));
                LogError("SetSpeed request to disabled drive.");
                yield break;
            }

            _entity.SetVelocity(
                (float)setSpeed.Body.LeftWheelSpeed,
                (float)setSpeed.Body.RightWheelSpeed);

            UpdateStateFromSimulation();
            setSpeed.ResponsePort.Post(DefaultUpdateResponseType.Instance);

            // send update notification for entire state
            _subMgrPort.Post(new submgr.Submit(_state, DsspActions.UpdateRequest));
            yield break;
        }
예제 #3
0
 public IEnumerator <ITask> SetDriveSpeedHandler(drive.SetDriveSpeed setDriveSpeed)
 {
     LogError("Drive speed is not implemented");
     yield break;
 }
예제 #4
0
 public virtual IEnumerator <ITask> SetDriveSpeedHandler(drive.SetDriveSpeed update)
 {
     // TODO: Implement SetDriveSpeed operation here.
     throw new NotImplementedException("SetDriveSpeed is not Implemented.");
 }