ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Executable not found in libexec directory

asked 2021-02-24 07:58:54 -0600

MortenMD gravatar image

Hi, I'm trying to create a package, but I get an error when I try to launch:

raise SubstitutionFailure(launch.substitutions.substitution_failure.SubstitutionFailure: executable 'server_node.py' not found on the libexec directory '/home/kmriiwa/Skrivebord/ros2_domain_bridge/install/rdb_server/lib/rdb_server'

I'm running Ubuntu 20.04.2 with ROS2 'Foxy'.

Here my launch file:

import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
import launch_ros.actions
import sys
from rclpy.utilities import remove_ros_args
import argparse

def generate_launch_description(argv=sys.argv[1:]):

    robot_name = 'tester'
    robot_type = 'mobile'
    server_port = '3001'


    param_dir = LaunchConfiguration(
        'param_dir',
        default=os.path.join(
            get_package_share_directory('rdb_server'),
            'param',
            'bringup.yaml'))

    return LaunchDescription([
        DeclareLaunchArgument(
            'param_dir',
            default_value=param_dir,
            description='Full path to parameter file to load'),

 launch_ros.actions.Node(
            package="rdb_server",
            executable="server_node.py",
            name="server_node",
            output="screen",
            emulate_tty=True,
            arguments=['-name', robot_name,'-type', robot_type, '-p', server_port],
            parameters=[param_dir]),

 ])

Here is my CMakeLists.txt

cmake_minimum_required(VERSION 3.5)
project(rdb_server)

# Default to C99
if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclpy REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)

# Install the python module for this package
ament_python_install_package(scripts/)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
endif()

# Install python scripts
install(
  DIRECTORY launch param scripts
  DESTINATION share/${PROJECT_NAME}
)

install(
  PROGRAMS
    scripts/server_node.py
    scripts/server_sockets.py
    scripts/serializer.py
    scripts/thread_objects.py
    DESTINATION lib/${PROJECT_NAME}
)

ament_package()

The contents of '/home/kmriiwa/Skrivebord/ros2_domain_bridge/install/rdb_server/lib/rdb_server' is as follows:

install/rdb_server/lib/rdb_server
  ->__init__.py
  ->serializer.py
  ->server_node.py
  ->server_sockets.py
  ->thread_objects.py

This error has me puzzled, as the missing file is clearly in the folder its directing me to...

Thanks for any tips!

edit retag flag offensive close merge delete

Comments

As additional information - running ros2 pkg executables rdb_server returns nothing.

MortenMD gravatar image MortenMD  ( 2021-02-24 09:20:28 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2022-02-07 20:56:59 -0600

dennylai gravatar image

Maybe it was because your 'server_node.py' does not have executable permission.

try

ls -l

in 'install/rdb_server/lib/rdb_server' directory to check for its permission.


Use

sudo chmod 777 server_node.py

to give it the broadest permission (You can adjust the command according to your file permission needs)

edit flag offensive delete link more

Comments

Hey, thanks for the idea, I had the same issue as the OP and this solved it!

sniegs gravatar image sniegs  ( 2023-07-13 06:26:44 -0600 )edit
0

answered 2023-05-03 07:47:22 -0600

130s gravatar image

launch is looking into install/rdb_server/lib/rdb_server, and looks like the executable in question is installed there. So we need more info to know exactly why the issue is happening.

I imagone the file might not be made executable? It's coder's responsibility to set the proper permission (e.g. cmake's install(PROGRAMS doesn't change permission if you don't specify to change so).

edit flag offensive delete link more
0

answered 2021-02-25 06:13:00 -0600

MortenMD gravatar image

Update:

I worked around the problem by changing from CMake to Python.

edit flag offensive delete link more

Comments

1

That's not really a work-around.

Python packages shouldn't use a CMakeLists.txt in ROS 2.

See Migration guide from ROS 1: Pure Python Package.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-25 09:24:50 -0600 )edit

This is not a solution, this is a work around!

SalahSoliman gravatar image SalahSoliman  ( 2021-08-16 02:42:24 -0600 )edit

@gvdhoorn You meant "pure" Python packages, didn't you? It's still possible (and not discouraged as far as I've looked up) to build-install Python using cmake in ament/colcon.

130s gravatar image 130s  ( 2023-05-03 07:54:48 -0600 )edit
1

It would certainly hold for pure-Python packages.

Afaict, using CMake to install such packages should not be necessary, and also seems like it would go against the idea of Colcon enabling you to use the native package format of your language/platform as much as possible.

gvdhoorn gravatar image gvdhoorn  ( 2023-05-03 15:11:35 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-02-24 07:58:54 -0600

Seen: 3,325 times

Last updated: May 03 '23