Skip to content

whatisaphone/chip

Repository files navigation

chip

crates.io docs Build Status

This is a Rust binding to RLUtilities, created by Sam Mish (aka chip). RLUtilities aims to provide a way for members of the RLBot community to contribute their ideas to a common set of tools for arithmetic, simulation, and car controllers. Implementation notes can be found on chip's blog.

Development

Prerequisites

  • Windows
  • Rust
  • bindgen (which requires clang)
  • RLUtilities
    • It has its own prerequisites (cmake, Visual Studio, Python 3)
    • Build bot_utils.lib and copy it into upstream/.

To generate bindings

Unfortunately the blacklist of vec_vec does not work, so a few invalid declarations need to be removed by hand from the generated file :(

chip=<path-to-rlutilities>
bindgen \
    upstream/chip.hpp \
    -o src/ffi.rs \
    --generate-inline-functions \
    --no-layout-tests \
    --with-derive-default \
    --raw-line 'use ffi_types::{mat3, vec3};' \
    --whitelist-type Ball \
    --whitelist-type Car \
    --whitelist-function euler_rotation \
    --whitelist-function max_curvature \
    --whitelist-function max_speed \
    --blacklist-type mat3 \
    --blacklist-type vec3 \
    --blacklist-type '^mat_mat<.+' \
    --blacklist-type '^vec_vec<.+' \
    -- \
    -I "$chip/RLUtilities/cpp/inc"