Esempio n. 1
0
        public static Vector3 ToUnityVector(AirSimVector src)
        {
            Vector3 vector = new Vector3();

            SetToUnity(src, ref vector);
            return(vector);
        }
Esempio n. 2
0
        public static AirSimVector ToAirSimVector(Vector3 src)
        {
            AirSimVector vector = new AirSimVector();

            SetToAirSim(src, ref vector);
            return(vector);
        }
Esempio n. 3
0
 public void SetDefaultValues()
 {
     has_collided      = false;
     normal            = new AirSimVector(0, 0, 0);
     impact_point      = new AirSimVector(0, 0, 0);
     position          = new AirSimVector(0, 0, 0);
     penetration_depth = 0;
     time_stamp        = 0;
     collision_count   = 0;
     object_name       = "none";
     object_id         = -1;
 }
Esempio 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;
 }
Esempio 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;
 }
Esempio n. 6
0
        public RayCastHitResult GetRayCastHit(AirSimVector start, AirSimVector end)
        {
            DataManager.SetToUnity(start, ref startVec);
            DataManager.SetToUnity(end, ref endVec);

            calculateRayCast = true;
            int count = 500; // wait for max 0.5 second

            while (calculateRayCast && count > 0)
            {
                count--;
            }

            return(new RayCastHitResult(hitResult, hitInfo.distance));
        }
Esempio n. 7
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;
        }
Esempio 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);
 }
Esempio n. 9
0
 public UnityTransform(AirSimQuaternion rotation, AirSimVector position, AirSimVector scale3d)
 {
     Rotation = rotation;
     Position = position;
     Scale3D  = scale3d;
 }
Esempio n. 10
0
 public Accelerations(AirSimVector linear, AirSimVector angular)
 {
     this.linear  = linear;
     this.angular = angular;
 }
Esempio n. 11
0
 public Twist(AirSimVector linear, AirSimVector angular)
 {
     this.linear  = linear;
     this.angular = angular;
 }
Esempio n. 12
0
 public AirSimPose(AirSimVector position, AirSimQuaternion orientation)
 {
     this.position    = position;
     this.orientation = orientation;
 }
Esempio n. 13
0
 public static void SetToAirSim(Vector3 src, ref AirSimVector dst)
 {
     dst.Set(src.z, src.x, -src.y);
 }
Esempio n. 14
0
 public static void SetToUnity(AirSimVector src, ref Vector3 dst)
 {
     dst.Set(src.y, -src.z, src.x);
 }
        private static RayCastHitResult GetRayCastHit(AirSimVector start, AirSimVector end, string vehicleName)
        {
            var vehicle = Vehicles.Find(element => element.vehicleName == vehicleName);

            return(vehicle.VehicleInterface.GetRayCastHit(start, end));
        }