Jay
Jay

Moveit!增加Planner

Moveit!增加Planner

Thanks to these authors:

https://bitbucket.org/ompl/ompl/downloads/

https://github.com/ros-planning/moveit/tree/master

https://answers.ros.org/question/296238/custom-state-sampler-in-moveit/

https://blog.csdn.net/sinat_23853639/article/details/87854461?tdsourcetag=s_pcqq_aiomsg

准备工作:

使用'catkin build'需要安装python-catkin-tools

在终端中输入sudo apt-get install python-catkin-tools

由于上个教程中安装的是完整包,因此需要卸载moveit!

sudo apt-get remove ros-kinectic-moveit-*

https://blog.jay6.tech/wp-content/uploads/2020/02/2-1-300x180.png

没卸载干净的话 sudo apt-get autoremove

先建一个新的工作空间,举例:moveit_ws

从先前的工作空间拖入src文件夹,intera.sh

在工作空间下

wstool init src
wstool merge -t src https://raw.githubusercontent.com/ros-planning/moveit/master/moveit.rosinstall
wstool update -t src
rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO}
catkin config --extend /opt/ros/${ROS_DISTRO} --cmake-args -DCMAKE_BUILD_TYPE=Release

进入src

git clone -b kinetic-devel https://github.com/ompl/ompl.git
cd ompl
wget https://raw.githubusercontent.com/ros-gbp/ompl-release/debian/kinetic/xenial/ompl/package.xml

修改LIB安装目录(此处有大坑)估计32位64为系统也不同

打开../ompl/src/ompl/CMakeList.txt ,定位 ${CMAKE_INSTALL_LIBDIR}

这个地方有两种说法,一种改为 “/opt/ros/kinetic/lib/x86_64_linux_gnu” 或者 "/opt/ros/kinetic/lib/"

请注意 打开 /opt/ros/kinetic/lib 查看 会发现有两个x86_64-linux-gnu 里面有众多lib的才是正确的文件夹

笔者这里修改cmakefile.txt 将ompl的lib安装到 "/opt/ros/kinetic/lib/" 和 “/opt/ros/kinetic/lib/x86_64-linux-gnu

修改代码如下

install(TARGETS ompl
    DESTINATION "/opt/ros/kinetic/lib"
    COMPONENT ompl)
install(TARGETS ompl
    DESTINATION "/opt/ros/kinetic/lib/x86_64-linux-gnu"
    COMPONENT ompl)

这个时候就可以到工作空间根目录sudo catkin build了(动opt需要root权限)

无报错 继续下面的增加planner

 

开始

在src/ompl/src/ompl/geometric/planners 下面新建一个文件夹 例如 cxkplanner

在cxkplanner目录下新建src,去其他算法文件夹拖头文件和cpp,放到对应目录

此处以RRTstar为例

将rrtstar.h改为cxkplanner.h

gedit 搜索文件内所有RRTstar 替换为cxkplanner

https://blog.jay6.tech/wp-content/uploads/2020/02/3-300x13.png

同理操作src下的cpp文件

https://blog.jay6.tech/wp-content/uploads/2020/02/4-300x270.png

打开并修改planning_context_manager.cpp(src/moveit/moveit_planners/ompl/ompl_interface/src)

https://blog.jay6.tech/wp-content/uploads/2020/02/5-300x266.png

打开并修改ompl_planning.yaml(src/sawyer_moveit/sawyer_moveit_config/config)

https://blog.jay6.tech/wp-content/uploads/2020/02/8-300x45.png

抄RRTstar的
https://blog.jay6.tech/wp-content/uploads/2020/02/9-300x133.png

按照前面的例子 运行moveit!

https://blog.jay6.tech/wp-content/uploads/2020/02/10.png

 

 

 

build完可能遇到的问题:

TAB补全时出现Warning: error while crawling /home/jay: boost::filesystem::status: Permission denied

cd
~$ sudo umount /home/xxx/.gvfs //xxx是自己用户名
~$ rm -rf .gvfs/

发表评论

textsms
account_circle
email

Jay

Moveit!增加Planner
Thanks to these authors: https://bitbucket.org/ompl/ompl/downloads/ https://github.com/ros-planning/moveit/tree/master https://answers.ros.org/question/296238/custom…
扫描二维码继续阅读
2019-07-22