Setting up Visual Studio projects

Questions about our C++ API
Post Reply
sagg7
Posts: 2
Joined: Sat Mar 05, 2022 6:13 pm
Location: Pittsburgh

Setting up Visual Studio projects

Post by sagg7 » Sun Mar 06, 2022 8:36 am

I am working with HEBI examples to learn. I am not able to build projects with numpy dependencies.
Error: "fatal error C1083: Cannot open include file: 'numpy/arrayobject.h': No such file or directory"
During cmake build, it was able to find PythonLibs and successfully generate build files. I followed following steps:
1. clone github repo
2. use cmake to generate build files
3. open solution file in visual studio and build projects.

Software versions: Visual Studdio 2019, Python 3.10.2, HEBI examples git cloned yesterday
User avatar
matt_tesch
HEBI Official
Posts: 26
Joined: Mon Mar 30, 2020 9:14 am
Location: Pittsburgh, USA

Re: Setting up Visual Studio projects

Post by matt_tesch » Mon Mar 07, 2022 12:31 am

Sorry for the trouble here; I will get a fix for this ASAP and ensure this is tested better in the future.

The numpy dependency is not strictly necessary for the examples, and is only used for plotting data in the examples. I can also create a cmake flag that allows the build to occur without the python dependency for simpler builds.

Best,
Matt
sagg7
Posts: 2
Joined: Sat Mar 05, 2022 6:13 pm
Location: Pittsburgh

Re: Setting up Visual Studio projects

Post by sagg7 » Fri Mar 11, 2022 10:49 am

Thanks Matt. Is there a way I can still compile NumPy libraries for the plots?
User avatar
matt_tesch
HEBI Official
Posts: 26
Joined: Mon Mar 30, 2020 9:14 am
Location: Pittsburgh, USA

Re: Setting up Visual Studio projects

Post by matt_tesch » Wed Mar 16, 2022 11:55 am

Sorry for the delay -- I found the issue here; it looks like CMake wasn't setting include paths for numpy properly. I've added a PR for this that should allow you to compile and run with plots -- you just need to have python >= 3.6 and numpy installed (pip3 install numpy).

Let me know if this works for you, and I will merge in the PR:
https://github.com/HebiRobotics/hebi-cp ... es/pull/76

Best,
Matt
Post Reply