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

Upload error on arduino IDE #270

Closed jony-g06 closed 2 years ago

jony-g06 commented 2 years ago

I just downloaded the firmware file to my computer in order to get the code for the openbot and, after checking it, it gives an error on line 238 that says "'coast_mode' does not name a type", even though it is defined as a boolean on line 62 with a value of 1. What can I do to fix the error?

thias15 commented 2 years ago

Which vehicle are you trying to compile for?

jony-g06 commented 2 years ago

The openbot that appears on the website

quentin-leboutet commented 2 years ago

Hi jony-g06, did you try moving the line 238 inside the void setup() scope ? Something like:

void setup()
{
...
#if (OPENBOT == LITE)
  coast_mode = !coast_mode;
#endif
}

This solves the issue in my case.

thias15 commented 2 years ago

Thanks @quentin-leboutet, I merged your PR. @jony-g06 can you pull again from master and try if it works for you?