.obj files describing the kinematic constraints of the b1 robot.
- Build and install using CMake:
mkdir build
cd build
cmake ..
cmake --install . --prefix /desired/install/pathThis will install:
-
.obj files in share/b1Reachability/reachability_constraints
-
CMake config: share/b1Reachability/cmake/b1ReachabilityConfig.cmake
-
Python config: share/b1Reachability/b1ReachabilityConfig.py
- Add Python config to your PYTHONPATH:
export PYTHONPATH=/desired/install/path/share/b1Reachability:$PYTHONPATHThis allows Python scripts to import b1ReachabilityConfig and access the .obj files. Usage Install example robot data
For this to work you need pinocchio, example-robot-data, pycddlib, scipy and Blender 4.3
conda install example-robot-data scipy -c conda-forge- Make the script script executable:
chmod +x script/gen_and_copy.sh- Run the script with the path to your Blender 4.3 executable:
./script/gen_and_copy.sh /path/to/blender-4.3This will generate reduced .obj files from the original kinematic constraint models.
- Using the files in Python:
from b1ReachabilityConfig import B1REACHABILITY_CONSTRAINTS_DIR
import os, glob
obj_files = glob.glob(os.path.join(B1REACHABILITY_CONSTRAINTS_DIR, "*.obj"))
print("Found OBJ files:", obj_files)- Using the files in C++: CMakeLists.txt example
find_package(b1Reachability REQUIRED PATHS /desired/install/path/share/b1Reachability/cmake)
message(STATUS "Reachability OBJ dir = ${B1REACHABILITY_CONSTRAINTS_DIR}")
add_executable(test_find main.cpp)
target_compile_definitions(test_find PRIVATE
B1REACHABILITY_CONSTRAINTS_DIR="${B1REACHABILITY_CONSTRAINTS_DIR}")cpp file
// main.cpp
#include <iostream>
#include <filesystem>
int main() {
std::string obj_dir = B1REACHABILITY_CONSTRAINTS_DIR;
std::cout << "Reachability OBJ dir: " << obj_dir << std::endl;
for (const auto &entry : std::filesystem::directory_iterator(obj_dir)) {
std::cout << " - " << entry.path() << std::endl;
}
return 0;
}