This is a very basic framework for the ct-Bot with a Teensy 4.0 or Teensy 4.1 controller. It is licensed under the terms of the GPLv3 license.
This code was created for testing a new and simplified design of the ct-Bot software framework. The basic idea is to have a modular structured framework implemented in C++ built on modern language features.
Consider this as experimental code. If it breaks, you get to keep both pieces.
Note for Atom IDE users: When installed via Atom package, Bash (Shell) used in the terminal currently does not seem to recognise the command platformio; use pio instead. (State as of May 2019)
- Install PlatformIO core as described here
- can be skipped, if using VS Code IDE with PlatformIO extension
- can be skipped, if using Atom IDE with package platformio-ide
- if you don't want to use PlatformIO core, see manual build for setup
- Clone this git repository:
git clone https://github.com/tsandmann/ctbot-teensy - Change to cloned repo:
cd ctbot-teensy - Initialize build system for...
- Commandline build:
platformio init - VS Code project:
platformio init --ide vscode - Eclipse CDT project:
platformio init --ide eclipse - any other environment supported by PlatformIO
- Commandline build:
- Build project
- Commandline:
platformio run -e teensy41 - VS Code: use “Build” button on the PlatformIO toolbar or shortcut (
ctrl/cmd+alt+b) - Eclipse CDT:
Project->Build Projector shortcut (ctrl/cmd+b) - Atom: Select project folder in sidebar -> Menu
PlatformIO->Buildor shortcut (Alt+Ctrl+B)
- Commandline:
- Upload firmware image
- Connect USB cable to teensy board
- Commandline:
platformio run -v -e teensy41 -t upload - VS Code: use “Upload” button on the PlatformIO toolbar or shortcut (
ctrl/cmd+alt+t) and select "PlatformIO: Upload" - Atom: Select project folder in sidebar -> Menu
PlatformIO->Uploador shortcut (Alt+Ctrl+U)
- Use a terminal program (e.g. minicom) to connect to the USB serial device
- If you use minicom:
- goto
Serial port setupsettings and setSerial Deviceto your serial device (typically sth. like/dev/cu.usbmodemXXXXXXXor/dev/tty.usbmodemXXXXXXX),Bps/Par/Bitsto4000000 8N1andHardware Flow ControltoNoas well asSoftware Flow ControltoNo - goto
Screen and keyboardsettings and setAdd carriage returntoYes
- goto
- If you use minicom:
- Have fun with the command line interface
- type
helpto get a list and description of available commands
- type
- Cruise around with the ct-Bot using
- your remote control: arrow keys for forward, backward, left, right and power button for stop
- the command line interface:
set speed 30 30for 30% of max speed on both wheels,set speed 0 0(or justset speed) to stop
- Press play on remote control to show a little easter egg on the command line interface :) or I/II to shutdown the bot :(
- To build the documentation with Doxygen:
doxygen Doxyfile- PlantUML has to be installed, to build the UML diagrams
- documentation is located here: doc/html/index.html
- documentation is highly incomplete
- Conventions:
- Indentation is done by 4 (four) spaces for each level, never ever use tabs (
\t|HT) - Source code formatting is done with clang-format, use .clang-format for style settings
- Follow the C++ Core Guidelines. There are two really worth seeing talks about it: Bjarne Stroustrup "Writing Good C++14" and Herb Sutter "Writing Good C++14... By Default"
- Documentation is done with Doxygen, use Doxygen style 1
- At least all public members should be documented
- Every task's implementation (mainly its
run()method) should be modeled by an UML sequence diagram, e.g. as for CtBot::run()
- More to come soon
- Indentation is done by 4 (four) spaces for each level, never ever use tabs (
- ...
| Branch | Build status |
|---|---|
| master |