One common way to optimize robotics applications is called motion blending. This technique is appropriate for sequences of motions that consist for a large part of motions to auxiliary points, e.g. to move around obstacles. These auxiliary points usually need not be exactly approached by the robot’s endeffector. By allowing motions to auxiliary points to be blended over, the robot will move near those points, but will not come to a halt and instead move on to the next point. This on the one hand reduces the total time required for the robot to perform all motion steps, and on the other hand reduces mechanical stress, as less braking and accelerating is needed.
Consider the following two successive motions:
Both motions are executed synchronously and thus the robot will halt at point aux before moving on towards goal. This will also happen in the following example:
The first motion is executed asynchronously and thus the second motion can be planned and loaded to the Robot Control Core. However, the second motion will wait for the first to complete, as both affect the same device (see also Sect. 1.4.4). To blend between motions, the first motion can be parameterized to be blendable under certain conditions, which enables the second motion to take over control of the affected device instantaneously:
In this last example, the first motion is blendable at 80% of its execution progress. The second motion will be planned and loaded to the RCC while the first motion is being executed. Once the first motion has reached the defined progress, it will signal to the RCC that it can be blended. The RCC will then switch instantaneously to the second motion, which will then take over control of the robot.
When adding further motions to the sequence, blending is still possible:
Note that beginExecute() will return only as soon as the Activity has been started on the Robot Control Core. Thus, the third motion in the above example will only be planned and loaded once the second motion has taken over the first one.
The motion blending mechanism presented in this section is intended for optimization purposes. Note that it is not guaranteed that blending will be performed in all cases! In particular, if case of short motions which should be blended over, it is possible that the planning of successive motions takes too much time, which might lead to the blending condition to be ”‘missed”’. In this case, the motion to be blended will reach the given goal and the next motion will continue as if blending had not been specified. Thus, motion blending should never be used to avoid obstacles located at the motion target point!
Motion blending in the Robotics API is provided as an optimization technique on a best-effort basis, i.e. it is not guaranteed that blending is executed. Never use blending to avoid obstacles located at the blended motion’s target!
The blending mechanism will also work between motions of different types (e.g. linear and ptp motion), though not all types are supported.
Here is the Democode the Gif. (YouBot), which consist of two Applications. While the first one will not blend the RtActivities, the second one will.