Exemple #1
0
 public static string getMessageTextFromState(DroneState state)
 {
     return(formatStringForMessage(
                state.getPitch(), state.getRoll(), state.getYaw(),
                state.getSpeedX(), state.getSpeedY(), state.getSpeedZ(),
                state.getLowTemperature(), state.getHighTemperature(),
                state.getFlightDistance(), state.getHeight(),
                state.getBatteryPercentage(), state.getBarometerMeasurement(),
                state.getMotorTime(), state.getAccelerationX(),
                state.getAccelerationY(), state.getAccelerationZ()
                ));
 }
Exemple #2
0
//		public Status(int pitch, int roll, int yaw, int speedX, int speedY, int speedZ,
//			int lowTemperature, int highTemperature, int flightDistance, int height,
//			int batteryPercentage, double barometerMeasurement, int motorTime,
//			double accelerationX, double accelerationY, double accelerationZ)
        public Status(DroneState state) : base(getMessageTextFromState(state))
        {
            pitch                = state.getPitch();
            roll                 = state.getRoll();
            yaw                  = state.getYaw();
            speedX               = state.getSpeedX();
            speedY               = state.getSpeedY();
            speedZ               = state.getSpeedZ();
            lowTemperature       = state.getLowTemperature();
            highTemperature      = state.getHighTemperature();
            flightDistance       = state.getFlightDistance();
            height               = state.getHeight();
            batteryPercentage    = state.getBatteryPercentage();
            barometerMeasurement = state.getBarometerMeasurement();
            motorTime            = state.getMotorTime();
            accelerationX        = state.getAccelerationX();
            accelerationY        = state.getAccelerationY();
            accelerationZ        = state.getAccelerationZ();
        }