improved joint space planning
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user