pykdl安装 pykdl_utils

http://wiki.ros.org/pykdl_utils

github下载地址:https://github.com/gt-ros-pkg/hrl-kdl.git
包名:hrl-kdl
1、工作空间
1.1 新建工作空间:

mkdir -p ~/cakin_ws/src
cd ~/catkin_ws/
catkin_make  #初始化工作空间1.2  已有工作空间

2、 将包下载到工作空间的src下

cd cakin_ws/src
git clone https://github.com/gt-ros-pkg/hrl-kdl.git
cd ..
catkin_make #编译包,依照.xml

3、 安装pykdl_utils

cd hrl-kdl/pykdl_utils
python setup.py  #无法找到包

若显示

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

上述python无法定位到下载的包,进行下列操作

python setup.py build
 sudo python setup.py install

安装完成后显示

running install
running build
running build_py
running install_lib
creating /usr/local/lib/python2.7/dist-packages/pykdl_utils
copying build/lib.linux-x86_64-2.7/pykdl_utils/kdl_parser.py -> /usr/local/lib/python2.7/dist-packages/pykdl_utils
copying build/lib.linux-x86_64-2.7/pykdl_utils/joint_kinematics.py -> /usr/local/lib/python2.7/dist-packages/pykdl_utils
copying build/lib.linux-x86_64-2.7/pykdl_utils/__init__.py -> /usr/local/lib/python2.7/dist-packages/pykdl_utils
copying build/lib.linux-x86_64-2.7/pykdl_utils/kdl_kinematics.py -> /usr/local/lib/python2.7/dist-packages/pykdl_utils
byte-compiling /usr/local/lib/python2.7/dist-packages/pykdl_utils/kdl_parser.py to kdl_parser.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/pykdl_utils/joint_kinematics.py to joint_kinematics.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/pykdl_utils/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/pykdl_utils/kdl_kinematics.py to kdl_kinematics.pyc
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/pykdl_utils-0.1.0.egg-info

4、 检测是否安装成功

python
 from pykdl_utils.kdl_kinematics import KDLKinematics  #若无报错,则成功安装

5、 一般错误是catkin_make找不到该包,因此import不成功

若 4 步骤在python中import不成功,则返回 2 步骤,在工作空间中

cd catkin_ws
catkin_make clean #清除catkin_make
catkin_make   #重新编译

6、 查看指令帮助

python setup.py --help-commands

你可能感兴趣的:(ros)