Crates.io | khepera4-sys |
lib.rs | khepera4-sys |
version | 0.1.0 |
source | src |
created_at | 2024-04-11 11:58:40.131703 |
updated_at | 2024-04-11 11:58:40.131703 |
description | APIs for controlling a Khepera IV robot. |
homepage | https://gitlab.com/alicorn/pub/khepera4-sys |
repository | https://gitlab.com/alicorn/pub/khepera4-sys |
max_upload_size | |
id | 1204762 |
size | 131,229 |
Low-level hardware abstraction layer for controlling a Khepera IV robot.
Special Thanks to the Novel Engineering of Swarm Technology (NEST) lab at Worcester Polytechnic Institute for providing a reference usage of the Khepera IV APIs, and providing us with access to their Khepera IV swarms for testing this crate.
The documentation for this crate can be
generated by running cargo doc
; the
generated docs will be written to release/
.
Although the actual Khepera libraries
can only be used on an actual Khepera,
this crate exposes a single HasKhepera4Hardware
trait which can be compiled on any host.
This trait can be used to create mock implementations of the Khepera IV system, which systems can use for integration testing or simulation when an actual Khepera is unavailable.
In addition to adding a dependency
on this crate, you will need to add
(or update) a .cargo/config.toml
at
the root of your crate containing:
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-poky-linux-gnueabi-gcc"
rustflags = [
"-C", "link-arg=-march=armv7-a",
"-C", "link-arg=-mfloat-abi=hard",
"-C", "link-arg=-mfpu=neon",
"-C", "link-arg=-mtune=cortex-a8",
"-C", "link-arg=--sysroot=/opt/poky/1.8/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi",
]
Once this configuration is added, follow the instructions below on how to cross-compile this crate (or a crate dependning on it).
Before building this crate, or a Crate depending on this crate, you need to:
rustup target add armv7-unknown-linux-gnueabihf
Once these tools are installed, you can build this crate by running:
source /opt/poky/1.8/environment-setup-cortexa8hf-vfp-neon-poky-linux-gnueabi
(assuming your Khepera IV SDK light tools were installed to the default /opt/poky/1.8
path).cargo build --release --target=armv7-unknown-linux-gnueabihf
When the build completes, the release artifacts will be
stored in target/armv7-unknown-linux-gnueabihf
.
Copyright 2023 Alicorn Systems, Inc.
Licensed under the GNU Affero General Public License version 3, as published by the Free Software Foundation. Refer to the license file for more information.
The files within vendor/
retain their original copyrights
and licenses, and are included in this repository to simplify
the build process for downstream users.