Configuration.iter_differences
-
Configuration.
iter_differences
(other)[source] Generator over the differences to another Configuration’s joint_values.
If the joint type is revolute or continuous, the smaller difference (+/- 2*:math:pi) is calculated.
- Parameters
other (
Configuration
) – The configuration to compare to.- Yields
float
– The next difference to the Configuration’s joint_values.- Raises
ValueError – If the configurations are not comparable.
Examples
>>> c1 = Configuration.from_revolute_values([1, 0, 3]) >>> c2 = Configuration.from_revolute_values([1, 2 * pi, 4]) >>> allclose(c1.iter_differences(c2), [0.0, 0.0, -1.0]) True >>> c1 = Configuration.from_revolute_values([1, 0, 3]) >>> c2 = Configuration.from_revolute_values([1, -2 * pi - 0.2, 4]) >>> allclose(c1.iter_differences(c2), [0.0, 0.2, -1.0]) True