• Stars
    star
    182
  • Rank 211,154 (Top 5 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

self-racing car platform

Build Status

Self-racing robot using either ceiling lights or traffic cones to localize. Very much a work in progress and documentation will always be severely lacking as this is a constantly moving target!

This is my ongoing entry in the quarterly DIY Robocars competition in Oakland, CA.

Cycloid at CircuitLaunch in Oakland

Hardware (updated!)

I've switched to a 1/10th scale touring car (for flat ground courses) as it handles much better and also eliminates the very finicky wheel encoders used on the Rustler.

Touring car:

  • HobbyKing Blaze R2 ($99)
  • Turnigy TrackStar 9.5T sensored brushless motor 4120KV ($34)
  • Turnigy TrackStar 80A brushless sensored ESC ($40)
  • TrackStar TS-411MG digital servo ($17)
  • Basher 6600mAh 2S2P 40C hardcase LiHV pack ($38) (smaller batteries are fine, but I like being able to run the computer all day on one charge)
  • Tires appropriate for track (Schumacher Racing SST Mini Pins are the way to go on carpet)

Electronics:

  • Raspberry Pi 3 B ($35)
  • SanDisk Ultra 32GB microSDHC UHS-I Card ($9) -- it's important to have the right kind of SD card or it won't keep up with recordings, and it's hard to tell ahead of time which ones will work.
  • Arducam OV5647 Raspberry Pi 3 camera with LS-40180 fisheye lens ($30)
  • ILI9340 SPI 240x320 LCD display, via the fbtft device driver (about $7)
  • Some XT60 plugs and an extra 6-wire brushless sensor cable (~$10)
  • Logitech F710 wireless game pad w/ USB dongle (~$40)
  • Custom HAT board w/ STM32F030 and ICM-20600 IMU: https://easyeda.com/a1k0n/cycloid (PCB + parts is about $5 apiece in qty 10 from JLPCB / LCSC, plus you have to solder it all together)

Total hardware cost for the car comes to under $350, plus the cost of the wireless controller (~$40).

3D printed mounting parts

Besides the RC car, there are three 3D-printed parts to mount the camera and electronics for various cars (Blaze R2, Traxxas Rustler, Exceed Magnet, WLToys K989). I drill and tap 2.5mm screw holes in most of them. These are all modeled in OpenSCAD and source code and .stl files are in hw/scad/.

Configurations

There is a mandatory configuration file called cycloid.ini which allows you to specify the mode of communication to the ESC and servos (Cycloid HAT board, GPIO pins supported; code also exists for Teensy and PCA9685) as well as specify which IMU (all Invensense MPU-9x50, MPU-6050, ICM-2060x supported)

See cycloid.ini.example for full details.

Defining a race track

  • tools/ceilslam has code to turn a datalog saved from the car into a birds-eye view of the track based on ceiling light tracking and reprojecting the pixels which can see the floor.

  • tools/trackplan/gui.py contains a Dear Imgui-based application for defining a racetrack boundary (and cone locations) given a birdseye view of the track. It can also get a birdseye view of the track given two different views and matching sets of points.

Code

Can be compiled on a host PC with a cross compiler (e.g. on macOS you can install this: https://www.jaredwolff.com/toolchains/) or on the Raspberry Pi itself.

If you want to build the code, clone with git clone --recursive https://github.com/a1k0n/cycloid in order to get the Raspberry Pi userland submodule (otherwise just run git submodule init and git submodule update).

Here's how I build it:

Once you have a raspberry pi cross compiler (see two paragraphs above), edit crosscompile.cmake to point to the correct compiler name / path, and do this:

$ mkdir build
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../crosscompile.cmake ../src -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ make -j4

The main executable will be in build/drive/drive; scp that to your raspberry pi on the car, create a cycloid.ini, pair a joystick, and run it.

More Repositories

1

jsxm

FastTracker 2 .xm module player in Javascript
JavaScript
486
star
2

a1gpt

throwaway GPT inference
C++
139
star
3

asciitracing

sphere tracing in ascii
C++
105
star
4

tronbot

a1k0n's 2010 Google AI Challenge entry
C++
90
star
5

texturesynth

texture synthesizer; mainly for tile engines
C++
34
star
6

arduboy3d

a simple 3D demo for arduboy
C
24
star
7

autorustler

experimental R/C car autopilot
Jupyter Notebook
18
star
8

opl2

Yamaha YM3812 (OPL2) in javascript
Jupyter Notebook
16
star
9

303

experiments in 303 bassline resynthesis
Python
15
star
10

balancebot

little balancing robot
OpenSCAD
11
star
11

x0xb0x

git re-pack of x0xb0x code from sourcefource CVS
C
9
star
12

ants

My 2011 AIChallenge.org ants bot
C++
8
star
13

asm662

OKI 66201/66207/66301 assembler and disassembler, used in pre-1996 Honda ECUs
C
8
star
14

donut-raymarch

C
5
star
15

ghidra-msm66q59x

CSS
4
star
16

litex-c2

Silicon Labs C2 debug interface peripheral in Migen / LiteX
Python
4
star
17

asm66q59x

disassembler (and assembler?) for OKI nX-8/500S
Assembly
3
star
18

docker-rpi3-gcc8

docker image for ARM Cortex-53 gcc 8.x compiler
Dockerfile
3
star
19

a1k0n.github.io

JavaScript
2
star
20

rpi-cv-camcal

Raspberry Pi OpenCV camera calibration
C++
2
star
21

gsynth

Abandonware from 2001
C++
2
star
22

zerowing

raspberry pi zero HAT for RC cars
C
1
star
23

tetris-dcpu16

Tetris for DCPU-16 (for Notch's upcoming 0x10c)
C++
1
star
24

wowintro

reverse engineering and reimplementing http://www.pouet.net/prod.php?which=62498
Assembly
1
star
25

raidquaza

pokemon go raid coordination bot for Discord
Go
1
star
26

lallocprof

Lua 5.0 memory allocation profiler
C++
1
star