The environment APIs of rospkg provide convenient access to ROS package-related environment variables, including methods that provide default values when environment variable overrides are not active.
Name of ROS_PACKAGE_PATH environment variable.
Name of ROS_ROOT environment variable.
Name of ROS_HOME environment variable.
Name of ROS_LOG_DIR environment variable.
Name of ROS_TEST_RESULTS_DIR environment variable.
Get the current ROS_ROOT.
Parameters: | env – override environment dictionary |
---|
Get the current ROS_PACKAGE_PATH.
Parameters: | env – (optional) environment override. |
---|
Get directory location of .ros directory (aka ROS_HOME). possible locations for this. The ROS_LOG_DIR environment variable has priority. If that is not set, then ROS_HOME/log is used. If ROS_HOME is not set, $HOME/.ros/log is used.
Parameters: | env – override environment dictionary |
---|---|
Returns: | path to use use for log file directory |
Get directory to use for writing log files. There are multiple possible locations for this. The ROS_LOG_DIR environment variable has priority. If that is not set, then ROS_HOME/log is used. If ROS_HOME is not set, $HOME/.ros/log is used.
Parameters: | env – override environment dictionary |
---|---|
Returns: | path to use use for log file directory |
Get directory to use for writing test result files. There are multiple possible locations for this. The ROS_TEST_RESULTS_DIR environment variable has priority. If that is set, ROS_TEST_RESULTS_DIR is returned. If ROS_TEST_RESULTS_DIR is not set, then ROS_HOME/test_results is used. If ROS_HOME is not set, $HOME/.ros/test_results is used.
Parameters: | env – override environment dictionary |
---|---|
Returns: | path to use use for log file directory |
Check to see if filesystem path is on paths specified in ROS environment (ROS_ROOT, ROS_PACKAGE_PATH).
Parameters: | p – path, str |
---|---|
Returns: | True if p is on the ROS path (ROS_ROOT, ROS_PACKAGE_PATH) |