编译moveit!源码 .No module named catkin.init_workspace

安装moveit的时候,在原来的workspace下面添加了moveit的源码.但无论如何都无法进行catkin_make.进而,发现catkin_init_workspace也不好用.


ppeix:src$ catkin_init_workspace

Traceback (most recent call last):
  File "/opt/ros/hydro/bin/catkin_init_workspace", line 11, in
    from catkin.init_workspace import init_workspace
ImportError: No module named catkin.init_workspace


对比发现PYTHONPATH环境变量导致的.

正确的应该是  /opt/ros/hydro/lib/python2.7/dist-packages/catkin  等等这里有ros相关的python package.执行时能够得到调用.

配置python环境变量是通过/opt/ros/hydro/setup.sh  调用另一个_setup_utility.sh 来实现的.

但有另一个问题,如果使用python开发其他的软件包,是不是应当将PYTHONPATH环境变量,进行更多的追加呢?应当是,但当前还没有涉及到ros之外的python package开发.


搜了下pythonpath相关知识:

  PYTHONPATH是Python搜索路径,默认我们import的模块都会从PYTHONPATH里面寻找。

   使用下面的代码可以打印PYTHONPATH:

print(os.sys.path)

import  xx模块

from xx模块 import  yy函数

catkin_make编译不通过.  修改branch到hydro版本.

再次编译moveit_ros不通过,缺少moveit_core中的路径.看来只能一次下完全了,才能够编译.几个package之间相互有影响.

CMake Error at /home/ppeix/tutorials/catkin_ws/devel/share/moveit_core/cmake/moveit_coreConfig.cmake:106 (message):
  Project 'moveit_core' specifies
  '/home/ppeix/tutorials/catkin_ws/src/moveit_core/background_processing/include'
  as an include dir, which is not found.  It does neither exist as an
  absolute directory nor in
  '/home/ppeix/tutorials/catkin_ws/src/moveit_core//home/ppeix/tutorials/catkin_ws/src/moveit_core/background_processing/include'.
  Ask the maintainer 'Sachin Chitta , Ioan Sucan
  , Acorn Pooley ' to fix it.

紧接着错误, Could not find a configuration file for package cmake_modules.   解决办法:找到对应包中的CMakeList.txt,去掉对cmake_modules的依赖关系.

你可能感兴趣的:(机械臂)