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 ...
随机推荐
- golang之结构体
Go 语言使用结构体和结构体成员来描述真实世界的实体和实体对应的各种属性. Go语言通过用自定义的方式形成新的类型,结构体是类型中带有成员的复合类型. Go 语言中的类型可以被实例化,使用new或&a ...
- 【python之路9】类型定义与转换
一.整型(int),int的作用 1.创建int类型并赋值 n = 10 或者 n = int(10) #只要是类名加括号,都会去执行类中的 __init__()方法 n = 10,实际内部会去执 ...
- go 文件操作 io
package main import ( "fmt" "os" ) func main() { //打开文件 //概念说明: file 的叫法 //1. fi ...
- 电脑上做的ppt拿到别的电脑或手机上播放的时候字体错位的解决方法
原因:字体不对!!! 比如你英文用的Calibri字体,但是手机的wps或者别的电脑上的低版本的office没有这个字体,所以就会强制转换成那里有的字体(一般是黑体),此时字体就会错位!! 不要以为那 ...
- Leetcode2.Add Two Numbers两数相加
给定两个非空链表来表示两个非负整数.位数按照逆序方式存储,它们的每个节点只存储单个数字.将两数相加返回一个新的链表. 你可以假设除了数字 0 之外,这两个数字都不会以零开头. 示例: 输入:(2 -& ...
- 【软件安装】我喜欢的notepad插件
1.文件管理器 explorer 2.16进制查看文件工具 HEX-Editor
- pom.xml中若出现jar not found;
pom.xml中若出现jar not found;我们可以直接在view ->tool windows ->Maven Project 中直接install
- JDK源码解析string之二
(28) public boolean startsWith(String prefix, int toffset) { char ta[] = value; int to = toffset; ch ...
- 【风马一族_mysql】mysql基本指令
船停在港湾是很安全的,但那不是造船的目的! 用户 创建用户 mysql>grant 权限(select,insert,update,delete) on 数据库.数据表 to 用户名@电脑 ...
- Xici drop flower
var xici_user_api = "http://www.xici.net/apps/wedding/?method=wedding.user.getusername&from ...