public void SetCommand(double?engineTorque, double?brakePressue, double?steering, TransmissionGear?gear)
        {
            if (Settings.TestMode)
            {
                return;
            }

            if (steering.HasValue && Math.Abs(steering.Value) > TahoeParams.SW_max)
            {
                OperationalTrace.WriteWarning("steering out of range: received {0}, limit {1}", steering.Value, TahoeParams.SW_max);
            }

            //Console.WriteLine("command--steering: {0}, torque: {1}, brake: {2}, gear: {3}", steering, engineTorque, brakePressue, gear);

            try {
                dynamicsSim.SetSteeringBrakeThrottle(steering, engineTorque, brakePressue);

                if (gear.HasValue)
                {
                    dynamicsSim.SetTransmissionGear(gear.Value);
                }
            }
            catch (SocketException) {
                // get the DynamicsSimFacade
                dynamicsSim = (DynamicsSimFacade)CommBuilder.GetObject(DynamicsSimFacade.ServiceName);
                throw;
            }
        }
        public FullSimTransport()
        {
            // initialize the car mode to unknown so that we raised the changed event immediately
            lastCarMode = CarMode.Unknown;

            // get the DynamicsSimFacade
            dynamicsSim = (DynamicsSimFacade)CommBuilder.GetObject(DynamicsSimFacade.ServiceName);

            // set the sim state channel
            simStateChannel = CommBuilder.GetChannel(OperationalSimVehicleState.ChannelName);
            obstacleChannel = CommBuilder.GetChannel(SceneEstimatorObstacleChannelNames.UntrackedClusterChannelName);
            vehicleChannel = CommBuilder.GetChannel(SceneEstimatorObstacleChannelNames.TrackedClusterChannelName);
            // add ourself as a listern
            simStateChannel.Subscribe(this);
            obstacleChannel.Subscribe(this);
            vehicleChannel.Subscribe(this);
        }
        public FullSimTransport()
        {
            // initialize the car mode to unknown so that we raised the changed event immediately
            lastCarMode = CarMode.Unknown;

            // get the DynamicsSimFacade
            dynamicsSim = (DynamicsSimFacade)CommBuilder.GetObject(DynamicsSimFacade.ServiceName);

            // set the sim state channel
            simStateChannel = CommBuilder.GetChannel(OperationalSimVehicleState.ChannelName);
            obstacleChannel = CommBuilder.GetChannel(SceneEstimatorObstacleChannelNames.UntrackedClusterChannelName);
            vehicleChannel  = CommBuilder.GetChannel(SceneEstimatorObstacleChannelNames.TrackedClusterChannelName);
            // add ourself as a listern
            simStateChannel.Subscribe(this);
            obstacleChannel.Subscribe(this);
            vehicleChannel.Subscribe(this);
        }
        public void SetCommand(double? engineTorque, double? brakePressue, double? steering, TransmissionGear? gear)
        {
            if (Settings.TestMode)
                return;

            if (steering.HasValue && Math.Abs(steering.Value) > TahoeParams.SW_max) {
                OperationalTrace.WriteWarning("steering out of range: received {0}, limit {1}", steering.Value, TahoeParams.SW_max);
            }

            //Console.WriteLine("command--steering: {0}, torque: {1}, brake: {2}, gear: {3}", steering, engineTorque, brakePressue, gear);

            try {
                dynamicsSim.SetSteeringBrakeThrottle(steering, engineTorque, brakePressue);

                if (gear.HasValue) {
                    dynamicsSim.SetTransmissionGear(gear.Value);
                }
            }
            catch (SocketException) {
                // get the DynamicsSimFacade
                dynamicsSim = (DynamicsSimFacade)CommBuilder.GetObject(DynamicsSimFacade.ServiceName);
                throw;
            }
        }