robotpy-cscore install¶
Note
cscore is not installed when you pip install robotpy
RoboRIO installation¶
If you have robotpy-installer on your computer, then installing robotpy-cscore
is very simple:
# While connected to the internet
robotpy-installer opkg download cscore
# While connected to the network with a RoboRIO on it
robotpy-installer opkg install cscore
For additional details about running robotpy-installer on your computer, see the robotpy-installer documentation.
Non-roboRIO installation¶
GNU/Linux packages¶
If you’re using Debian, Ubuntu, Fedora, or openSUSE, follow the instructions on https://software.opensuse.org/download.html?project=home%3Aauscompgeek%3Arobotpy&package=python3-cscore
If you’re using Arch Linux, you can follow the instructions at https://software.opensuse.org/download.html?project=home%3Aauscompgeek%3Arobotpy&package=python-cscore to install a precompiled package.
A full list of supported platforms is available on https://build.opensuse.org/package/show/home:auscompgeek:robotpy/robotpy-cscore
Compiling from source¶
If you’re not installing on a RoboRIO, then installation of cscore has a few additional steps that you need to do:
Ensure a C++ compiler that supports C++17 is installed
Install Python 3 (cscore is not supported on Python 2) and development headers
Ensure that you have a recent version of pip3/setuptools installed (either via pip3 or using a Linux package manager)
It has been reported that build failures may occur with certain combinations of pip/setuptools installed
Install Numpy (either via pip3 or using a Linux package manager)
Install OpenCV (either via a Linux package manager or compile from source)
If you compile from source, you must enable shared library support, cscore cannot use a statically compiled OpenCV python module at this time
If you use OpenCV 4, you must also compile with
-DOPENCV_GENERATE_PKGCONFIG=ON
and installpkgconfig
via pip for robotpy-cscore to find it.
Install robotpy-cscore via pip3. It should be as easy as running
pip3 install robotpy-cscore
– though be warned, it takes several minutes to compile!
Note
robotpy-cscore has only been lightly tested on Windows, and installation of OpenCV is slightly complicated, but you may have luck using conda. See robotpy-cscore issue #17 for more details.
Note
CSCore does not support reading USB cameras on macOS.
Warning
Currently, robotpy-cscore does not support using the OpenCV module that comes with the opencv-python package distributed on Pypi. Long term, I’d like to get that to work, but it’s going to take a bit of work. To track this issue, see https://github.com/skvark/opencv-python/issues/22
Next steps¶
See our cscore documentation for examples and deployment thoughts.