Model.mechadjustballjoint#

Model.mechadjustballjoint(name, x, y, z, tolerance, lock, angle_step)#

Actuates a ball joint to reach a new value. The mechanism must have the enabled flag set to true for this to be possible.

Parameters:
  • name (hwString) – The name of the joint to adjust.

  • x (double) – The desired x Euler angle value of the joint.

  • y (double) – The desired y Euler angle value of the joint.

  • z (double) – The desired z Euler angle value of the joint.

  • tolerance (double) – The tolerance allowed when adjusting.

  • lock (unsigned int) – If set to 1, all joints in the mechanism which are not part of the cycle of the given joint are locked.

  • angle_step (double) – The size of the iterative steps used to solve for the new value of the joint. Only used for rotation.

Example#

Move a joint named “TORSO_to_RIGHT_UPPER_LEG” to x=20.0, y=0.0, z=0.0 with a tolerance of 0.001 , lock other joints and angle step equal to 0.0#
import hm
import hm.entities as ent

model = hm.Model()

model.mechadjustballjoint(
    name="TORSO_to_RIGHT_UPPER_LEG",
    x=20.0,
    y=0.0,
    z=0.0,
    tolerance=0.001,
    lock=1,
    angle_step=0.0,
)