Skip to content

ipab-rwa/go2Reachability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go2Reachability

.obj files describing the kinematic constraints of the go2 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/go2Reachability/reachability_constraints

  • CMake config: share/go2Reachability/cmake/go2ReachabilityConfig.cmake

  • Python config: share/go2Reachability/go2ReachabilityConfig.py

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

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

Regenerate the obj files

This requires example-robot-data 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 go2ReachabilityConfig import GO2REACHABILITY_CONSTRAINTS_DIR
import os, glob

obj_files = glob.glob(os.path.join(GO2REACHABILITY_CONSTRAINTS_DIR, "*.obj"))
print("Found OBJ files:", obj_files)
  1. Using the files in C++: CMakeLists.txt example
find_package(go2Reachability REQUIRED PATHS /desired/install/path/share/go2Reachability/cmake)

message(STATUS "Reachability OBJ dir = ${GO2REACHABILITY_CONSTRAINTS_DIR}")

add_executable(test_find main.cpp)

target_compile_definitions(test_find PRIVATE
    GO2REACHABILITY_CONSTRAINTS_DIR="${GO2REACHABILITY_CONSTRAINTS_DIR}")

cpp file

// main.cpp
#include <iostream>
#include <filesystem>

int main() {
    std::string obj_dir = GO2REACHABILITY_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 Go2, output as an OBJ file. The scripts require Blender for post-processing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors