improved joint space planning

This commit is contained in:
Balakumar Sundaralingam
2024-05-30 14:42:22 -07:00
parent 3bfed9d773
commit 0c51dd2da8
28 changed files with 1135 additions and 213 deletions

View File

@@ -10,6 +10,8 @@
#
# Standard Library
import os
from functools import lru_cache
from typing import Optional
# Third Party
import torch
@@ -148,5 +150,20 @@ def get_torch_jit_decorator(
return empty_decorator
def is_lru_cache_avaiable():
use_lru_cache = os.environ.get("CUROBO_USE_LRU_CACHE")
if use_lru_cache is not None:
return bool(int(use_lru_cache))
log_info("Environment variable for CUROBO_USE_LRU_CACHE is not set, Enabling as default.")
return False
def get_cache_fn_decorator(maxsize: Optional[int] = None):
if is_lru_cache_avaiable():
return lru_cache(maxsize=maxsize)
else:
return empty_decorator
def empty_decorator(function):
return function