Example #1
0
        //Ensure to call this method as the last statement, from derived class `LateUpdate()` method.
        protected void LateUpdate()
        {
            if (isServerStarted)
            {
                if (isSegmentationUpdated)
                {
                    UpdateSegmentationView();
                    isSegmentationUpdated = false;
                }

                if (isCapturingImages)
                {
                    var captureCamera = captureCameras.Find(element => element.GetCameraName() == imageRequest.camera_name);
                    imageResponse = captureCamera.GetImageBasedOnRequest(imageRequest);
                    captureResetEvent.Set(); //Release the GetSimulationImages thread with the image response.
                    isCapturingImages = false;
                }

                if (calculateRayCast)
                {
                    hitResult        = Physics.Linecast(startVec, endVec, out hitInfo);
                    calculateRayCast = false;
                }

                airsimInterface.InvokeTickInAirSim(Time.deltaTime);
            }
        }
Example #2
0
        //Ensure to call this method as the last statement, from derived class `LateUpdate()` method.
        protected void LateUpdate()
        {
            if (isServerStarted)
            {
                if (timeScale_changed)
                {
                    Time.timeScale    = time_scale;
                    timeScale_changed = false;
                }

                if (isSegmentationUpdated)
                {
                    UpdateSegmentationView();
                    isSegmentationUpdated = false;
                }

                if (isCapturingImages)
                {
                    var captureCamera = captureCameras.Find(element => element.GetCameraName() == imageRequest.camera_name);
                    imageResponse = captureCamera.GetImageBasedOnRequest(imageRequest);
                    captureResetEvent.Set(); //Release the GetSimulationImages thread with the image response.
                    isCapturingImages = false;
                }

                if (calculateRayCast)
                {
                    hitResult        = Physics.Linecast(startVec, endVec, out hitInfo);
                    calculateRayCast = false;
                }

                if (Input.GetKeyDown(KeyCode.T))
                {
                    print_log_messages_ = !print_log_messages_;
                }

                if (count > 10)
                {
                    count = 0;
                    foreach (var p in captureCameras)
                    {
                        string camera       = p.GetCameraName();
                        var    imageRequest = new ImageRequest(camera, ImageType.Scene, false, false);

                        imageResponse = p.GetImageBasedOnRequest(imageRequest);
                        PInvokeWrapper.StoreVehicleImage(vehicle_name, camera, imageResponse);
                    }
                }
                count++;
                // Update images



                airsimInterface.InvokeTickInAirSim(Time.deltaTime);     //TODOME check this
            }
        }
Example #3
0
        private void LateUpdate()
        {
            if (count > 5)
            {
                count = 0;
                foreach (var p in captureCameras)
                {
                    string camera       = p.GetCameraName();
                    var    imageRequest = new ImageRequest(camera, ImageType.Scene, false, false);

                    imageResponse = p.GetImageBasedOnRequest(imageRequest);
                    PInvokeWrapper.StorePedestrianImage(pedestrian_name, camera, imageResponse);
                }
            }
            count++;
        }
Example #4
0
        //Ensure to call this method as the last statement, from derived class `LateUpdate()` method.
        protected void LateUpdate()
        {
            if (isServerStarted)
            {
                if (timeScale_changed)
                {
                    Time.timeScale    = time_scale;
                    timeScale_changed = false;
                }

                if (isSegmentationUpdated)
                {
                    UpdateSegmentationView();
                    isSegmentationUpdated = false;
                }

                if (isCapturingImages)
                {
                    var captureCamera = captureCameras.Find(element => element.GetCameraName() == imageRequest.camera_name);
                    imageResponse = captureCamera.GetImageBasedOnRequest(imageRequest);
                    captureResetEvent.Set(); //Release the GetSimulationImages thread with the image response.
                    isCapturingImages = false;
                }

                if (calculateRayCast)
                {
                    hitResult        = Physics.Linecast(startVec, endVec, out hitInfo);
                    calculateRayCast = false;
                }

                /*
                 * if (Input.GetKeyDown(KeyCode.T))
                 * {
                 *  print_log_messages_ = !print_log_messages_;
                 * }*/
            }
        }
 public static extern void StorePedestrianImage(string pedetrian_name, string camera_name, ImageResponse image);
 public static extern void StoreVehicleImage(string vehicle_name, string camera_name, ImageResponse image);