Skip to content

Android: Pick the point-goal on screen instead of typing distances - #563

Open
harishthakur52 wants to merge 3 commits into
ob-f:masterfrom
3dwesupport:android/point-goal-nav
Open

harishthakur52 wants to merge 3 commits into
ob-f:masterfrom
3dwesupport:android/point-goal-nav

Conversation

@harishthakur52

Copy link
Copy Markdown
Contributor

The point-goal is now set by tapping the floor in the camera view instead of typing distances.

  • Distance is worked out from the camera height above the floor: height / tan(angle below the horizon)
  • Taps on a wall or window are rejected, because their ray never meets the floor
  • The goal stays fixed in the world, so it doesn't drift
  • The robot stops at the goal, or when it passes it, so it doesn't circle

@thias15 thias15 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @harishthakur52, tapping the goal works much better than typing distances, and the stop on finger-down and the safety timer are great additions.

One fix before merging:

  • Safety timer: onArCoreUpdate sets lastNavUpdateMs before it drops frames older than 100 ms. If every frame is late, no new command is sent but the timer keeps being reset, so the robot drives on with its last command. Please set it only after a command was sent, the way the iOS version handles skipped frames.

Camera height:

  • Please don't save the measured height between sessions; the phone may be mounted differently next time. Start each session from the body the robot reports when it connects (vehicle.getVehicleType()), and use the live measurement once the floor is found. Starting heights, worked out from the CAD files and photos (about ±3 cm):

    Body Height
    RTR_520 0.16 m
    RC_CAR 0.22 m
    MTV 0.23 m
    everything else 0.12 m

Smaller things:

  • The safety-timer thread is started in onViewCreated but only quit in onDestroy, so going back and forth to the screen leaves extra threads. Start it in onCreate, or quit it in onDestroyView.
  • A tap while ARCore isn't tracking is kept and placed later without a message. Better to reject it with a hint.

@thias15

thias15 commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Tested the Android app. For me it does not even open, crashes instantly. So unable to test.

@harishthakur52

Copy link
Copy Markdown
Contributor Author

Tested the Android app. For me it does not even open, crashes instantly. So unable to test.

@thias15 have you added your own google-services.json in robot/android/app/? The repo only has a dummy one, and with the dummy file the app crashes at startup. With a real one it opens fine. Please let me know if it still crashes.

Also, please send me the device name you are testing on.

@thias15

thias15 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

I just downloaded the one being built from artifact. Shouldn't this have everything? Using Samsung s22 ultra

@harishthakur52

Copy link
Copy Markdown
Contributor Author

I just downloaded the one being built from artifact. Shouldn't this have everything? Using Samsung s22 ultra

The PR artifact is built without the real google-services.json, so it crashes at launch. Once the fixes are merged, the next release will include it. In the meantime, we’ve shared the same APK with the real credentials on Slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants