mapbox / mapbox-vision-android

Other
50 stars 43 forks source link

Asking for support of portrait in AR navigation #257

Open wangchongyu opened 3 years ago

wangchongyu commented 3 years ago

Currently, the supported screenOrientation by default for AR navigation use case is sensorLandscape. In our use case, we really need this to support portrait mode during AR navigation. However, if I change screenOrientation="sensorPortrait" as shown below, the SDK will give me errors: E/Vision-Encoder: Not handling orientation = 0 in encoder E/Vision-Camera2: Sensor orientation 0 is not supported And the camera will not event turn on at all.

<application>
        ...
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ArActivity"
            android:screenOrientation="sensorPortrait">
        </activity>
        ...
 </application>

I would like to ask if the Mapbox vision SDK has any plan to support portrait use case? Or if there is any workaround to allow me to use the AR navigation work on portrait mode? Thanks.

yunikkk commented 3 years ago

Hey @wangchongyu, unfortunately this is not supported now. Could you describe your use case a little bit?

wangchongyu commented 3 years ago

Hi @yunikkk, thanks for the reply. We are actually trying to build a GPS based outdoor AR navigation App specifically for walking instead of driving cases.

Similar to Google's AR walking directions below: Screenshot 2020-09-23 at 17 18 17

Basically, the expected use case would be:

  1. The user wants to go from location A to B by walking
  2. User launch the app, select the origin and destination on the 2D map
  3. Base on the coords selected, a route would be generated by Mapbox directions API
  4. By clicking a button on the Map, it launches the AR camera with some arrows displayed on the surface of the real world path
  5. The app suppose to track and update the user's location, and keeps showing the arrows on the path to provide a turn-by-turn direction experience for the user until he/she reaches the destination
  6. Since it is for walking users, the whole process is required in portrait mode.

From the example project, I have managed to perform most of the above steps except making it work on the portrait mode.

yunikkk commented 3 years ago

@wangchongyu unfortunately, currently Vision won't support such operation mode. It requires fixed mount in the car, walking with the device in hands won't allow us to calibrate camera (hence calculate objects positions correctly)