public OperationalSpeedCommand GetSpeedCommand()
        {
            OperationalVehicleState vs  = Services.StateProvider.GetVehicleState();
            OperationalSpeedCommand cmd = new OperationalSpeedCommand();

            cmd.brakePressure = TahoeParams.brake_hold;
            cmd.engineTorque  = 0;

            if (result != CompletionResult.Failed)
            {
                if (phase == Phase.Braking)
                {
                    // chek if we can transition to shifting
                    if (Math.Abs(vs.speed) < 0.05 && vs.brakePressure >= TahoeParams.brake_hold - 1)
                    {
                        phase = Phase.Shifting;
                    }
                }

                if (phase == Phase.Shifting)
                {
                    cmd.transGear = gear;

                    if (vs.transGear == gear)
                    {
                        result = CompletionResult.Completed;
                    }
                }
            }

            return(cmd);
        }
        public OperationalSpeedCommand GetSpeedCommand()
        {
            OperationalVehicleState vs = Services.StateProvider.GetVehicleState();
            OperationalSpeedCommand cmd = new OperationalSpeedCommand();
            cmd.brakePressure = TahoeParams.brake_hold;
            cmd.engineTorque = 0;

            if (result != CompletionResult.Failed) {
                if (phase == Phase.Braking) {
                    // chek if we can transition to shifting
                    if (Math.Abs(vs.speed) < 0.05 && vs.brakePressure >= TahoeParams.brake_hold-1) {
                        phase = Phase.Shifting;
                    }
                }

                if (phase == Phase.Shifting) {
                    cmd.transGear = gear;

                    if (vs.transGear == gear) {
                        result = CompletionResult.Completed;
                    }
                }
            }

            return cmd;
        }