TransformToBlackboard (or TfToBB)
Closed this issue · 4 comments
@peterpena do you have some example behaviour that alludes to what you're looking for? Failing that, basic inputs/outputs?
If I had to hazard a guess to get started:
Construction
- two input strings on behaviour creation - the
from' and
to' links - a variable name for storage on the blackboard
Runtime
SUCCESS
if a transform could be retrievedRUNNING
orFAILURE
depending on whether you would like the behaviour to be blocking or non-blocking if it could not retrieve the result (I would probably create both blocking and non-blocking counterparts for this)
I think this is good. Behavior will be something around the lines of: Is the position close enough to a frame of reference? Maybe adding a CheckTransform for bt will also be useful. So we can guard against any frames not existing and then we can get the transform safely with a success.
Being be able to add a transform from the behavior tree will also be good. Behaviors that will be useful for BT:
- AddTransform
- CheckTransform
- GetTransform
AddTransform - #120
CheckTransform & GetTransform
You'll want to have the Transform2Blackboard
behaviour early on in the tree tick and have other behaviours then just use the blackboard. This will make sure that you have a single valid transform value that doesn't change across the tick (and also simplify your other behaviours so that they don't need to handle any esoteric middleware api). In that sense, CheckTransform
can be either a directly blackboard variable lookup or just aCheckBlackboardVariableValue
behaviour (with some supporting methods for convenient transform operations that aren't in the core libraries). Similarly GetTransform
can just be a blackboard variable lookup inside your other custom behaviours.
Other
I think for the Transform2Blackboard
behaviour, we should probably have a second variable which indicates whether the transform was extracted or not. Then the original transform variable can maintain the last extracted transform
, which may actually have been extracted some ticks ago.