Anki Overdrive Controller
- 4 Devlogs
- 5 Total hours
A custom app to control anki overdrive cars
A custom app to control anki overdrive cars
I continued the class and added the other functions such as uturn, lights, and shift lane. The functions do no work 100% well yet so I still need to figure out the correct byte code to send. I also wrote a main.py file where I can run the functions from the class, created objects for each type of car I have and made aliasis for those objects to use in the code. I then wrote a simple program to start the car and then use command line input to trigger a specific function. I was able to successfully change the speed but the other functions did not work 100%. The stop function was also buggy so I replaced the stop code with just forwarding at a zero speed so the car stops. I played around and figured out a higher accel will cause the car to break more suddenly. Next time I want to figure out the byte codes for uturn and shift lane and proably start receiving data from the tracks as well.
I wrote a class for my cars. This way I can write functions such as driving or later on reading data from the tracks and make car objects for each of the cars to control them more easily. (Without having to make multiple functions for each car). There were some problems with using the asyncio class with a normal class and running it, but I got it to work since I was missing an await statement and had to put everything into a async function. I tested the class, and wrote functions for connecting, disconnection, enabling (within connecting), forward with speed and accel control (with default values), and stop (both seperate and build into disconnect). (Note, the bleak class has connect and disconnect functions, but I made my own to add some extra functions into each of them.) I tested it and worked. Next I will add more functions such as turning on lights, changing lanes, and a few more things.
Today I got the car to move forward. The issue was that I has to activate the car first in developer mode. Then I wrote another variable to control two cars at the same time. I also managed to find a list of some commands online and plan to test that next time along with making functions to perform each of those actions.
Today, I did research on how I could gain access to the cars, and using a bluetooth scanner, I was able to find the id of each car and pair with it. I then figured out how to connect the car to my computer via python, and wrote a simple code to scan for bluetooth devices that include the code for an anki car and return the id. I than added code to connect to a specific device and disconnect. I tried sending data to move the car, and it worked for a second, but not consistently. Next time, try to get the code to move a car.