An asynchronous abstraction layer for kartoffels by Patryk27
See binaries in src
directory. To build and copy to clipboard, use e.g. (linux and wayland)
cargo build --release --bins
base64 target/riscv64-kartoffel-bot/release/tutorial-stab | wl-copy`
For other systems, check the build script in the default starter pack.
Possible improvements:
- tests for binaries
- logging
- inventory
- timer queue, better wakers
- benchmarks and optimization
- Concurrent execution is useful for managing multiple tasks (like navigation and immediate
reactions to new information) at once. To use the async functions, an executor must be used, e.g.
the
embassy_executor
. The API can also be used in a blocking paradigm. - Moving the bot, stabbing, scanning etc. mutate global state. This is
represented by encapsulating these functions in singletons. They can be aquired
exactly once using
Bot::take()
. This way you can be sure that if you keep a reference tomotor
, and checkedmotor.is_ready()
, the motor stays ready. - If you tried to use
Motor
/Arm
/... and they were not ready, anErr
is returned. - In the default
firmware,
radar scan can be overwritten by new scans. In this API, this is no longer
possible, which is enforced by preventing any new scans as long as not all
radar scans have been dropped. It might be necessary to manually call
mem::drop
in certain scenarios. - Bound checking radar scan
Instant
andDuration
tyes for timersTile
,Direction
,Distance
types- Unit Tests
- Interruptable and cooperative
Map
andNavigation
inasync-algorithm
crate, to ensure low latency reactions to other bots.
The unstable custom_test_frameworks
is used for test. The build command is e.g. (linux and wayland)
cargo build --release --tests --all
base64 target/riscv64-kartoffel-bot/release/deps/async_kartoffel-e58abfc84af62516 | wl-copy
Hash (e58a...
) may need to be adapted.
Add the following lines
#![feature(custom_test_frameworks)]
#![reexport_test_harness_main = "test_main"]
#![test_runner(test_kartoffel::runner)]
add the top of your library to enable tests. Might not work for binaries though.