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

ROS2 Foxy: No rule to make target at colcon build

asked 2023-01-15 10:27:45 -0500

Rosokie gravatar image

Hi, everyone. I need your help.

I want to create custom msg and srv files, according to the documentation of foxy. https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.html

When my package was built in my friend's ubuntu with foxy, it built succesfully. But when it comes to my ubuntu20:04, I get the error:

--- stderr: tutorial_interfaces
make[1]: ** No rule to make target 'utorial_interfaces__py/CMakeFiles/tutorial_interfaces__py.dir/all',needed by ' leddar/CMakeFiles/tutorial_interfaces__python.dir/all' . Stop.
make[1]: *** Waiting for unfinished jobs....
make: *
* [Makefile:146:all] Error 2

I proceeded step by step according to the docs and I was confused as to how this happened. I didn't have any problems during writing, except for this in the package.xml:

After I pasted this code block into the package.xml

<depend>geometry_msgs</depend> <build_depend>rosidl_default_generators</build_depend> <exec_depend>rosidl_default_runtime</exec_depend> <member_of_group>rosidl_interface_packages</member_of_group>

The code block that originally existed in the file reported an error. It is:

``` <test_depend>ament_lint_auto</test_depend>

<test_depend>ament_lint_common</test_depend>

```

So in order to eliminate the error, I deleted this 'error' code block that originally existed.

I tried recompiling after removing the build, log, and install folders, I tried reinstalling ros2, but all failed.

Why does the abbreviation name of Python 'py' appear in the error report of this package whose build type is ament_cmake? How did this bug arise and how do I solve it?

I will greatly appreciate your help. Thank you so much.

edit retag flag offensive close merge delete

Comments

My bug package in GitHub. https://github.com/Zepher5/bug

Rosokie gravatar image Rosokie  ( 2023-01-17 10:17:47 -0500 )edit

FINAL Possible cause: ‘pip’ instructions entered by the terminal once modified the environment Solution: reinstall Ubuntu and Foxy

Rosokie gravatar image Rosokie  ( 2023-01-19 09:21:08 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2023-01-16 21:30:03 -0500

sdu568 gravatar image

updated 2023-01-16 21:30:30 -0500

Could you have mis-spell something along the way. I mean base on the error message, it says 'utorial_interfaces__py/CMakeFiles/tutorial_interfaces__py.dir/all' . Ideally, should not that be

't' utorial_interfaces__py/CMakeFiles/tutorial_interfaces__py.dir/all' ?

edit flag offensive delete link more

Comments

Thank you for your answer. All my files are copied directly from the official documentation so that there will be no spelling mistakes. I'm also confused by this error. I tried reinstalling ros2 and check the file of dependcies packages, but failed.This package compiles on my friend's computer, which also puzzles me. I will upload the contents of the relevant documents shortly.

Rosokie gravatar image Rosokie  ( 2023-01-17 10:07:10 -0500 )edit
Rosokie gravatar image Rosokie  ( 2023-01-17 11:01:31 -0500 )edit

I tried it out on my laptop, and it build successfully.

I guess the only thing that I can think of is to try to delete the /build and /install folder, and do

colcon build

on the whole project

sdu568 gravatar image sdu568  ( 2023-01-18 21:00:57 -0500 )edit

Thank you for your test very much. I've tried many times, but now I know why. Maybe. I paid someone to have the package and build environment checked remotely.

The conclusion is that I have used too many 'pip's to download and install software on the terminal, which may have changed python files of Foxy or Ubuntu without my knowledge. According to his explanation, that's why the error message showed 'py'. I don't know if he's right and I don't know how this conjecture can be verified.This explanation is for reference only.

I spent few days on this bug. Since this package compiles successfully on other people's computers but not mine, there must be something wrong with the environment, so I reinstalled Ubuntu and Foxy. Now, the package compiles normally well. Thanks again.

Rosokie gravatar image Rosokie  ( 2023-01-19 09:04:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-01-15 10:26:52 -0500

Seen: 326 times

Last updated: Jan 16 '23