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.77k stars 513 forks source link

ObjectNavSegment control result should be mirrored when using front facing camera #385

Closed yijunwu closed 6 months ago

yijunwu commented 7 months ago

Description Currently, in ObjectNavSegment, when using front facing camera of the phone, the vehicle's target control is incorrect. When the object is at the vehicle's left front, it turns to right, and vice versa. Currently, in order for the bot to do object nav correctly, one has to put the phone upside down, but consequently the controling UI is upside down too, which is inconvienient to use.

To Reproduce Steps to reproduce the behavior:

  1. With current release 0.7.1, let the phone screen facing to vehicle's front, and switch to front facing camera
  2. Go to Object Tracking segment
  3. Try object tracking
  4. See error - control should be mirrored

Expected behavior When the phone screen facing to vehicle's front, and using front facing camera, control target should be correct so that the bot can follow detected object.

Smartphone:

Suggested fix Fix should be easy, I'll create a pull request soon

yijunwu commented 7 months ago

I've created a pull request (386) to fix this issue. I've tested the fix and it works.