isl-org / OpenBot

OpenBot leverages smartphones as brains for low-cost robots. We have designed a small electric vehicle that costs about $50 and serves as a robot body. Our software stack for Android smartphones supports advanced robotics workloads such as person following and real-time autonomous navigation.
https://www.openbot.org
MIT License
2.82k stars 529 forks source link

Mirror the target control of ObjectNavFragment if front facing camera is used #386

Closed yijunwu closed 9 months ago

yijunwu commented 10 months ago

When front facing camera is used, the target control of ObjectNavFragment should be mirrored otherwise the bot can't follow the target object. See the issue 385 for detail

thias15 commented 9 months ago

The convention for the front camera varies across phones. How about adding an icon to mirror controls next to the camera flip icon.

yijunwu commented 9 months ago

OK, I haven't tried phones other than Samsung's. Maybe a better solution would be to detect the convention for the phone automatically, and set default value accordingly, in addition to adding icon to mirror control? Not sure if it's detectable. Before figuring out that, adding icon to mirror control can be a basic solution. I'll add some more commits soon

yijunwu commented 9 months ago

I've added more commits. It should be ok now. image image

yijunwu commented 9 months ago

I adjusted the layout and appearance of icons, now it looks like this: 6830d259c0e1cca88ef2e2368520496 fa1deaea6ead352cafed02663e759dd

hardikgarg02 commented 9 months ago

I have fixed the UI for the fragment. Could you review and replace below file named fragment_object_nav.xml in the path robot/src/main/res/layout-land directory. fragment_object_nav.xml.zip

And also replace below file named fragment_object_nav.xml in the path robot/src/main/res/layout directory. fragment_object_nav.xml.zip