0

I have been trying to make an Unbuntu 22.04 ROS2 Humble catkin workspace, but I have been unable to resolve the two command not found errors. Trying to reinstall the catkin package has not been much help either. I think catkin and catkin-tools are probably already installed anyway. I thought maybe it was a search PATH issue but not sure. As the code below shows, setup.bash is called by .bashrc to prepare the Env variables. I do not understand the command not found errors, but I need to resolve them. Please assist me if you can.

/home/.bashrc {this file (.bashrc) was edited so it includes line below

source /opt/ros/humble/setup.bash {no edits to the setup.bash file by user}

$ cd ~/catkin_ws

~/catkin_ws$ catkin_init_workspace

Command 'catkin_init_workspace' not found, but can be installed with:
sudo apt install catkin

~/catkin_ws$ sudo apt install catkin

[sudo] password for kennr: 

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

The following information may help to resolve the situation:
The following packages have unmet dependencies:
python3-catkin-pkg : Conflicts: catkin but 0.8.10-7 is to be installed
python3-catkin-pkg-modules : Conflicts: catkin but 0.8.10-7 is to be installed
E: Unable to correct problems, you have held broken packages.

~/catkin_ws$ catkin_make

Command 'catkin_make' not found, but can be installed with:
sudo apt install catkin

~/catkin_ws$ catkin --version

catkin_tools 0.8.5 (C) 2014-2022 Open Source Robotics Foundation
catkin_tools is released under the Apache License, Version 2.0 
(https://www.apache.org/licenses/LICENSE-2.0)
---
Using Python 3.10.4 (main, Apr  2 2022, 09:04:19) [GCC 11.2.0]

3 Answers 3

0

I do not see a quick fix to this catkin package mess and I need to move ahead to other programming projects. I certainly am accepting comments and solutions to this catkin package mess, but I have discovered a likely work around. Succinctly, instead of $ catkin_init_workspace (a macro) and $ catkin_make (a macro), I used $ cd ~/catkin_ws, $ catkin init and $ catkin build. Please consult the following URL link to a similar post:

https://robotics.stackexchange.com/questions/16604/ros-catkin-make-vs-catkin-build

Again, I will return occasionally, to read and respond to any comments and solutions posted here. Thanks to everyone who tried to assist.

0

Incredible as it may seem this catkin package installation is easily fixed. The CATKIN_INIT_WORKSPACE, CATKIN_CREATE_PACKAGE, CATKIN_MAKE are actually three macros. Whereas 'catkin init', 'catkin create pkg', 'catkin build' are three compiled commands. The macros on my system were being 'NOT FOUND" and the catkin package was suggested for reinstall (and that reinstall produced a broken package error). While the errors may be real, their error types (descriptions) were not accurate. On my machine, these errors disappeared completely when the ~/catkin_ws directory was removed (deleted) entirely and then put back in ~/catkin_ws/src bare bones (empty, with absolutely zero files). At that point all three macros became found and useable. So a reinstall of the catkin package being unnecessary and inappropriate. Running the three macros on the bare bones (clean) directory workspace then produced no errors. Deleting the workspace directory again and recreating it again allowed the three compiled catkin commands to work with zero errors. So, on my machine, both methods worked just not together mixed. In other forum posts and in my post here, it is mentioned that using a mixture of the macros and compiled catkin commands caused the now infamous macro NOT FOUND error. And it probably causes other filesystem errors as well. This is why. Both the three macros and the three compiled catkin commands create their own separate (unequal) directory substructures and file elements (in and below ~/catkin_ws). The three macros and the three compiled catkin commands are incompatible with each other. If you mix the use of them the macros (and probably the compiled catkin commands also) sense the incompatible directory and file sub-structure and start to throw errors. This is why starting anew from a bare bones ~/catkin_ws/src fixes that. It is necessary for the user to choose only one catkin workspace install method, not both. Today, as far as I know, there is nothing wrong with my catkin installation.

0

After some additional research, I learned the following The $ catkin_make macros (and its partners) were from an earlier time and intended for earlier ROS1. Whereas the $ catkin build (and its partners) are closer to the present day and intended for late ROS1 and early ROS2. The upcoming ament_make (and its partners) are untested by me but appear to be the next build tool in the build migration, intended for later ROS2. Since my ROS system is early ROS2, I am best off with the $ catkin build. And indeed that is the case. The $ catkin build functions flawlessly every time on my ROS2, but the $ catkin_make continually has problems on my ROS2. The two workspaces are not build compatible, most likely to migrate it one must manually move the source and do a re-build. It is unclear why the ros-humble-desktop package installs by default (automatically) with the $ catkin_make utility set (instead of the catkin-tools package). It probably should not.

After additional research, for an up to date ROS2 system, it appears best to use the "$ colcon" utility to build the workspace. The "$ catkin build" even being too old.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .