question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] C++ node not appearing in rosrun command when built with `catkin build`

See original GitHub issue

general information

OS: Mint 19.3, based on Ubuntu 18.04 Plugin: v0.6.3

what is the bug

When trying to run a C++ node with the >rosrun command, the available nodes in the package don’t appear. This is similar to the issue here. However, I’ve checked that that the executable is marked with an -x.

This can be reproduced by building the workspace with catkin build and trying to launch the built node from VSCode. After some digging, I’ve found that the catkin_tools package installs a symlink to the node executable in the catkin_ws/devel/lib/ directory, while putting the actual executable in the catkin_ws/devel/.private/lib/ directory. This seems like the default behaviour and I can’t seem to find an easy way around this. This additional hidden directory is what seems to be causing the executable search to fail.

suggested fix

Looking at plugin’s executable search function here, I see that the find command will not follow symlinks, which causes it to not find the executable in my case where the package is build with catkin build. I would suggest adding the flag -L to the find command, which will allow the search to follow symlinks. It will not add the actual executable to the output list, but it will add the symlink at least

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yassiezarcommented, Apr 15, 2020

When searching for the executable “pcl_polygon_mesh_to_triangle_list”, I’ve run the command find (catkin_find --without-underlays --libexec --share 'pcl_polygon_mesh_to_triangle_list') -type f -executable, which reports no results. Changing that to find -L (catkin_find --without-underlays --libexec --share 'pcl_polygon_mesh_to_triangle_list') -type f -executable (note the -L) reports exactly 1 result: the symlink to the executable.

I’ve added the -L shown above to my local VSCode plugin and it is able to find and run the executable in VSCode as expected (using >rosun). I’d open a PR, but a 2-character PR seems a bit weird haha

0reactions
ooeyguicommented, May 30, 2022

Thank you for closing the loop!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Catkin-built node not available under rosrun - ROS Answers
I am attempting to use rosrun in order to run an executable in Indigo. My CMakeLists.txt is as follows: cmake_minimum_required(VERSION ...
Read more >
Build Packages — catkin_tools 0.0.0 documentation
The build verb is used to build one or more packages in a catkin workspace. Like most verbs, build is context-aware and can...
Read more >
Catkin and Packages
The ROS packages that you install using apt have been built by the ROS build farm and packaged as binaries from the install...
Read more >
Code up a ROS node from scratch (C++ and Python)
A catkin workspace and ROS package initialised as per Create a catkin ... Display the namespace of the node ... Add the C++...
Read more >
A Gentle Introduction to ROS.pdf
This change applies both on the command line. (see page 31) and in C++ code (see page 51). Build systems Starting with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found