ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

ROS2 Following basic service/client tutorial, executables doesn't seems to install

asked 2022-06-27 08:53:42 -0500

Bastian2909 gravatar image

updated 2022-06-27 09:54:32 -0500

For a bit of context, I am using Ubuntu 20.04 with ROS2 Foxy. I followed this tutorial : https://docs.ros.org/en/foxy/Tutorial...

To recap everything I have done :

- open new terminal :
source /opt/ros/foxy/setup.bash
mkdir -p dev_ws/src
cd dev_ws/src 
ros2 pkg create --build-type ament_python py_srvcli --dependencies rclpy example_interfaces

python py_srvcli --dependencies rclpy example_interfaces
going to create a new package
package name: py_srvcli
destination directory: /home/user/Stage_ros/test/dev_ws/src
package format: 3
version: 0.0.0
description: TODO: Package description
maintainer: ['user <bastian.muratory@gmail.com>']
licenses: ['TODO: License declaration']
build type: ament_python
dependencies: ['rclpy', 'example_interfaces']
creating folder ./py_srvcli
creating ./py_srvcli/package.xml
creating source folder
creating folder ./py_srvcli/py_srvcli
creating ./py_srvcli/setup.py
creating ./py_srvcli/setup.cfg
creating folder ./py_srvcli/resource
creating ./py_srvcli/resource/py_srvcli
creating ./py_srvcli/py_srvcli/__init__.py
creating folder ./py_srvcli/test
creating ./py_srvcli/test/test_copyright.py
creating ./py_srvcli/test/test_flake8.py
creating ./py_srvcli/test/test_pep257.py

cd .. (now i am in /dev_ws) :

rosdep install -i --from-path src --rosdistro foxy -y

#All required rosdeps installed successfully

colcon build --packages-select py_srvcli

Starting >>> py_srvcli
--- stderr: py_srvcli                   
listing git files failed - pretending there aren't any
---
Finished <<< py_srvcli [2.44s]

Summary: 1 package finished [2.89s]
  1 package had stderr output: py_srvcli

My question is why is there an error with git meanwile I never used git anywhere in this tutorial ?

Furthemore, i then sourced the install directory :

. install/setup.bash

and ran :

ros2 run py_srvcli service

which then told me no executables found ... Am I missing something ?

EDIT : I have already added the entry points, here is my setup.py as it might help

from setuptools import setup

package_name = 'py_srvcli'

setup(
    name=package_name,
    version='0.0.0',
    packages=[package_name],
    data_files=[
        ('share/ament_index/resource_index/packages',
            ['resource/' + package_name]),
        ('share/' + package_name, ['package.xml']),
    ],
    install_requires=['setuptools'],
    zip_safe=True,
    maintainer='user',
    maintainer_email='bastian.muratory@gmail.com',
    description='TODO: Package description',
    license='TODO: License declaration',
    tests_require=['pytest'],
    entry_points={
        'console_scripts': [
            'service = py_srvcli.service_member_function:main',
            'client = py_srvcli.client_member_function:main',
        ],
    },
)

and finally, here is the tree from the dev_ws

edit retag flag offensive close merge delete

Comments

Few questions, none to answer your git query: Have you created the service node as per the tutorial(2)? If yes, have you added an entry point for the script (2.2)? If yes, does the node run when instead of "ros2 run py_srvcli service" you type in "service" in the cli?

harshal gravatar image harshal  ( 2022-06-27 09:39:32 -0500 )edit

Hello, first of all thank you for taking the time to read my question, I created the node folowing the tutorial and yes, I had already added the entry points (I added it in the edit of my post). However i'm not sure about what you mean by typing service in the cli ?

Bastian2909 gravatar image Bastian2909  ( 2022-06-27 09:56:34 -0500 )edit

I understand that you get "No executable found" when you enter "ros2 run py_srvcli service" in terminal. What happens when you enter "service" in terminal?...so, type service and press enter.

harshal gravatar image harshal  ( 2022-06-27 10:00:45 -0500 )edit

My appologies I didn't know this was a command. I types "service" and nothing happened, not even an error message. The terminal is still running the command but won't display anything so i had to use ctrl-C to stop it.

Bastian2909 gravatar image Bastian2909  ( 2022-06-27 10:06:06 -0500 )edit

No worries, and no, "service" is not the command that we refer to here. It is the name of the executable that you created (I am facing similar issue here. If you run "service", and then in a separate terminal run "ros2 service list", you should see the name of the service that you created. If yes, you could use the above workaround till you find better guidance in this regard.

harshal gravatar image harshal  ( 2022-06-27 10:15:18 -0500 )edit
2

Please see colcon/colcon-core#518.

I believe that's the same issue reported.

gvdhoorn gravatar image gvdhoorn  ( 2022-06-27 10:26:26 -0500 )edit

Thank you, that was exactly what i needed !

Bastian2909 gravatar image Bastian2909  ( 2022-06-29 02:56:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-06-29 02:55:27 -0500

Bastian2909 gravatar image

updated 2022-07-01 04:58:58 -0500

As mentionned by gvdhoorn, an update with colcon core seem to change where are files installed when using colcon build To solve my issue I used : [THIS IS OUTDATED]

colcon build --symlink-install
colcon build

and everything worked well agin, thank you all for helping me !

EDIT : previous solution was a workaround as mentionned by gvdhoorn, another way to fix this has been found by Guillaumebeuzeboc : (https://github.com/colcon/colcon-core...) :

In the setup.cfg replace :

[develop]
script-dir=$base/lib/my_package
[install]
install-scripts=$base/lib/my_package

By :

[develop]
script_dir=$base/lib/my_package
[install]
install_scripts=$base/lib/my_package
edit flag offensive delete link more

Comments

1

Note: this is a work-around for now.

This is not a proper solution.

gvdhoorn gravatar image gvdhoorn  ( 2022-06-29 05:10:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-06-27 08:53:42 -0500

Seen: 158 times

Last updated: Jul 01 '22