Skip to content

Scripts to compute the reachability polytopes for B1, output as an OBJ file. The scripts require Blender for post-processing

License

Notifications You must be signed in to change notification settings

RobotMotorIntelligence/b1Reachability

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

b1Reachability

.obj files describing the kinematic constraints of the b1 robot.


Installation

  1. Build and install using CMake:
mkdir build
cd build
cmake ..
cmake --install . --prefix /desired/install/path

This will install:

  • .obj files in share/b1Reachability/reachability_constraints

  • CMake config: share/b1Reachability/cmake/b1ReachabilityConfig.cmake

  • Python config: share/b1Reachability/b1ReachabilityConfig.py

  1. Add Python config to your PYTHONPATH:
export PYTHONPATH=/desired/install/path/share/b1Reachability:$PYTHONPATH

This allows Python scripts to import b1ReachabilityConfig and access the .obj files. Usage Install example robot data

Regenerate the obj files

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
  1. Make the script script executable:
chmod +x script/gen_and_copy.sh
  1. Run the script with the path to your Blender 4.3 executable:
./script/gen_and_copy.sh /path/to/blender-4.3

This will generate reduced .obj files from the original kinematic constraint models.

Usage

  1. 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)
  1. 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;
}

About

Scripts to compute the reachability polytopes for B1, output as an OBJ file. The scripts require Blender for post-processing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 95.5%
  • Python 4.2%
  • Other 0.3%