autorope / donkeycar

Open source hardware and software platform to build a small scale self driving car.
http://www.donkeycar.com
MIT License
3.13k stars 1.29k forks source link

Improve communication between the PC and the car #896

Open DocGarbanzo opened 3 years ago

DocGarbanzo commented 3 years ago

Improve sending data and commands from/to the car

Current state

As of now we have the following connections between the car and the PC

Proposals / Options

Optimally we want a solution that works on all platforms and is fast / efficient:

Ezward commented 3 years ago

We are currently running a webserver on the car with an api that allows us to command the car through a rest API and/or websocket. We have an api that allows the car to be calibrated remotely. We have an api that streams from the car's camera. It's running on a Tornado async webserver.

It does not sync data as it is collected. That is something we could add, possibly as a websocket so that the car can push the data to the server.

Is there something else that we want beyond what the car already provides and the ability to push data to the server on the training laptop?

DocGarbanzo commented 3 years ago

We are currently running a webserver on the car with an api that allows us to command the car through a rest API and/or websocket. We have an api that allows the car to be calibrated remotely. We have an api that streams from the car's camera. It's running on a Tornado async webserver.

It does not sync data as it is collected. That is something we could add, possibly as a websocket so that the car can push the data to the server.

Is there something else that we want beyond what the car already provides and the ability to push data to the server on the training laptop?

What @sctse999 added was also the ability to drive the car and to transport tub data from and pilot data to the car. This is pretty much what I added to the UI as well. It basically allows you to run the car without opening any remote shell on it. I have to say that my implementation in the UI is pretty crude, it is based on shell commands like ssh and rsync and text parsing of those. The latter one is very efficient for pushing data through the local network, though. @tikurahul also suggested to look at https://grpc.io as an alternative.

sctse999 commented 3 years ago

As discussed in the maintainer's meeting, I will add instruction to the doc how to install the donkeycar console. I will do it tonight.

Ezward commented 1 year ago

I can get behind the goal of running the car without needing to ssh into it or transferring data via scp or a thumbdrive. GRPC is a wrapper around protobuf; it is a very efficient schema's binary protocol with code generation from schemas. I believe we can run this over a websocket. This could clean up our webui code as well; we could refactor all the various api to work using the GRPC connection. This could open up more community contributions as well if we can rationalize the communication between car and client.

tikurahul commented 1 year ago

GRPC over web sockets is a really good idea. I would make sure to work on the scheme first, to get the protocol right. Once you have that, it should be relatively straightforward to actually implement the client and server.