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
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值