Catkin command not found

117.8k views Asked by At

I have installed ROS indigo and gazebo2 packages in Ubuntu 14.04.5. When I try to use catkin command, I get:

catkin_init_workspace : command not found

So, I tried to install catkin, it displays that ros-indigo-catkin is the latest version.

All I did was,

$ sudo apt-get install ros-indigo-desktop-full

$ sudo apt-get install gazebo2.<They're installed perfectly>

After this, I am getting catkin issue.

Help needed. Someone please find a way to fix this issue.

4

There are 4 answers

1
lmiguelvargasf On BEST ANSWER

Probably you forgot to set up the environment after installing ROS.

$ echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

Then, I will assume you want to create a package, so you can follow these steps:

$ mkdir -p path_to_my_workspace/workspace_name/src
$ cd path_to_my_workspace/workspace_name/src
$ catkin_init_workspace
$ cd path_to_my_workspace/workspace_name/
$ catkin_make
$ source path_to_my_workspace/workspace_name/devel/setup.bash

After running these commands your workspace is created, so now you can start adding packages.

0
Mostafa Wael On

Maybe you didn't install "catkin ROS build system"

You can install it using the following command for ROS Melodic:

sudo apt-get install ros-melodic-catkin python-catkin-tool

or for ROS kinetic

sudo apt-get install ros-kinetic-catkin python-catkin-tool

If you want to create a ROS package, you can use: catkin create pkg myworkSpace --catkin-deps rospy this command will create a ROS workspace with a source folder, CMakeLists.txt and package.xml

or use

mkdir catkin
cd catkin
catkin create pkg myworkSpace --catkin-deps rospy

The provided commands are for Python. So, make sure to modify it for Cpp if you want so.

0
drewlufkin On

If the workspace is setup, you properly sourced ROS as stated above, and if catkin_make works, but catkin build doesn't work do this:

sudo apt install python3-catkin-tools python3-osrf-pycommon

This is a catkin-tools dependency which was delinked in Ubuntu 20.04 so it has to be manually specified to be installed.

3
Arafat Mukasa On

Had almost the same issue when i tried to run this command (please refer to the pics attached).

$ catkin build

Screenshot for solution applied to solve catkin build error
I solved it by installing catkin ROS build system using the command below (references attached in the links and pictures attached). Screenshot for catkin build error

$ sudo apt-get install ros-kinetic-catkin python-catkin-tools