Gear task#
A GearTask can be used to create a relation between two degrees of freedom.
It can be used to simulate the behaviour of a gear (with a given ratio) or a timing belt, but also of any other situation where a degree of freedom is mimicking the behaviour of another one.
Creating the task#
The gear task can be created by calling add_gear_task() on
the solver:
# Creating the gear task
gear_task = solver.add_gear_task()
gear_task.configure("gear", "hard")
Warning
Since a gear task is actually a contact, you also might want to
Add a task contact attached to the gear task
Set the torque of passive gears to zero
Refer to the example below for a detailed example.
Setting up the relations#
Relations can then be set by calling set_gear() on the task:
# Setting up the relations
gear_task.set_gear("joint1", "joint2", 2.0)
# After that, joint1 = 2 * joint2
The first two arguments are the names of the degrees of freedom that are linked together. The third argument is the
ratio between the two degrees of freedom. You can also call add_gear() to make
the relation multiple:
# Adding a gear relation
gear_task.set_gear("joint1", "joint2", 2.0)
gear_task.add_gear("joint1", "joint3", 3.0)
# After that, joint1 = 2 * joint2 + 3 * joint3
Example#
Here is an example with differential gears:
Differential
A differential gear system. At the end of the video, the torque is forced to zero to show the system’s behaviour when only subject to gravity.