Exemplo n.º 1
0
        public static AirSimQuaternion ToAirSimQuaternion(Quaternion src)
        {
            AirSimQuaternion quat = new AirSimQuaternion();

            SetToAirSim(src, ref quat);
            return(quat);
        }
Exemplo n.º 2
0
        public static Quaternion ToUnityQuaternion(AirSimQuaternion src)
        {
            Quaternion quat = new Quaternion();

            SetToUnity(src, ref quat);
            return(quat);
        }
Exemplo n.º 3
0
 public bool SetCameraOrientation(string cameraName, AirSimQuaternion orientation)
 {
     foreach (DataCaptureScript capture in captureCameras)
     {
         if (capture.GetCameraName() == cameraName)
         {
             capture.SetOrientation(orientation);
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 4
0
 public void reset()
 {
     image_uint_len          = 0;
     image_float_len         = 0;
     image_data_uint         = new byte[] { };
     image_data_float        = new float[] { };
     this.camera_position    = new AirSimVector();
     this.camera_orientation = new AirSimQuaternion();
     this.pixels_as_float    = false;
     this.compress           = false;
     this.width      = 0;
     this.height     = 0;
     this.image_type = ImageType.Scene;
 }
Exemplo n.º 5
0
 public ImageResponse(string cameraName)
 {
     image_uint_len     = 0;
     image_data_uint    = null;
     image_float_len    = 0;
     image_data_float   = null;
     camera_position    = new AirSimVector(0, 0, 0);
     camera_orientation = new AirSimQuaternion(0, 0, 0, 0);
     pixels_as_float    = false;
     compress           = false;
     width      = 0;
     height     = 0;
     image_type = 0;
 }
Exemplo n.º 6
0
        public ImageResponse(List <byte> imageDataInt, List <float> imageDataFloat, string cameraName,
                             AirSimVector camera_position, AirSimQuaternion camera_orientation,
                             bool pixels_as_float, bool compress, int width, int height, ImageType image_type)
        {
            if (imageDataInt == null)
            {
                image_uint_len = 0;
            }
            else
            {
                image_uint_len = imageDataInt.Count;
            }

            image_data_uint = new byte[image_uint_len];
            if (image_uint_len > 0)
            {
                imageDataInt.CopyTo(image_data_uint);
            }

            if (imageDataFloat == null)
            {
                image_float_len = 0;
            }
            else
            {
                image_float_len = imageDataFloat.Count;
            }

            image_data_float = new float[image_float_len];

            if (image_float_len > 0)
            {
                imageDataFloat.CopyTo(image_data_float);
            }

            this.camera_position    = camera_position;
            this.camera_orientation = camera_orientation;
            this.pixels_as_float    = pixels_as_float;
            this.compress           = compress;
            this.width      = width;
            this.height     = height;
            this.image_type = image_type;
        }
Exemplo n.º 7
0
 public void SetOrientation(AirSimQuaternion orientation)
 {
     DataManager.SetToUnity(orientation, ref poseFromAirLib);
     isPoseOverride = true;
 }
Exemplo n.º 8
0
 public void DefaultInitialization()
 {
     Rotation = new AirSimQuaternion(0, 0, 0, 1);
     Position = new AirSimVector(0, 0, 0);
     Scale3D  = new AirSimVector(1, 1, 1);
 }
Exemplo n.º 9
0
 public UnityTransform(AirSimQuaternion rotation, AirSimVector position, AirSimVector scale3d)
 {
     Rotation = rotation;
     Position = position;
     Scale3D  = scale3d;
 }
Exemplo n.º 10
0
 public GeoPose(AirSimQuaternion orientation, GeoPoint position)
 {
     this.orientation = orientation;
     this.position    = position;
 }
Exemplo n.º 11
0
 public AirSimPose(AirSimVector position, AirSimQuaternion orientation)
 {
     this.position    = position;
     this.orientation = orientation;
 }
Exemplo n.º 12
0
 public static void SetToAirSim(Quaternion src, ref AirSimQuaternion dst)
 {
     dst.Set(src.z, -src.x, -src.y, src.w);
 }
Exemplo n.º 13
0
 public static void SetToUnity(AirSimQuaternion src, ref Quaternion dst)
 {
     dst.Set(-src.y, src.z, -src.x, src.w);
 }
Exemplo n.º 14
0
        private static bool SetCameraOrientation(string cameraName, AirSimQuaternion orientation, string vehicleName)
        {
            var vehicle = Vehicles.Find(element => element.vehicleName == vehicleName);

            return(vehicle.VehicleInterface.SetCameraOrientation(cameraName, orientation));
        }