Environment:
Operating System: Ubuntu 22.04
ROS Version: ROS 2 Humble Hawksbill
Issue:
I have created a ROS 2 package named robot
, and I am able to build it successfully with colcon build
. However, when I try to run my node using ros2 run robot publisher
, I get a "No executable found" error. Running the executable directly from the install/robot/bin directory
works as expected.
Package Structure:
Root package directory contains package.xml
and setup.py
.
Python source code is located in src/robot
.
Steps Taken:
I confirmed that the publisher
script has execute permissions (-rwxrwxr-x)
.
I have sourced the ROS 2 environment setup script before sourcing my workspace's install/setup.bash
.
I checked that AMENT_PREFIX_PATH
is set correctly after sourcing.
I created a symlink from install/robot/bin/publisher
to install/robot/lib/robot/publisher
, but ros2 run
still does not recognize the executable.
I've received warnings about the package marker and package.xml
installation during the build process, but it's unclear if they're related to the issue.
Warnings During Build:
Warning about implicitly installing a marker in the package index.
Warning about implicitly installing the package.xml
file.
Setuptools deprecation warning regarding the setup.py
install.
Content of setup.py
:
from setuptools import setup
package_name = 'robot'
setup(
name=package_name,
version='0.0.1',
packages=[package_name],
package_dir={'': 'src'},
install_requires=['setuptools'],
zip_safe=True,
maintainer='Mateusz',
maintainer_email='[email protected]',
description='ROS 2 package Robot',
license='License',
tests_require=['pytest'],
entry_points={
'console_scripts': [
'publisher = robot.publisher:main',
],
},
)
Content of package.xml
:
<?xml version="1.0"?>
<package format="3">
<name>robot</name>
<version>0.0.1</version>
<description>A ROS 2 package for Robot.</description>
<maintainer email="[email protected]">Mateusz</maintainer>
<license>MIT License</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<depend>rclpy</depend>
<depend>std_msgs</depend>
<export>
<build_type>ament_python</build_type>
</export>
</package>
Executable Script Details:
Executable named publisher.
The publisher script is located at install/robot/bin/publisher
.
I've attempted to create a symlink in the expected location.
Questions:
Are the warnings I'm receiving during the build process indicative of issues that could lead to ros2 run
not finding the executable?
Is there a step I'm missing in the process of registering the executable with the ROS 2 runtime environment?
Could this be related to changes in ROS 2 Humble or the way Python executables are handled?
Additional Context:
Direct execution of the publisher script works perfectly, as I can run it using ./install/robot/bin/publisher
, and it correctly publishes messages to a topic.
I've verified that the environment variables are set correctly after sourcing the setup scripts.
The symlink in install/robot/lib/robot
pointing to the executable appears to be correct, but ros2 run
still doesn't find the executable.
Any guidance or suggestions on what might be causing this issue and how to resolve it would be greatly appreciated!