RoboTrack
- 11 Devlogs
- 37 Total hours
Pybricks-based firmware and python code to track a LEGO Spike Prime’s movements in real time using odometry calculations.
Pybricks-based firmware and python code to track a LEGO Spike Prime’s movements in real time using odometry calculations.
Wooohoo, it can actually sync to the robot and read the flash! With bi-directional communication, you can send commands and recieve data, like, in the picture below “GETSLOTS” which recieves what slots are occupied! Overall really nice, and I polished it a bit.
Added a virtual/live robot connected mark (so you can actually see if the robot is a mock or not) with a package counter and hopefully working battery indicator in the future! Also better visualisations and less lag due to setState being called every 20ms (which rebuilds the entire page every tick)
The project is getting way better, mostly because of the BLE-telemetry now working and connecting! You can actually see your robot live due to my python changes. Now it’s time to work on recording and changing specific slots.
Getting way better using Flutter, I’m really learning it.
I now have a cool analytics page, starring a location visualisation, battery bar, X/Y and yaw/pitch/roll gyro plus visualisation. I’m ready to start coding Bluetooth communication now.
I’m almost done with the python script, but I started to work on the big boy RoboTrack app, which you can see a visualisation of what the RoboTrack robot thinks. Every grid square is 1 cm and it nearly updates live.
I also implemented some mock data generators. If you do not have a SPIKE robot, you can still test it out because the app emulates a robot.
I’ve started to work on the Flutter Dart Frontend for RoboTrack and made the python script way more robust. It’s hard, really hard to make sure that the hardware-side of this project is doing as it should. It always spins or lives it’s own life.
OMG I was busy for SO long finding ONE simple bug regarding the robot spinning in circles. It was really simple. Most bugs are.
However, I found it out and now it’s getting better every update! I really hope no more bugs show up, but it’s inevitable.
I got motorsnapshots working, so you can program motors other than wheels. This is really important for the robot but really hard to implement with the strict 8-byte limit on each instruction. I managed to get it working by combining signed 16-bit integers and unsigned 8-bit integers.
I finished the framework of the RoboTrack main Python script. It now uses odometry to calculate it’s position and can drive to specific coordinates. It can write bytes to flash memory and can read them.
It’s now time to write a bytecode interpreter to actually give meaning to the written and read bytes.
I started to work on the logic for the LEGO robot, it can now track it’s position using sin(rad) and cos(rad) where rad = angle * pi / 180 and applies it to x, y and last_distance.
Sorry sometimes I use devlogs to nerd talk :)
I FINALLY, FINALLY managed to finish the Pybricks firmware-fork in order to upgrade limited storage size of 512 bytes to 8 kilobytes. This allows longer programs to be stored on the flash without needing a computer attached. I also fixed some annoying problems with btstack, which is apparently a seperate github thing, or so I thought? I’ll find what the problem actually was. Fixing it was mostly time consuming trial-and-error.