curobo.util_file module¶
Contains helper functions for interacting with file systems.
- get_content_path() str ¶
Get path to content directory in cuRobo.
Content directory contains configuration parameters for different tasks, some robot parameters for using in examples, and some world assets. Use
ContentPath
when running cuRobo with assets from a different location.- Returns:
path to content directory.
- Return type:
- get_configs_path() str ¶
Get path to configuration parameters for different tasks(e.g., IK, TrajOpt, MPC) in cuRobo.
- Returns:
path to configuration directory.
- Return type:
- get_weights_path()¶
Get path to neural network weights directory in cuRobo. Currently not used in cuRobo.
- join_path(path1: str, path2: str) str ¶
Join two paths, considering OS specific path separators.
- Parameters:
path1 – Path prefix.
path2 – Path suffix. If path2 is an absolute path, path1 is ignored.
- Returns:
Joined path.
- Return type:
- load_yaml( ) Dict ¶
Load yaml file and return as dictionary. If file_path is a dictionary, return as is.
- Parameters:
file_path – File path to yaml file or dictionary.
- Returns:
Dictionary containing yaml file content.
- Return type:
Dict
- write_yaml( )¶
Write dictionary to yaml file.
- Parameters:
data – Dictionary to write to yaml file.
file_path – Path to write the yaml file.
- get_robot_path() str ¶
Get path to robot directory in cuRobo.
Deprecated: Use
get_robot_configs_path
instead. Robot directory contains robot configuration files in yaml format. See Configuring a New Robot for how to create a robot configuration file.- Returns:
path to robot directory.
- Return type:
- get_task_configs_path() str ¶
Get path to task configuration directory in cuRobo.
Task directory contains configuration parameters for different tasks (e.g., IK, TrajOpt, MPC).
- Returns:
path to task configuration directory.
- Return type:
- get_robot_configs_path() str ¶
Get path to robot configuration directory in cuRobo.
Robot configuration directory contains robot configuration files in yaml format. See Configuring a New Robot for how to create a robot configuration file.
- Returns:
path to robot configuration directory.
- Return type:
- get_world_configs_path() str ¶
Get path to world configuration directory in cuRobo.
World configuration directory contains world configuration files in yaml format. World information includes obstacles represented with respect to the robot base frame.
- Returns:
path to world configuration directory.
- Return type:
- get_debug_path() str ¶
Get path to debug directory in cuRobo.
Debug directory can be used to store logs and debug information.
- Returns:
path to debug directory.
- Return type:
- get_cpp_path()¶
Get path to cpp directory in cuRobo.
Directory contains CUDA implementations (kernels) of robotics algorithms, which are wrapped in C++ and compiled with PyTorch to enable usage in Python.
- Returns:
path to cpp directory.
- Return type:
- add_cpp_path( ) List[str] ¶
Add cpp path to list of source files.
- Parameters:
sources – List of source files.
- Returns:
List of source files with cpp path added.
- Return type:
List[str]
- copy_file_to_path( ) str ¶
Copy file from source to destination.
- Parameters:
source_file – Path of source file.
destination_path – Path of destination directory.
- Returns:
Destination path of copied file.
- Return type:
- get_filename( ) str ¶
Get file name from file path, removing extension if required.
- Parameters:
file_path – Path of file.
remove_extension – If True, remove file extension.
- Returns:
File name.
- Return type:
- get_path_of_dir(file_path: str) str ¶
Get path of directory containing the file.
- Parameters:
file_path – Path of file.
- Returns:
Path of directory containing the file.
- Return type:
- get_files_from_dir( ) List[str] ¶
Get list of files from directory with specified extension and containing a string.
- Parameters:
dir_path – Path of directory.
extension – List of file extensions to filter.
contains – String to filter file names.
- Returns:
List of file names. Does not include path.
- Return type:
List[str]
- file_exists(path: str) bool ¶
Check if file exists.
- Parameters:
path – Path of file.
- Returns:
True if file exists, False otherwise.
- Return type:
- get_motion_gen_robot_list() List[str] ¶
Get list of robot configuration examples in cuRobo for motion generation.
- get_multi_arm_robot_list() List[str] ¶
Get list of multi-arm robot configuration examples in cuRobo.