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 ...
随机推荐
- day18 13.乐观锁介绍
乐观锁是使用版本字段,悲观锁是使用数据库底层的锁机制.mysql的类型timestamp(时间戳)有一个特点:插入数据不用管我,我取系统当前默认值.timestamp插入时间会记录,修改时间也会记录. ...
- bzoj 3598 [Scoi2014]方伯伯的商场之旅——数位dp
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3598 TJ:https://www.cnblogs.com/Zinn/p/9351218.h ...
- 转:Android新特性介绍,ConstraintLayout完全解析
转:http://blog.csdn.net/guolin_blog/article/details/53122387 本篇文章的主题是ConstraintLayout.其实ConstraintLay ...
- 利用 awk 将当前的链接按端口汇总倒排序
写了一行命令,利用 awk 将当前的链接按端口汇总倒排序 :) netstat -ano | awk /tcp.*:1[15].*:[1-5]/'{print $4}' | awk -F ':' ' ...
- go语言第一问:在其他地方执行编译go语言程序,结果会在哪个地方产生?
1.我们看执行编译go语言程序中命令,没有找到exe文件.
- Katalon系列十八:用例变量&用例间调用
一.用例变量写用例时,我们可以用代码定义变量,如:String name = '新闻'println(name) 上面是硬编码,我们也可以在用例里定义变量,只在该用例里生效哦,想跨用例就用全局变量. ...
- 获得CSM(Certified Scrum Master)-价值驱动交付。
2019年越来越多的企业开始实行敏捷转型,紧随时代潮流,学习最先进的科学管理方法,找到正确的人(团队),为企业交付高价值的产品服务. 导师Ethan ,培训的课程让人收益匪浅,活到老学到老,丰富的知识 ...
- WatchKit编程指南:概览--Watch应用的体系结构
Apple Watch应用程序包含两个部分:Watch应用和WatchKit应用扩展.Watch应用驻留在用户的Apple Watch中,只含有故事板和资源文件,要注意它并不包含任何代码.而Watch ...
- UWP获取任意网页加载完成后的HTML
主要思想:通过后台WebView载入指定网页,再提取出WebView中的内容 关键代码: var html = await webView.InvokeScriptAsync("eval&q ...
- LeetCode136 Single Number, LeetCode137 Single Number II, LeetCode260 Single Number III
136. Single Number Given an array of integers, every element appears twice except for one. Find that ...