Unverified Commit d651b829 authored by James Smith's avatar James Smith Committed by GitHub

Fixes bug in checking if ROS workspace exists in `install_deps.py` (#557)

Fixes bug introduced in https://github.com/isaac-sim/IsaacLab/pull/621

The error was using `os.path.abspath()` instead of `os.path.isabs()` to
check if a path exists. This would always return a value (as it actually
converts to an absolute path) so the if branch was never entered for
relative paths.

Fixes #556

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent b1be6bb4
...@@ -112,13 +112,13 @@ def install_rosdep_packages(paths: list[str], ros_distro: str = "humble"): ...@@ -112,13 +112,13 @@ def install_rosdep_packages(paths: list[str], ros_distro: str = "humble"):
if "isaac_lab_settings" in ext_toml and "ros_ws" in ext_toml["isaac_lab_settings"]: if "isaac_lab_settings" in ext_toml and "ros_ws" in ext_toml["isaac_lab_settings"]:
# resolve the path to the ROS workspace # resolve the path to the ROS workspace
ws_path = ext_toml["isaac_lab_settings"]["ros_ws"] ws_path = ext_toml["isaac_lab_settings"]["ros_ws"]
if not os.path.abspath(ws_path): if not os.path.isabs(ws_path):
ws_path = os.path.join(path, ws_path) ws_path = os.path.join(path, ws_path)
# check if the workspace exists # check if the workspace exists
if not os.path.exists(f"{ws_path}/src"): if not os.path.exists(f"{ws_path}/src"):
raise FileNotFoundError( raise FileNotFoundError(
"During the installation of 'rosdep' dependencies, unable to find a" "During the installation of 'rosdep' dependencies, unable to find a"
f" valid ROS workspace at: {path}/{ws_path}." f" valid ROS workspace at: {ws_path}."
) )
# install rosdep if not already installed # install rosdep if not already installed
if not os.path.exists("/etc/ros/rosdep/sources.list.d/20-default.list"): if not os.path.exists("/etc/ros/rosdep/sources.list.d/20-default.list"):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment