ROS workspace install error

I’m following the directions on setting up Stretch in simulation on my m1 MacBook pro with ubuntu running in parallels. After I clone the stretch_install repo and pull from github, I attempt to run the command “./factory/22.04/stretch_create_ament_workspace.sh”; however, my output shows the following:

"
###########################################
CREATING HUMBLE AMENT WORKSPACE at /home/parallels/ament_ws
###########################################
Ensuring correct version of ROS is sourced…
./factory/22.04/stretch_create_ament_workspace.sh: line 26: ROS_DISTRO: unbound variable
"

Looking at this, line 26 in the sh file has something wrong, but I’m not quite sure what.

Any helps and tips would be appreciated!

Hi @keshavshankar, the unbounded error refers to a environment variable not being set. ROS_DISTRO being unset likely means that ROS isn’t sourced or installed in your virtual machine.

Also, since you’re running the Ament workspace script, I wanted to make sure you knew that a ROS2 simulation doesn’t exist for Stretch yet. It is on our roadmap, but only a Gazebo Classic ROS1 simulation exists at the moment.

Hi @bshah. So I wanted a stretch simulation, so I went ahead and repeated this process on ubuntu 20.04. In ubuntu, I also installed ROS Noetic using this.

Now, when I run the command “./factory/20.04/stretch_create_catkin_workspace.sh”, I get the error
“./factory/20.04/stretch_create_catkin_workspace.sh: line 54: /home/keshavshankar/stretch_user/log/stretch_create_catkin_workspace.202310031810_redirected.txt: No such file or directory”

I do have a “catkin_ws” folder with a “src” folder inside of it, however, this source folder has nothing inside of it.

I don’t have physical access to the robot yet, and just want to simulate for now. I assume this error has something to do with ROS Noetic not linked correctly to stretch but I’m not sure how to fix it. I would appreciate any help or tools to walk me through the process.

Hey @bshah , so I went ahead and repeated the steps with ubuntu 20.04 and installed ROS noetic this time, as I don’t have physical access to the stretch robot yet, and mainly want to simulate it in 3d.

Now, when I go to create a workspace using “./factory/20.04/stretch_create_catkin_workspace.sh”, I get the error “./factory/20.04/stretch_create_catkin_workspace.202310031810_redirected.txt: No such file directory”. I can confirm that I have a “catkin_ws > src” directory, so I assume the issue has to do with no files in the src directory or ROS Noetic not being linked correctly. I would appreciate any help and resources you can direct me to to help me solve this issue. Thanks!

Hi @keshavshankar, I believe the “No such file or directory” issue stems from the workspace creation script expecting a “~/stretch_user/log” directory to exist. Since you’re running the script on your personal machine, you likely don’t have the directory. I’m going to add a fix to the script to avoid this issue in the future. In the meantime, you can create “~/stretch_user/log” using mkdir -p ~/stretch_user/log and rerun the script to get it to run correctly.

I also encountered this error but was fixed by manually creating the folder as you mentioned. But then a new error has appeared saying hello-robot.conf is not found. How do I get this file? I am only trying the simulator and don’t have the physical robot yet.

Hi @iibuan, good question. Would you mind opening a new thread to cover it?

I’ve opened a new thread.

1 Like