ROS2 Launch file error : libexec directory does not exist
I'm trying to create a simple launch file for one node of my project, I used ROS2 tutorials but the launch file is not working. My project is runing with Eloquent, I used colcon build to install both my executable and my launch file. I tried to run the same launch file on a virtual machine and on a computer, both running on ubuntu 18.04 LTS but I got the same error each time. To run the executable I use its name directly in shell :
$ maintenance_mode
And it works fine. But when I use ros2 run ea_maintenance_mode_manager maintenance_mode it doesn't work, I get no executable found.
Here is the launch file maintenance.launch.py :
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
Node(
package='ea_maintenance_mode_manager',
node_namespace='maintenance_mode',
node_executable='maintenance_mode',
)
])
The launch file is in the same package as the node, in a launch directory, and I added the launch's line in the setup.py file The error returned when I run the ros2 launch is :
$ ros2 launch ea_maintenance_mode_manager maintenance.launch.py
[INFO] [launch]: All log files can be found below /home/remi/.ros/log/2020-11-16-10-38-57-872089-remi-virtual-machine-4587
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): package 'ea_maintenance_mode_manager' found at '/home/remi/Desktop/robot-artificial-intelligence/install/ea_maintenance_mode_manager', but libexec directory '/home/remi/Desktop/robot-artificial-intelligence/install/ea_maintenance_mode_manager/lib/ea_maintenance_mode_manager' does not exist
But this folder does exist in my workspace (robot-artificial-intelligence) and the package is in the /src folder of my workspace. Thank you for your time
Please edit your question to include more information such as how you're installing both your launch files and your executables. We can't help you without enough information to reproduce your problem.
I added some information, yet I don't know if it will be enough for you to reproduce my problem.
From what you're writing my guess is that you're installing it into the global executable path and not the package specific path. as I stated you need to share your build and installation rules for us to help you debug your paths.
I don't have any installation rule, or may be I don't know that I'm using one because I'm not sure what you mean by that. I just created a workspace by doing a colcon build in an empty folder. Then I added in the /src folder my packages, did an other colcon build, sourced and then tried to run my launch file. I also have a launch file I use for Rviz that is working correctly. All my nodes are working fine but none of the launch files I do myself are working.
Plus when I run ros2 pkg executables ea_maintenance_mode_manager It doesn't display my node, so perhaps I'm missing an installation step of my package and executables. My executable should be installed in bin because it can be invoked directly from the commandline. so it should be on the PATH. But then I don't know why I can't invok it in my launch file.