Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 2.6 KB

File metadata and controls

69 lines (46 loc) · 2.6 KB

Developer's Notes

Autogenerated pieces

The RoboRIO and simulation bindings are largely autogenerated from CTRE header files, which should make updates to the library simpler in the future. However, this means during development you need to specifically run the autogen step.

You will need header2whatever installed:

pip install header2whatever

To run the autogeneration (with internet access), run the following:

python setup.py sdist

If you don't have internet, or don't want to download the pieces over and over again, you can use the RPY_CTRE_DEVDIR environment variable. This should point to a directory that contains the ctre and hal zipfiles unzipped in it.

RPY_CTRE_DEVDIR=devdir python setup.py sdist

If you run that command and the directory doesn't exist, it will automatically download the needed pieces to that directory and unzip them (requires internet). Note that this does not check version numbers, so if you have an old version unzipped there then this command will not update the files.

Compilation

Note: Most users should install a precompiled version via robotpy-installer. See README.rst for details.

Currently, compilation is only supported on the RoboRIO, RoboRIO VM, or via the roborio-docker image. It is assumed that your RoboRIO has internet access. Be warned that it takes a very long time to compile, and that if you're using a real RoboRIO that you will need a swap device installed.

There are several prerequisites that need to be installed on your RoboRIO via opkg and pip first:

opkg install binutils-symlinks gcc-symlinks g++-symlinks libgcc-s-dev libstdc++-dev make python36-dev
pip3 install pybind11 wheel robotpy-hal-base robotpy-hal-roborio

If you are compiling from an sdist (such as from pypi), you don't need to run the autogeneration step. You can create a wheel directly:

pip3 wheel robotpy-ctre

However, if you're creating a wheel from a git checkout, you'll need to run the autogen first, then build the wheel.

python setup.py sdist
pip3 wheel .

Compilation (correctness testing only)

If you need to determine if the changes you are making will compile (but don't actually care about executing the resulting library), then you can run a build on linux using the following:

TRAVIS_BUILD=1 python setup.py sdist build

This will force the C++ extension to build, but it won't try to link it to the CTRE or HAL libraries. Note that you can also specify the RPY_CTRE_DEVDIR environment variable to ensure that you aren't downloading the library files over and over again.