Tween¶
The tween plugin moves a body from it’s start location to a relative end position.
This can be done using a variety of tween modes and easings.
Modes¶
yoyo- move back and forth between the start and end position repeatedlyonce- move to the end position and stoploop- move to the end position then teleport back, then repeat indefinitelytrigger- move towards the end position if the “trigger_topic” ros topic recievestrue, move towards start otherwise.
Easings¶
The default easing is “linear”, but the following is a complete list of supported easing modes:
linearquadraticIn,quadraticOut,quadraticInOutcubicIn,cubicOut,cubicInOutquarticIn,quarticOut,quarticInOutquinticIn,quinticOut,quinticInOutexponentialIn,exponentialOut,exponentialInOutcircularIn,circularOut,circularInOutbackIn,backOut,backInOutelasticIn,elasticOut,elasticInOutbounceIn,bounceOut,bounceInOut
You can see visual examples of these easing modes here at easings.net.
Configuration¶
plugins:
# required, specify Tween type to load the plugin
- type: Tween
# required, name of the plugin, unique within the model
name: MyTweenPlugin
# The tween mode (documented above, default 'yoyo')
mode: yoyo
# The easing mode (documented above, default 'linear')
easing: cubicInOut
# The ROS topic name to subscribe to for 'trigger' mode ("/tween_trigger")
# This will respect model namespaces
# e.g. if this model has namespace "foo", it will publish on "/foo/tween_trigger"
trigger_topic: tween_trigger
# animation duration in seconds (default 1 second)
duration: 10
# The tween delta pose (delta x, y and angle)
# The following will move the object to x += 2, y += 3, and angle += 1.1
# relative to the start position
delta: [2, 3, 1.1]
# The model body to move
body: some_body