Functional Overview#
MotorNet Classes
Being built in Python, Motornet is an object-oriented toolbox. There are four object classes to consider.
Muscle
objects.Skeleton
objects.Effector
objects.Environment
objects.
Muscle class
Muscle
objects handle muscle dynamics,
and muscle state generation.
Skeleton class
Skeleton
objects hold skeleton and
geometry information, handle skeleton (motion) dynamics, generate joint states. and can convert joint states to
cartesian states.
Effector class
Effector
objects handle coordination of
information flow between Muscle
and
Skeleton
objects. They hold information
about how muscles wrap around the skeleton, apply moment arms to forces generated by muscles to compute
moment-adjusted (or generalized) forces that will be applied to skeletons. They also perform numerical integration.
Network class
Network
objects hold network weights,
perform the forward pass, and apply the feedback delays based on feedback properties held by the plant. They can
also send a request to the Task object to recompute the target states online. This is useful if one wants the
inputs to adjust based on some variable whose value changes over the trial.
Environment class
Environment
objects are subclasses of
gymnasium's
Env
class. They wrap around the Effector
class and provide a gymnasium-like API, which enables interfacing of MotorNet with gymnasium-compatible pipelines and
packages.
The Environment
class also holds an
observation buffer that enables feedback delays to be implemented. It can apply noise to the action input and the
observation output, as well as proprioception- and vision-specific noise if desired.
Class Hierarchy
The classes presented above rely on each other to function correctly. Consequently, they must be declared in a sensible order, so that each instance retains as attribute the instances on which they rely. This leads to a hierarchical class structure, where each instance lives in the computer memory in a nested fashion with other instances. The illustration below displays how this hierarchy is organized.
Representation of the hierarchical relationship between class instances in MotorNet.
Information Flow at Runtime
Computation Steps
The figure below summarizes the operations performed at runtime, as well as what how information flows between class instances.
- Receive action input
- Pass on actions
- Pass on actions
- Return forces
- Send moment-adjusted (generalized) forces
- Return new joint & cartesian states
- Return feedback states
- Store states to observation buffer
- Return (potentially delayed) observations & instantaneous states
Representation of information flow at runtime in MotorNet.
State Flow
A dedicated tutorial (available here) breaks down how states are generated and how they flow during computation. This is summarized in the illustration below, which is reproduced here for convenience.
Representation of the state flow at runtime in MotorNet.