Table des matières

TNY-360 Documentation

Leg

Leg module of the TNY-360 API (code 0x04).

This module contains actions related to the leg management of the robot, such as setting positions and getting status information.


List of actions

Here's a list of all the actions available in the leg module:

0x04 - 0x00

leg.setEnabled

Sets the enabled state of the joints in a leg.


Arguments

  • leg_iduint8

    -

    ID of the leg to set the enabled state for.

  • enabled_flaguint8

    -

    Bitfield representing the enabled state of each joint (bit 0 = hip, bit 1 = knee, bit 2 = ankle).


No return values

0x04 - 0x01

leg.getEnabled

Gets the enabled state of the joints in a leg.


Arguments

  • leg_iduint8

    -

    ID of the leg to get the enabled state for.


Return Values

  • enabled_flaguint8

    -

    Bitfield representing the enabled state of each joint (bit 0 = hip, bit 1 = knee, bit 2 = ankle).

0x04 - 0x02

leg.setPosition

Sets the target position of a leg.


Arguments

  • leg_iduint8

    -

    ID of the leg to set the position for.

  • x_mfloat32

    -

    X coordinate of the target position in meters.

  • y_mfloat32

    -

    Y coordinate of the target position in meters.

  • z_mfloat32

    -

    Z coordinate of the target position in meters.

  • clear_overridesbool

    -

    Whether to clear joint overrides when setting the position (default: true).


No return values

0x04 - 0x03

leg.getTargetPosition

Gets the target position of a leg.


Arguments

  • leg_iduint8

    -

    ID of the leg to get the target position for.


Return Values

  • posVec3f

    -

    Target position of the leg in meters.

0x04 - 0x04

leg.getGrounded

Gets whether a leg is currently grounded.


Arguments

  • leg_iduint8

    -

    ID of the leg to get the grounded state for.


Return Values

  • groundedbool

    -

    Whether the leg is currently grounded.

List of types

Here's a list of all the types used in the leg module:

Vec3f

A 3D vector with x, y, z components represented as floats.


Fields

  • xfloat32

    -

    The x component of the vector.

  • yfloat32

    -

    The y component of the vector.

  • zfloat32

    -

    The z component of the vector.