internal void ArduinoBrickOdometryChanged(RobotAbstraction.IHardwareComponent sender) { IOdometry odom = (IOdometry)sender; //odom.XMeters; //odom.YMeters; //odom.ThetaRadians; lock (currentSensorsDataLock) { SensorsDataPlucky sensorsData = new SensorsDataPlucky(this.currentSensorsData); sensorsData.WheelEncoderLeftTicks = odom.LDistanceTicks; sensorsData.WheelEncoderRightTicks = odom.RDistanceTicks; //Debug.WriteLine(sensorsData.ToString()); this.currentSensorsData = sensorsData; } }
internal void ArduinoBrickGpsChanged(RobotAbstraction.IHardwareComponent sender) { IGps gps = (IGps)sender; lock (currentSensorsDataLock) { SensorsDataPlucky sensorsData = new SensorsDataPlucky(this.currentSensorsData); sensorsData.GpsLatitude = gps.Latitude; sensorsData.GpsLongitude = gps.Longitude; sensorsData.GpsAltitude = gps.Altitude; sensorsData.GpsNsat = gps.GpsNsat; sensorsData.GpsHdop = gps.GpsHdop; sensorsData.FixAgeMs = gps.FixAgeMs; sensorsData.GpsTimeUTC = gps.TimeUTC; sensorsData.GpsFixType = gps.FixType; //Debug.WriteLine(sensorsData.ToString()); this.currentSensorsData = sensorsData; } }