behavior planning——10 behaior planning pseudocode
One way to implement a transition function is by generating rough trajectories for each accessible "next state" and then finding the best. To "find the best" we generally use cost functions. We can then figure out how costly each rough trajectory is and then select the state with the lowest cost trajectory.
We'll discuss this in more detail later, but first read carefully through the pseudocode below to get a better sense for how a transition function might work.
def transition_function(predictions, current_fsm_state, current_pose, cost_functions, weights):
# only consider states which can be reached from current FSM state.
possible_successor_states = successor_states(current_fsm_state) # keep track of the total cost of each state.
costs = []
for state in possible_successor_states:
# generate a rough idea of what trajectory we would
# follow IF we chose this state.
trajectory_for_state = generate_trajectory(state, current_pose, predictions) # calculate the "cost" associated with that trajectory.
cost_for_state =
for i in range(len(cost_functions)) :
# apply each cost function to the generated trajectory
cost_function = cost_functions[i]
cost_for_cost_function = cost_function(trajectory_for_state, predictions) # multiply the cost by the associated weight
weight = weights[i]
cost_for_state += weight * cost_for_cost_function
costs.append({'state' : state, 'cost' : cost_for_state}) # Find the minimum cost state.
best_next_state = None
min_cost =
for i in range(len(possible_successor_states)):
state = possible_successor_states[i]
cost = costs[i]
if cost < min_cost:
min_cost = cost
best_next_state = state return best_next_state
Obviously we are glossing over some important details here. Namely: what are these cost functions and how do we create them? We'll talk about that next!
behavior planning——10 behaior planning pseudocode的更多相关文章
- Behavior Trees for Path Planning (Autonomous Driving)
Behavior Trees for Path Planning (Autonomous Driving) 2019-11-13 08:16:52 Path planning in self-driv ...
- HOW TO RUN A SPRINT PLANNING MEETING (THE WAY I LIKE IT)
This is a sample agenda for a sprint planning meeting. Depending on your context you will have to ch ...
- 运动规划 (Motion Planning): MoveIt! 与 OMPL
原创博文:转载请标明出处:http://www.cnblogs.com/zxouxuewei 最近有不少人询问有关MoveIt!与OMPL相关的话题,但是大部分问题都集中于XXX功能怎么实现,XXX错 ...
- Urban Planning and Public Health - Reflection on Professor Webster's article in Urban Planning Forum
1. General review. Professor Webster published this article in Urban Planning Forum, one of the top ...
- planning深度剖析
planning深度剖析 结合find命令过滤目录及文件名后缀: find /home/hadoop/nisj/automationDemand/ -type f -name '*.py'|xargs ...
- 运动规划 (Motion Planning): MoveIt! 与 OMPL---44
原创博文:转载请标明出处:http://www.cnblogs.com/zxouxuewei 最近有不少人询问有关MoveIt!与OMPL相关的话题,但是大部分问题都集中于XXX功能怎么实现,XXX错 ...
- Oracle Hyperion Planning 11.1 .1:创建与管理应用程序 第1课:Planning概述
第1课:Planning概述 1.说明 Oracle Enterprise Performance Management system Oracle Enterprise Performance Ma ...
- 2017.10.31 Enginer+position+statement
一.The basic information Post name Engineering manager Department Engineering Post member A24645 imme ...
- 《Note --- Unreal 4 --- behavior tree》
Web: https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/index.html Test project: D:\En ...
随机推荐
- SQLite in Python: 如何在Python中使用SQLite数据库
SQLite3 可使用 sqlite3 模块与 Python 进行集成.sqlite3 模块是由 Gerhard Haring 编写的.它提供了一个与 PEP 249 描述的 DB-API 2.0 规 ...
- VI/VIM编辑器快捷键
常用快捷键: Ctrl+f 向下翻页 Ctrl+b 向上翻页 G 移动到文件最后一行 gg 移动到文件第一行 N+回车 ...
- NoSQL最新现状和趋势:云NoSQL数据库将成重要增长引擎
NoSQL最早起源于1998年,但从2009年开始,NoSQL真正开始逐渐兴起和发展.回望历史应该说NoSQL数据库的兴起,完全是十年来伴随互联网技术,大数据数据的兴起和发展,NoSQL在面临大数据场 ...
- 前端怎么传一个map给JAVA
var map = {}; map['key1']=value1; map['key2']=value2; map['key3']=value3; map['key4']=value4; map['k ...
- 【Mobius绮丽的辗转】莫比乌斯反演
Problem 对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数为x和y的最大公约数. 1≤n≤50000,1≤a≤b≤5 ...
- linux系统搭建zookeeper集群
转载至:https://blog.csdn.net/weixin_38111957/article/details/82927878 一.引言 今天咱们就来搭建一下zookeeper集群,当然搭建集群 ...
- java 3 接口与多态&输入输出流
接口 中的所有方法都是方法 抽象 使用接口实现多继承 类型的装换 数据成员就变成了static 和 final food 和 snow 都是可以吃的 可以同时实现多个接口 接口与接口之间也可以有继承关 ...
- em grid control网格控制
网格控制 必须管理许多的数据库.应用服务器.web服务器和其他构件的企业可以采用em grid control Em grid control是一个基于web的用户界面,它与oracle企业内所有构件 ...
- Python内存机制简介
1: 变量不是盒子,应该把变量视作便利贴.变量只不过是标注,所以无法阻止为对象贴上多个标注.标注就是别名: >>> a = [1, 2, 3] >>> b = a ...
- C++简单读取 & 写入实例
#include <fstream> #include <iostream> using namespace std; int main () { ]; // 以写模式打开文件 ...