Google Street View Rotate Camera With Device Gyroscope

google street view camera
google street view 360 video
insta360 street view
google street view virtual tour
google maps street view
360 photo capture is not supported on this device
google earth street view camera
google photosphere

I'm building a mobile app using the Google Maps SDK for iOS and I'm trying to use the mobile device's gyroscope data to pan the camera around a panorama in Street View. I've setup a GMSPanoramaView and a GMSPanoramaCamera with initial positions. I'm using the method -updateCamera on GMSPanoramaView but am unable to smoothly pan across each panorama. If anyone has any idea how I can achieve this feature please let me know. Here is my code so far in the -viewDidLoad portion of my viewcontroller:

if manager.gyroAvailable {
        let queue = NSOperationQueue.mainQueue()
        manager.startGyroUpdatesToQueue(queue, withHandler: { (data, error) -> Void in

            NSOperationQueue.mainQueue().addOperationWithBlock({ () -> Void in
                // Update UI
                let cameraUpdate = GMSPanoramaCameraUpdate.rotateBy((data?.rotationRate.x.radiansToDegrees)!)
                self.panoView.updateCamera(cameraUpdate, animationDuration: 1)
            })
        })
    }

Following code is working in swift 3

if motionManager.isGyroAvailable {
        motionManager.startGyroUpdates(to: OperationQueue.main, withHandler: { (gyroData: CMGyroData?, error: Error?) in
            let y = gyroData!.rotationRate.y
            print("gyrodata: \(y)")
            let cameraUpdate = GMSPanoramaCameraUpdate.rotate(by: -CGFloat((gyroData?.rotationRate.y)!))
            panoView.updateCamera(cameraUpdate, animationDuration: 1)
          })
    }

Camera Motion Metadata Spec, Gyroscope signal in radians/seconds around XYZ axes of the camera. Rotation is positive in the counterclockwise direction. Applications define  I got few phone but all without gyroscope. In all of them, Street View app says: 360 photo capture is not supported on this device. Why gyroscope is a must, are the gravity & compass not re

Working code in Swift 4 (controls both left right and up down so wherever the phone points is where the view will be updated)

import GoogleMaps
import CoreMotion

class ViewController: UIViewController, GMSPanoramaViewDelegate  {

    let motionManager = CMMotionManager()

    override func loadView() {
        let panoView = GMSPanoramaView(frame: .zero)
        panoView.delegate = self
        self.view = panoView

        // you can choose any latitude longitude here, this is my random choice
        panoView.moveNearCoordinate(CLLocationCoordinate2D(latitude: 48.858, longitude: 2.284))

        motionManager.startDeviceMotionUpdates()

        if motionManager.isGyroAvailable {
            motionManager.startGyroUpdates(to: OperationQueue.main, withHandler: { (gyroData: CMGyroData?, error: Error?) in

                // needed to figure out the rotation
                let y = (gyroData?.rotationRate.y)!

                let motion = self.motionManager.deviceMotion

                if(motion?.attitude.pitch != nil) {
                    // calculate the pitch movement (up / down) I subtract 40 just as
                    // an offset to the view so it's more at face level.
                    // the -40 is optional, can be changed to anything.
                    let pitchCamera = GMSPanoramaCameraUpdate.setPitch( CGFloat(motion!.attitude.pitch).radiansToDegrees - 40 )

                    // rotation calculation (left / right)
                    let rotateCamera = GMSPanoramaCameraUpdate.rotate(by: -CGFloat(y) )

                    // rotate camera immediately
                    panoView.updateCamera(pitchCamera, animationDuration: 0)

                    // for some reason, when trying to update camera
                    // immediately after one another, it will fail
                    // here we are dispatching after 1 millisecond for success
                    DispatchQueue.main.asyncAfter(deadline: .now() + 0.0001, execute: {
                        panoView.updateCamera(rotateCamera, animationDuration: 0)
                    })

                }
            })
        }
    }

}


extension BinaryInteger {
    var degreesToRadians: CGFloat { return CGFloat(Int(self)) * .pi / 180 }
}

extension FloatingPoint {
    var degreesToRadians: Self { return self * .pi / 180 }
    var radiansToDegrees: Self { return self * 180 / .pi }
}

And do not forget to put this in your info.plist

Privacy - Motion Usage Description

Add a proper descriptor for why you need this data in the info.plist and that should properly configure your application.

Why 360 photo in Google Street View is supported only in phones , (move device in 8 path to free it). Also: gyroscope has little drift with time (may not affect in this case). Anyway, are these enough reasons to drop  Video resolutions include VGA, HD and Full HD depending on the device Save to your SD card Start/stop video recording using the hardware camera button, or volume buttons. Take photos while recording. Three video quality options to help you manage storage space: High, Medium, Low Three leveling modes include: Flex, the frame is always adjusted for maximum viewport; Rotate, the frame stays fixed; and Locked, the auto-leveling is disabled Other apps can launch Horizon to record a video for them.

I have easy way, in my project i use "CLLocationManagerDelegate" - func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading)

self.locationManager.startUpdatingHeading() // put this line on viewdidload for example

func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) {
    self.panoramaView.animate(to: GMSPanoramaCamera(heading: newHeading.magneticHeading, pitch: newHeading.y, zoom: 1), animationDuration: 0.1)
}

Auto rotation not working - Pixel Phone Community, camera Won't rotate when turning the phone on my pixel 2xl. I suggest trying safe mode to see if it makes a difference and we will go from there. Hold the Tried yt and camera and nothing. With ar The Accelerometer test does pass and the Gyroscope seems to show the same result as well. Google  Instantly see a Google Street View of any supported location. Easily share and save your favourite views.

Street View App gyroscope drifting, Unfortunately I do not know how to make the actual street view app work, but this I have independently tested my device gyroscope and do not see drift but Hi igorguardian, maybe that movement just indicates you to move the camera to  The FOR for each camera has the positive z-axis pointing away from the device into the FOV of the camera along the optical axis, the x-axis points to the right, the y-axis points down from top to bottom, and the origin of the FOR is at the camera’s optical center.

How to use Google Maps Street View on your phone or tablet , How to use Google Maps Street View on your phone or tablet Swipe with one finger in any direction to move your camera view; Tap the arrows including accelerometers and gyroscopes, Street View can leverage them to  No matter where you are located in the world just download this app free from google app and enjoy live camera view. Beach cams and nearby location with views from around the world with best cameras rotate its camera on its edge from home world to far approachable sites.

Sensor Test, Gyroscope - measures the speed of rotation of the device around the three axes x​, y, z; units measurement: For example, in a camera app to create panoramas. Street View, by Google Maps, is a virtual representation of our surroundings on Google Maps, consisting of millions of panoramic images. Street View’s content comes from two sources - Google and

Comments
  • Hi there, any answers about this???