myoconverter.xml.path_points.utils

This module contains a collection of utility functions useful for parsing and converting the OpenSim PathPointSet

@author: Aleksi Ikkala

Module Contents

Functions

update_moving_path_point_location(coordinate_name, ...)

Calculate median for a coordinate of a MovingPathPoint

get_moving_path_point_dependency(path_point, ...)

Get a MovingPathPoint's dependency on an independent coordinate.

plot_figure(x_values, y_values, fit, ...)

myoconverter.xml.path_points.utils.update_moving_path_point_location(coordinate_name, path_point)[source]

Calculate median for a coordinate of a MovingPathPoint

Parameters:
  • coordinate_name – Coordinate name (related x, y, or z coordinate)

  • path_point – OpenSim MovingPathPoint XML element

Returns:

Median of given coordinate

Raises:

RuntimeError: If a Coordinate is not found

Raises:

NotImplementedError: If a path point is not formatted as expected

Raises:

NotImplementedError: If a function type is other than ‘SimmSpline’, ‘NaturalCubicSpline’, or

‘PiecewiseLinearFunction’

myoconverter.xml.path_points.utils.get_moving_path_point_dependency(path_point, coordinate_name, socket_name, cfg, output_dir)[source]

Get a MovingPathPoint’s dependency on an independent coordinate.

Parameters:
  • path_point – OpenSim MovingPathPoint XML element

  • coordinate_name – Name coordinate (“x_location”, “y_location”, or “z_location”)

  • socket_name – Name of the specific coordinate socket (“socket_x_coordinate”, “socket_y_coordinate”, or

“socket_z_coordinate”) :param cfg: Contains all the global config definitions :param output_dir: Output directory for plots :return: Name of the independent coordinate (joint) path_point is dependent on, quartic polynomial of the dependency, and movement range :raises: RuntimeError: If a Coordinate was not found :raises: NotImplementedError: If a path point is not formatted as expected :raises: RuntimeError: If a MuJoCo joint that corresponds to a Coordinate cannot be found

myoconverter.xml.path_points.utils.plot_figure(x_values, y_values, fit, independent_joint, path_point_name, coord)[source]