资源简介
多机器人路径规划算法,可视化界面显示,默认实验数据为实现4个机器人路径规划
代码片段和文件信息
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#include
#include
#include
#include “RVOSimulator.h“
void setupScenario( RVO::RVOSimulator * sim ) {
// Specify global time step of the simulation
sim->setTimeStep( 0.25f );
// Specify default parameters for agents that are subsequently added
sim->setAgentDefaults( 250 15.0f 10 2.0f 3.0f 1.0f 2.0f 7.5f 1.0f );
// Add agents (and simulataneously their goals) specifying their start position and goal ID
sim->addAgent( RVO::Vector2(-50.0f -50.0f) sim->addGoal( RVO::Vector2(50.0f 50.0f) ) );
sim->addAgent( RVO::Vector2(50.0f -50.0f) sim->addGoal( RVO::Vector2(-50.0f 50.0f) ) );
sim->addAgent( RVO::Vector2(50.0f 50.0f) sim->addGoal( RVO::Vector2(-50.0f -50.0f) ) );
sim->addAgent( RVO::Vector2(-50.0f 50.0f) sim->addGoal( RVO::Vector2(50.0f -50.0f) ) );
// Add (line segment) obstacles specifying both endpoints of the line segments
sim->addObstacle( RVO::Vector2(-7.0f -20.0f) RVO::Vector2(-7.0f 20.0f) );
sim->addObstacle( RVO::Vector2(-7.0f 20.0f) RVO::Vector2(7.0f 20.0f) );
sim->addObstacle( RVO::Vector2(7.0f 20.0f) RVO::Vector2(7.0f -20.0f) );
sim->addObstacle( RVO::Vector2(7.0f -20.0f) RVO::Vector2(-7.0f -20.0f) );
// Add roadmap vertices specifying their position
sim->addRoadmapVertex( RVO::Vector2(-10.0f -23.0f) );
sim->addRoadmapVertex( RVO::Vector2(-10.0f 23.0f) );
sim->addRoadmapVertex( RVO::Vector2(10.0f 23.0f) );
sim->addRoadmapVertex( RVO::Vector2(10.0f -23.0f) );
// Do not automatically create edges between mutually visible roadmap vertices
sim->setRoadmapAutomatic( false );
// Manually specify edges between vertices specifying the ID‘s of the vertices the edges connect
sim->addRoadmapEdge( 0 1 );
sim->addRoadmapEdge( 1 2 );
sim->addRoadmapEdge( 2 3 );
sim->addRoadmapEdge( 3 0 );
}
void updateVisualization( RVO::RVOSimulator * sim ) {
// Output the current global time
std::cout << sim->getGlobalTime() << “ “;
// Output the position and orientation for all the agents
for (int i = 0; i < sim->getNumAgents(); ++i) {
std::cout << sim->getAgentPosition( i ) << “ “ << sim->getAgentOrientation( i ) << “ “;
}
std::cout << std::endl;
}
int _tmain(int argc _TCHAR* argv[])
{
// Create a simulator instance
RVO::RVOSimulator * sim = RVO::RVOSimulator::Instance();
// Set up the scenario
setupScenario( sim );
// Initialize the simulation
sim->initSimulation();
// Perform (and manipulate) the simulation
do {
updateVisualization( sim );
sim->doStep();
} while ( !sim->getReachedGoal() );
delete sim;
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-05-26 05:16 doc\
目录 0 2008-05-26 05:16 doc\html\
文件 1536 2008-05-26 05:16 doc\html\annotated.html
文件 17254 2008-05-26 05:16 doc\html\class_r_v_o_1_1_r_v_o_simulator-members.html
文件 93981 2008-05-26 05:16 doc\html\class_r_v_o_1_1_r_v_o_simulator.html
文件 5927 2008-05-26 05:16 doc\html\class_r_v_o_1_1_vector2-members.html
文件 25047 2008-05-26 05:16 doc\html\class_r_v_o_1_1_vector2.html
文件 2302 2008-05-26 05:16 doc\html\compiling.html
文件 8175 2008-05-26 05:16 doc\html\doxygen.css
文件 1281 2008-05-26 05:16 doc\html\doxygen.png
文件 1482 2008-05-26 05:16 doc\html\files.html
文件 11907 2008-05-26 05:16 doc\html\functions.html
文件 11824 2008-05-26 05:16 doc\html\functions_func.html
文件 3776 2008-05-26 05:16 doc\html\globals.html
文件 2910 2008-05-26 05:16 doc\html\globals_defs.html
文件 2219 2008-05-26 05:16 doc\html\globals_func.html
文件 1967 2008-05-26 05:16 doc\html\index.html
文件 8925 2008-05-26 05:16 doc\html\params.html
文件 1762 2008-05-26 05:16 doc\html\tabs.css
文件 35 2008-05-26 05:16 doc\html\tab_b.gif
文件 706 2008-05-26 05:16 doc\html\tab_l.gif
文件 2585 2008-05-26 05:16 doc\html\tab_r.gif
文件 13096 2008-05-26 05:16 doc\html\using.html
文件 14614 2008-05-26 05:16 doc\html\vector2_8h.html
文件 10227 2008-05-26 05:16 doc\html\_r_v_o_simulator_8h.html
目录 0 2008-05-22 08:14 example\
文件 2973 2008-05-22 08:13 example\example.cpp
文件 878 2008-05-22 07:35 example\example.sln
文件 4253 2008-05-22 08:06 example\example.vcproj
目录 0 2008-05-26 05:03 include\
目录 0 2008-05-26 05:02 lib\
............此处省略21个文件信息
- 上一篇:pom配置详解
- 下一篇:嵌入式赛车小游戏 源代码
相关资源
- 智能扫地机器人全覆盖遍历路径规划
- 机械臂避障路径规划仿真 蚁群算法
- D_star Lite.zip
- 移动机器人路径规划
- PSO粒子群算法,用于路径规划算法
- 基于双粒子群算法的矿井搜救机器人
- 带时间窗车辆路径算法汇总
- 人工势场法路径规划方法之一
- 多机器人路径规划与协同避碰研究
- 人工势场法仿真 路径规划.zip
- 基于遗传算法的多机器人路径规划
- 栅格法路径规划
- path-planning 路径规划蚁群算法
- 路径规划算法RRT
- 离线路径规划
- 人工势场法路径规划,避障
- 一种基于可视图法的机器人全局路径
- 基于Dijkstra算法的路径规划算法
- 基于的天地图公交查询和路径规划
- 局部路径规划的人工势场法 源代码
- Astar路径规划
- A*算法的实现 路径规划
- 关于移动机器人路径规划的ppt,参考
- 基于模糊算法的移动机器人路径规划
- 基于遗传算法的机器人路径规划_崔瑾
- 基于A-StarA*算法的机器人路径规划
- 基于深度优先寻路的路径规划算法
- 蚁群算法解决路径规划问题ant.doc
- 机器人路径规划方法综述
- 路径规划综述.pptx
评论
共有 条评论