myoconverter.xml.forces.Muscle

Contains a higher level Muscle parser.

@author: Aleksi Ikkala

Module Contents

Classes

Muscle

A parent class to handle common parsing tasks for muscle forces (actuators), like parsing path points.

class myoconverter.xml.forces.Muscle.Muscle(**kwargs)[source]

Bases: myoconverter.xml.parsers.IParser

A parent class to handle common parsing tasks for muscle forces (actuators), like parsing path points.

Note that we set only (arbitrary) default parameters for the muscles here, as they will be optimized later.

abstract _parse(xml, **kwargs)[source]

Muscle-specific parsers must implement this method.

Child classes must implement this method. This is called from the ‘parse’ method below. Add any calculations / conversions that weren’t included in the default calculations / conversions below.

Parameters:
  • xml – OpenSim muscle actuator XML element

  • kwargs – Optional keyword arguments

Returns:

None

parse(xml, **kwargs)[source]

This function handles general parsing and converting of muscle actuators.

Note that we set only (arbitrary) default parameters for the muscles here, as they will be optimized later.

Parameters:
  • xml – OpenSim muscle actuator XML element

  • kwargs – Optional keyword arguments

Returns:

None

Raises:

RuntimeError: If default values for ‘muscle’ class cannot be found in the MuJoCo model