The Distance constraint maintains a specific distance between the origins of two coordinate frames. The distance can be a fixed number or controlled by a kinematic configuration variable.
The constraint equation is:
where p_1 and p_2 are the origins of two coordinate frames and d is the desired distance between them.
Warning
This constraint is undefined when d = 0. If you want to constraint two points to be coincident, you can use the PointToPoint constraint instead.
Examples
puppet-basic.py, puppet-continuous-moving.py, puppet-moving.py
Create a new constraint to maintain the distance between frame1 and frame2.
frame1 and frame2 should be existing coordinate frames in system. They can be the Frame objects themselves or their names.
distance can be a real number or a string. If it is a string, the constraint will create a new kinematic configuration variable with that name.
This is the kinematic configuration variable that controls the distance, or None for a fixed distance constraint.
(read-only)
This is the desired constraint between the two coordinate frames. This is either the fixed value or the value of the configuration variable. If you set the distance, the appropriate value will be updated.
Calculate the current distance between the two coordinate frames. If the constraint is currently satisfied, this is equal to distance.
If you have the system in a configuration you like, you can use this to set the correct distance:
>>> constraint.distance = constraint.get_actual_distance()