Skip to main content
This example considers the gear mechanism shown below. gear mechanism A relation is created between two revolute joints to simulate a gear with a ratio 2 M. Commands are used to enforce the ratio of velocities between the two wheels, and create a linear relation between rotational velocities, defined by: (1)*ω 1 + (-2)*ω2 = 0 First, the joint objects are retrieved using their IDs:
retrieving joint objects Next, the relationship between the two wheels is defined. The complete list of commands is shown below. A description of these commands follows. defining relationship
  1. A relation object is created and specified as a relation between velocities:
  2. The constant coefficients that appear in the relation are created. The first constant term is created by:
  3. The second coefficient and constant right hand side are created by:
  4. The first term of relation (1) X ω_1 is added to the relation object:
    The first argument is the joint object. The second argument defines the DOF (degrees of freedom) of the joint that are involved in the relation. Here, 0 represents the rotation, which is the joint’s first and only DOF is the rotation.
  5. The second term and right hand side are introduced in the same manner:
  6. The relation is added to the list of relations: