|
本帖最后由 zorsite 于 2016-5-9 21:38 编辑
5 L( T/ J# b) m1 c y' O, G$ t% O9 x4 M4 Y) `
叉车的默认加速度为1,最大速度为2。如果移动20米的距离,需要多长时间?小车的运行过程:
: X' I; u: m$ b% j# J6 B& A3 K" H速度从0开始,加速到2,需要2秒时间,移动距离2米。& V" T8 g* y I& ~5 m2 ]; [8 m
然后匀速移动8秒,移动距离16米。
R6 \/ J- l0 [' J+ y 减速过程同加速过程,需要2秒时间,移动距离2米。% b3 z3 A0 w5 E+ a0 c" D
整个过程需要12秒的时间,但是在模型中验证的时候耗时11秒。
. i" M: _9 Y9 T; A# d8 G2 ~2 a8 }5 M
& \. u7 X$ w# `注意:请剔除叉车的叉上下移动时间,可以尝试着将叉车的提升速度设置为100000.
) T* k( J' B4 w! T" q8 L1 D- f; B2 ]1 u3 U
问题出在哪儿呢?在执行任务的时候,叉车只有加速度,没有减速度。也就是说,叉车是以最大速度抵达目的地,而非减速至0抵达目的地。
( x! g( n; Q- {! G3 x: X4 s! t
2 U9 S- J+ t6 ~* t8 }' r" f3 F如何解决这一问题?在为叉车分配任务时,需要增加一个参数。默认任务代码如下:- inserttask(ts,TASKTYPE_TRAVEL, destination,NULL);
复制代码 修改为:- inserttask(ts,TASKTYPE_TRAVEL, destination,NULL,-1);
复制代码 具体参见用户手册关于该参数的说明:
: g, G# D8 T# k3 `" d) u7 o0 b$ t4 t% o
This specifies the desired end speed for the travel operation. If 0, then the desired end speed will be the maximum speed of the TaskExecuter. A positive value will use that value directly as the end speed. If the end speed is negative, then the functionality is dependent on the navigator's logic. The standard navigators, i.e. the default navigator and the network navigator will interpret negative end speeds as an end speed of 0. Other non-standard navigators may however use a negative end speed value to customize the logic for how to get the TaskExecuter to the destination, allowing the modeler to use different negative end speeds on travel tasks to effect customized travel logic.
8 X3 R4 z2 C; C3 V0 S3 m该参数默认为0,表示到达目的地时不减速。
4 T& A m+ v' N如果为负数,通常(比如沿网络节点运行)表示到达目的地时减速为0.
+ i* }: [8 c3 M3 W9 R还可以是其他的正数值,表示减速至该速度到达目的地。
; _, l# U# N, R1 H) P% y |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|