Open-Source Leg#

class opensourceleg.osl.OpenSourceLeg(frequency: int = 200, file_name: str = 'osl')#

Bases: object

OSL class: This class is the main class for the Open Source Leg project. It contains all the necessary functions to control the leg.

Returns

none

Return type

none

add_joint(name: str = 'knee', port: Optional[str] = None, baud_rate: int = 230400, gear_ratio: float = 1.0, has_loadcell: bool = False, debug_level: int = 0, dephy_log: bool = False, offline_mode: bool = False) None#

Add a joint to the OSL object.

Parameters
  • name (str, optional) – The name of the joint, by default “knee”

  • port (str, optional) – The serial port that the joint is connected to, by default None. If None, the first active port will be used.

  • baud_rate (int, optional) – The baud rate of the serial communication, by default 230400

  • gear_ratio (float, optional) – The gear ratio of the joint, by default 1.0

  • has_loadcell (bool, optional) – Whether the joint has a loadcell, by default False

  • debug_level (int, optional) – The debug level of the joint, by default 0

  • dephy_log (bool, optional) – Whether to log the joint data to the dephy log, by default False

add_loadcell(dephy_mode: bool = False, joint: Optional[opensourceleg.hardware.joints.Joint] = None, amp_gain: float = 125.0, exc: float = 5.0, loadcell_matrix=None, offline_mode: bool = False) None#

Add a loadcell to the OSL object.

Parameters
  • dephy_mode (bool, optional) – Whether the loadcell is in dephy mode ie. connected to the dephy actpack with an FFC cable, by default False

  • joint (Joint, optional) – The joint that the loadcell is attached to, by default None

  • amp_gain (float, optional) – The amplifier gain of the loadcell, by default 125.0

  • exc (float, optional) – The excitation voltage of the loadcell, by default 5.0

  • loadcell_matrix (np.ndarray, optional) – The loadcell calibration matrix, by default None