catkin: command not found解决方案

来源:互联网 发布:郑州菜鸟网络 编辑:程序博客网 时间:2024/05/16 20:57

环境

Ubuntu 14.04 + ROS indigo

今天编译一个slam建图工具,提示“catkin: command not found”。

我比较奇怪的是,我是按照官方教程安装的ROS,按理说应该catkin应该也被安装进去了。至少我在终端输入catkin_然后TAB键后还是会有一些命令:

这里写图片描述

但是唯独catkin命令不存在。

解决方案:

git clone https://github.com/ros/catkin.gitcd catkingit branch indigo-develmkdir buildcd buildcmake ..make -j8 && make installpython2 setup.py installpython3 setup.py install

这里最后一步可能会报错,提示信息大概是Python命令错误,只需要修改/build/catkin_generated/python_distutils_install.sh即可,把

    CATKIN_BINARY_DIR="/home/files/catkin/build" \    "/home/conda/bin/python" \    "/home/files/catkin/setup.py" \

改为:

    CATKIN_BINARY_DIR="/home/files/catkin/build" \    "/usr/bin/python" \    "/home/files/catkin/setup.py" \

即使用原生Python而非Conda Python

最后安装一些依赖就可以了:

sudo apt install autotools-dev ccache doxygen dh-autoreconf git liblapack-dev libblas-dev libgtest-dev libreadline-dev libssh2-1-dev pylint clang-format-3.8 python-autopep8 python-catkin-tools python-pip python-git python-setuptools python-termcolor python-wstool --yes

然后终端输入catkin --help,就会有如下提示:

usage: catkin [-h] [-a] [--test-colors] [--version]              [--force-color | --no-color]              [build | clean | config | create | env | init | list | locate | profile]              ...catkin commandoptional arguments:  -h, --help            show this help message and exit  -a, --list-aliases    Lists the current verb aliases and then quits, all                        other arguments are ignored  --test-colors         Prints a color test pattern to the screen and then                        quits, all other arguments are ignored  --version             Prints the catkin_tools version.  --force-color         Forces catkin to output in color, even when the                        terminal does not appear to support it.  --no-color            Forces catkin to not use color in the output,                        regardless of the detect terminal type.catkin command:  Call `catkin VERB -h` for help on each verb listed below:    build   Builds a catkin workspace.    clean   Deletes various products of the build verb.    config  Configures a catkin workspace's context.    create  Creates catkin workspace resources like packages.    env         Run an arbitrary command in a modified environment.    init    Initializes a given folder as a catkin workspace.    list    Lists catkin packages in the workspace or other arbitray folders.    locate  Get the paths to various locations in a workspace.    profile Manage config profiles for a catkin workspace.  [build | clean | config | create | env | init | list | locate | profile]