vscode-ros: [bug] ROS launch can not load launch file that includes gazebo (program path 'PATH' is missing or invalid)
System info
Version: 1.58.0-insider Commit: 3e0c442a8ee9fdc037d627d70fe291f72af04cfd Date: 2021-06-16T05:18:57.982Z Electron: 12.0.11 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Linux x64 5.8.0-55-generic ROS VERSION: ROS 1 Noetic VSCODE-ROS VERSION:
what is the bug
This week I was not able to debug a ROS launch script anymore if it contained a launch script that loads the gzserver. Every time I try to launch such a file, it gives me the following error messages:
Further in the /gazebo_gui
console, it gives the following error message:
The program '/opt/ros/noetic/lib/gazebo_ros/gzserver' has exited with code 42 (0x0000002a).
Repro steps
- Download the following example repository.
- Start the
ROS: Gazebo launch (works)
launch file that is found in the.vscode/launch.json
file of the example_repository. - See the errors that appear.
expected behaviour
Some weeks ago, the launch file would still launch.
Vscode developer tools log
Extra info
- Bug is also present in the normal vscode version.
- Setting
export DISPLAY=:0.0
doesn’t solve the issue.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 37 (15 by maintainers)
Commits related to this issue
- Implmenet script filtering https://github.com/ms-iot/vscode-ros/issues/474 — committed to ooeygui/vscode-ros by ooeygui 2 years ago
- Implmenet script filtering (#654) https://github.com/ms-iot/vscode-ros/issues/474 — committed to ms-iot/vscode-ros by ooeygui 2 years ago
- py OrderedDict to dict for #620 (#655) * Implmenet script filtering https://github.com/ms-iot/vscode-ros/issues/474 * Python OrderedDict to Dict https://github.com/ms-iot/vscode-ros/issues/620 — committed to ms-iot/vscode-ros by ooeygui 2 years ago
- Fix lifecycle wonkyness (#656) * Implmenet script filtering https://github.com/ms-iot/vscode-ros/issues/474 * Fix lifecycle node wonkyness — committed to ms-iot/vscode-ros by ooeygui 2 years ago
@KoganOleg Thanks!
@rickstaa For this specific bug, I’m working on a fix to improve detecting of bat/sh/bash/cmd files so that it doesn’t just fail out right. I hope to have that committed in a few days. Once that bug fix is committed, I’ll close this issue. I have a couple of blocking things like this going into the 0.8.0 release.
gzserver and gzclient are shell scripts. Our code detects python, but not shell scripts, so it treats it as a binary program.
I’m going to add some code to detect this case and just launch it.
I’m working on improving support for scripts in the launch path.
@KoganOleg It looks like your ros node is just a shell script, which isn’t a supported target for the vscode ros extension. I would recommend using python instead of a shell script if you are able to.
If you are not able to switch to a python script, you can filter this out in 0.7.0, with something like this:
@rickstaa I’m sorry, no, I haven’t worked on this yet. It’s one of the top items I want to fix in 0.7.0.
@ooeygui Ah I see thanks again a lot for looking into this problem!
@ooeygui Ah, I see; I haven’t used this feature since the beginning of May so that the upstream update could have caused the error I’m experiencing. I looked through the vscode-cpp tools issues, but I couldn’t find a related issue. I added a gif of the behaviour I experienced next to the example (reproduction) GitHub. The strange thing is that it complains that the
gzserver is not executable while it has the following permissions
-rwxr-xr-x`.For now, I will manually load the gazebo simulator or attach it to a running session. Let me know if I can do something to debug this issue.
Cool, I will leave the closing of the issue to you! Thanks again for your work on the 0.8.0 release.
After looking through this, I decided to add a new feature - https://github.com/ms-iot/vscode-ros/issues/647. This will expose UI for graph control. The ROS Launch debugger can introspect the graph control and launch and attach based on that.
the ROS launch code doesn’t handle sh or bat files, so I’m fixing that as a code filter. the code will just execute it - but not track that execution.
@KoganOleg Can you verify that you are using the 0.7.0 version of the VSCode ROS extension? If so, can you post the contents of your launch.json file?
@ooeygui I verified your solution and it works! Thanks a lot for implementing this. About the “fire and forget”, I noticed that this also occurred before
v0.7.0
when you try to attach to a ROS node that is launched by a subprocessPopen
call. What I currently do is keep a htop window open to close any dangling processes after the debugger has stopped.I think for now we can close this issue and create a new issue for the “fire and forget” problem when it is stumbled upon. For me, closing processes through htop is not too bad. I am very happy with the extension being able to debug roslaunch files that contain gazebo again.
@ooeygui Great. I will test it out when I am working on a ROS project!
@rickstaa I appreciate that comment 😃 Thank you!
@ooeygui No problem. I was just curious. Thanks a lot for all the work you do for this extension.
For other people that also experience this issue. You can still debug your scripts using the vscode-ros
Attach
feature. You can use the code below to wait for the debugger.Python
C++