前言
曾今在本科的时候接触过
,那时候还是为了做3D建模.
最近由于一些原因又重温了一下
,发现如今的
越发强大和完善了,开源社区也非常活跃,越来越多开发者参与到其中.
就比如我今天要讲的
路径规划算法,也被人在
上实现了一把,并且用于
机器人的路径规划计算上面.
简介
本文主要解决如何在ROS上面使用Humanoid Robots Lab at the Albert-Ludwigs-University in Freiburg, Germany实验室编写的人形机器人路径规划模块
主要分为以下几个步骤进行:
- 安装最新版本的
. (以Ubuntu12.04为例)
- 安装
库,并进行编译.
- 如何使用
库进行人形机器人的路径规划
安装ROS
安装步骤参考.
在Ubuntu12.04上面安装有一个好处就是使用apt工具安装相对较简单,省去自行下载代码并安装相应支持库的麻烦.
现在的最新版本的
代号为
步骤如下:
1 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
|
1 | wget http://packages.ros.org/ros.key -O - | sudo apt-key add - |
1
2
3
4
5
6
7 | sudo apt-get update
sudo apt-get install ros-hydro-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/hydro/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-rosinstall |
安装humanoid_navigation包
安装步骤参考.
在Ubuntu上面安装这个包在编译的时候会遇到一些问题,是由于boost版本与需要的版本不匹配造成的.
这个包依赖的相关库需要
版本,所以首先安装一下
.
1 | sudo apt-get install libboost1.46-all-dev |
之后进行humanoid_navigation包的安装,其步骤如下,编译时候会缺少一些ros自带的库:
1
2
3 | mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace |
1
2
3
4 | wstool init
wstool set humanoid_msgs --git https://github.com/ahornung/humanoid_msgs
wstool set humanoid_navigation --git https://github.com/ahornung/humanoid_navigation -v hydro-devel
wstool update |
1
2 | sudo apt-get install ros-hydro-humanoid-*
sudo apt-get install ros-hydro-octomap-*
|
1
2
3 | source ~/catkin_ws/devel/setup.bash
cd ~/catkin_ws
catkin_make |
使用humanoid_navigation包
使用步骤参考.
编译好之后就可以使用
下面的
进行路径规划了.
其提供了3种规划算法和3种启发式,分别由
1 | /footstep_planner/planner_type
|
和
1 | /footstep_planner/heuristic_type
|
这两个参数控制,如下:
- “ARAPlanner”: A* (ARA*)
- ADPlanner: Anytime Dynamic A* (AD*)
- RSTARPlanner: Randomized A* (R*)
启发式:
- “EuclideanHeuristic”: Straight-line distance to the goal
- “EuclStepCostHeuristic”: Straight-line distance to the goal with added footstep costs
- “PathCostHeuristic”: Distance along 2D path pre-planned with A* (preferred). This heuristic works best in most cases, as it is most informed of the environment. Note that it is potentially inadmissible in the case of stepping over obstacles.
使用这个包进行一些模拟演示:
1 | roslaunch footstep_planner footstep_planner_complete.launch |
演示时使用
按钮设置开始点以及方向.
使用
设置目标点以及朝向.
选择之后需要等一会才会产生结果.
演示结果类似下图:
控制参数改变路径规划算法:
1 | rosparam set /footstep_planner/planner_type ADPlanner |
参考文献