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

[bug] Debugging a ROS1 .test launch file works only if "catkin build" is run a second time after sourcing "devel/setup.bash" #1167

Open
2 of 4 tasks
rsarrazin2 opened this issue Oct 12, 2023 · 0 comments
Labels
bug Something isn't working ROS1 testing Anything having to do with ROS Tests

Comments

@rsarrazin2
Copy link

  • Windows: (Version)
  • Linux: Ubuntu 20.04 (inside a dev container running on WSL2)
  • ROS 1: Noetic
  • ROS 2: Dist

v0.9.2

Version: 1.83.0 (user setup)
Commit: e7e037083ff4455cf320e344325dacb480062c3c
Date: 2023-10-03T16:12:16.321Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22621

what is the bug

Building with catkin_tools, debugging a test by launching a .test file only works after building the tested package twice, the second time after sourcing devel/setup.bash.

Repro steps

  1. Checkout this minimum example and open it with vscode. Reopen in devcontainer.
  2. Ensure the workspace is clean (catkin clean -y) and open a new terminal to ensure nothing is sourced.
  3. Run source /opt/ros/noetic/setup.bash then catkin build foo. You can now run and debug the "foo_node" launch configuration (expected to work, just for cross check with regular launch files).
  4. Run catkin test foo that should pass. You should now be able to run and debug the "foo_test" launch configuration. Yet doing so you get an error dialog box à la Command failed: roslaunch --args /foo_test /workspace/src/foo/test/foo_test.test (see full text below).
  5. Run source devel/setup.bash then catkin build foo again. Now you can run and debug the "foo_test" launch configuration.

expected behavior

Step 4. should already work. Running catkin build foo a second time, even after sourcing devel/setup.bash, should be a no-op.

additional context

How I found out catkin build foo a second time might solve the problem

Why does catkin run_tests run without a error but rostest not? states

After you clean your catkin workspace, of course you have to build your catkin folder and source this workspace. But you also have to build your catkin workspace a second time, which I forgot to do.

Full error dialog box

[Window Title]
Visual Studio Code

[Content]
Command failed: roslaunch --args /foo_test /workspace/src/foo/test/foo_test.test 
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/__init__.py", line 268, in main
    node_args.print_node_args(options.node_args, args)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/node_args.py", line 108, in print_node_args
    args = get_node_args(node_name, roslaunch_files)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/node_args.py", line 194, in get_node_args
    args = create_local_process_args(node, machine)
  File "/opt/ros/noetic/lib/python3/dist-packages/roslaunch/node_args.py", line 269, in create_local_process_args
    raise NodeParamsException("Cannot locate node of type [%s] in package [%s]. Make sure file exists in package path and permission is set to executable (chmod +x)"%(node.type, node.package))
roslaunch.node_args.NodeParamsException: Cannot locate node of type [foo_test] in package [foo]. Make sure file exists in package path and permission is set to executable (chmod +x)


[Open 'launch.json'] [Cancel]
@rsarrazin2 rsarrazin2 added the bug Something isn't working label Oct 12, 2023
@ooeygui ooeygui added ROS1 testing Anything having to do with ROS Tests labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ROS1 testing Anything having to do with ROS Tests
Projects
None yet
Development

No branches or pull requests

2 participants