Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix isaac_ros-dev path by using relative path to script #68

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

j3soon
Copy link

@j3soon j3soon commented Apr 30, 2023

Originally, the ISAAC_ROS_DEV_DIR variable will be incorrectly set to $(pwd), i.e., <SOME_PATH>/isaac_ros-dev/src/isaac_ros_common, when launching the script with:

cd <SOME_PATH>/isaac_ros-dev/src/isaac_ros_common && \
  ./scripts/run_dev.sh

The correct path should be <SOME_PATH>/isaac_ros-dev, which is fixed in this commit using related path to script: $ROOT/../../.., i.e., <SOME_PATH>/isaac_ros-dev/src/isaac_ros_common/scripts/../../...

The LFS_FILES_STATUS should be fixed accordingly by cd into $ISAAC_ROS_DEV_DIR/src/isaac_ros_common before checking the git lfs status.

Double quotation marks are required to correctly mount paths with special characters. (Tested with paths including whitespace characters)

@hemalshahNV hemalshahNV self-requested a review May 22, 2023 17:57
scripts/run_dev.sh Outdated Show resolved Hide resolved
scripts/run_dev.sh Outdated Show resolved Hide resolved
@YuZhong-Chen
Copy link

@j3soon
Hi, I encountered the same issue when I launched the script, and the fix worked perfectly for me.
Thank you so much!

@j3soon
Copy link
Author

j3soon commented Sep 27, 2023

Just confirmed the issue persists in the latest release 94dfe8d.

@hemalshahNV
Copy link
Contributor

I have had a chance to get back to this. I've adapted your changes, @j3soon, to make one less assumption about the path as an absolute fallback. Please take a look.

output.patch

Originally, the `ISAAC_ROS_DEV_DIR` variable will be incorrectly set to
`$(pwd)`, i.e., `<SOME_PATH>/isaac_ros-dev/src/isaac_ros_common`, when
launching the script with:

```sh
cd <SOME_PATH>/isaac_ros-dev/src/isaac_ros_common && \
  ./scripts/run_dev.sh
```

The correct path should be `<SOME_PATH>/isaac_ros-dev`, which is fixed
in this commit using related path to script: `$ROOT/../../..`, i.e.,
`<SOME_PATH>/isaac_ros-dev/src/isaac_ros_common/scripts/../../..`.

The `LFS_FILES_STATUS` should be fixed accordingly by `cd` into
`$ISAAC_ROS_DEV_DIR/src/isaac_ros_common` before checking the git lfs
status.

When mounting the directory into the docker container, double quotation
marks are required to correctly mount paths with special characters.
@@ -26,12 +26,23 @@ fi

ISAAC_ROS_DEV_DIR="$1"
if [[ -z "$ISAAC_ROS_DEV_DIR" ]]; then
ISAAC_ROS_DEV_DIR="$HOME/workspaces/isaac_ros-dev"
ISAAC_ROS_DEV_DIR_DEFAULTS=("$HOME/workspaces/isaac_ros-dev" "/workspaces/isaac_ros-dev")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the /workspaces/isaac_ros-dev here is a typo. Since the instructions here mentioned the use of /ssd/workspaces/isaac_ros-dev on Jetson platforms.

if [[ ! -d "$ISAAC_ROS_DEV_DIR" ]]; then
ISAAC_ROS_DEV_DIR="$ROOT/../../.."
ISAAC_ROS_DEV_DIR=$(realpath "$ROOT/../../")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving up two directories is unfortunately not enough (and will cause error) as mentioned in this comment.

  • $ROOT/../../ is <SOME_PATH>/isaac_ros-dev/src
  • $ROOT/../../../ is <SOME_PATH>/isaac_ros-dev

The latter is required for correctly mounting the volume for docker:

-v $ISAAC_ROS_DEV_DIR:/workspaces/isaac_ros-dev \


Moving up two directories (instead of three) would cause an error that can be reproduced by following the nvblox tutorial. Instead of working in ~/workspaces/isaac_ros-dev, we use ~/projects/isaac_ros-dev instead.

In step 5, the following error occurs:

admin@ubuntu:/workspaces/isaac_ros-dev$ ls
isaac_ros_common
admin@ubuntu:/workspaces/isaac_ros-dev$ rosdep install -i -r --from-paths src --rosdistro humble -y --skip-keys "libopencv-dev libopencv-contrib-dev libopencv-imgproc-dev python-opencv python3-opencv nvblox"
given path 'src' does not exist

This error is due to mounting the wrong directory ($ROOT/../../) into the container. This could be fixed by mounting the correct directory ($ROOT/../../../).


If we want to support arbitrary directory hierarchy (e.g., without the src directory), we must somehow traverse upwards in the directory structure and compare each directory name with "isaac_ros-dev" in order to locate it.

git rev-parse &>/dev/null
if [[ $? -eq 0 ]]; then
LFS_FILES_STATUS=$(cd "$ISAAC_ROS_DEV_DIR/src/isaac_ros_common" && git lfs ls-files | cut -d ' ' -f2)
LFS_FILES_STATUS=$(cd $ISAAC_ROS_DEV_DIR && git lfs ls-files | cut -d ' ' -f2)
Copy link
Author

@j3soon j3soon Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cd $ISAAC_ROS_DEV_DIR part should be changed to cd $ROOT/...

@j3soon
Copy link
Author

j3soon commented Oct 11, 2023

Hi @hemalshahNV,

I just verified that the provided patch (output.patch) does not fix the issue. Please see the commit history and comments for more details. Specifically, see this commit for the required changes to output.patch.

Thank you!

@wjj1008
Copy link

wjj1008 commented Aug 1, 2024

@hemalshahNV do we have the CI/CD system to validate the patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants