Core Framework (Internal)#
Warning
This section documents the internal core framework. Users should not use these classes directly.
Base Module#
- class go2.core.module.DogModule(name: str)[source]#
Bases:
ABCBase class for all dog functionality modules.
This class defines the common lifecycle shared by all internal modules (e.g., movement, video, etc.). Modules are not meant to be interacted with or instaniated directly. Users should only interact with initialized modules via
Go2Controller.Notes
All modules must implement
initializeandshutdown.Initialization is idempotent and guarded by
_initialized.Modules are created and managed by the module registry.
See also
ModuleRegistry- abstract _initialize() None[source]#
Initialize the module.
This method is called once during module registration to a
Go2Controllerinstance. This should not be called by users.
- final _set_hardware_internal(hardware_type: HardwareType) None[source]#
Intitializes the module to use a specific
HardwareType. This should not be called by users.
Hardware Control#
Movement Hardware Interface#
- class go2.hardware.hardware_interface_movement.HardwareInterfaceMovement[source]#
Bases:
ABCAbstract interface for movement-related robot hardware control.
This interface defines the minimum set of motion and posture commands required by the system.
Notes
This is an internal abstraction.
Users should not subclass this directly.
- abstract _initialize() None[source]#
Initialize the movement hardware interface. This is handled automatically and shouldn’t be called by users. Hardware initialization is linked to the core controller’s initialization. The hardware is guaranteed to be initialized before any other system provided by this package.
Establishes communication with the native or virtual backend.
- abstract _move(vx: float, vy: float) None[source]#
Move the dog in the horizontal plane.
- Parameters:
vx (float) – Forward/backward velocity.
vy (float) – Left/right velocity.
- abstract _rotate(vrot: float)[source]#
Rotate the dog in place.
- Parameters:
vrot (float) – Rotational velocity.
Native Movement Hardware#
- class go2.hardware.native.native_hardware_movement.NativeHardwareMovement[source]#
Bases:
HardwareInterfaceMovementMovement hardware interface to execute on the Unitree GO2 itself.
This implementation communicates with the real robot using
unitree_sdk2py. It can only used for native execution on the robot.Warning
This class issues real hardware commands.
Improper use may cause unexpected robot motion.
- _initialize() None[source]#
Initialize the Unitree SDK connection.
This method sets up DDS communication and initializes the sport client.
- _move(vx: float, vy: float) None[source]#
Move the dog in the horizontal plane.
- Parameters:
vx (float) – Forward/backward velocity.
vy (float) – Left/right velocity.
- _rotate(vrot: float)[source]#
Rotate the dog in place.
- Parameters:
vrot (float) – Rotational velocity.
Virtual Movement Hardware#
- class go2.hardware.virtual.virtual_hardware_movement.VirtualHardwareMovement[source]#
Bases:
HardwareInterfaceMovementVirtual movement hardware backend for development and testing.
This implementation mimics robot functionality using the Unitree provided Mujoco simulator. The simulator is launched via seperate process during initialization of the hardware.
Dependencies#
- _initialize() None[source]#
Initialize the movement hardware interface. This is handled automatically and shouldn’t be called by users. Hardware initialization is linked to the core controller’s initialization. The hardware is guaranteed to be initialized before any other system provided by this package.
Establishes communication with the native or virtual backend.
- _move(vx: float, vy: float) None[source]#
Move the dog in the horizontal plane.
- Parameters:
vx (float) – Forward/backward velocity.
vy (float) – Left/right velocity.
- _rotate(vrot: float)[source]#
Rotate the dog in place.
- Parameters:
vrot (float) – Rotational velocity.
LIDAR Hardware Interface#
- class go2.hardware.hardware_interface_lidar.HardwareInterfaceLIDAR[source]#
Bases:
ABCAbstract interface for lidar-related robot hardware control.
This interface defines intialization and handling of communication reqeuired by the system.
Notes
This is an internal abstraction.
Users should not subclass this directly.
- abstract _initialize() None[source]#
Initialize the lidar hardware interface. This is handled automatically and shouldn’t be called by users. Hardware initialization is linked to the core controller’s initialization. The hardware is guaranteed to be initialized before any other system provided by this package.
Establishes communication with the native or virtual backend.
Native LIDAR Hardware#
- class go2.hardware.native.native_hardware_lidar.NativeHardwareLIDAR[source]#
Bases:
HardwareInterfaceLIDAR- _initialize()[source]#
Initialize the lidar hardware interface. This is handled automatically and shouldn’t be called by users. Hardware initialization is linked to the core controller’s initialization. The hardware is guaranteed to be initialized before any other system provided by this package.
Establishes communication with the native or virtual backend.
Virtual LIDAR Hardware#
- class go2.hardware.virtual.virtual_hardware_lidar.VirtualHardwareLIDAR[source]#
Bases:
HardwareInterfaceLIDAR- _initialize()[source]#
Initialize the lidar hardware interface. This is handled automatically and shouldn’t be called by users. Hardware initialization is linked to the core controller’s initialization. The hardware is guaranteed to be initialized before any other system provided by this package.
Establishes communication with the native or virtual backend.
Module Management#
- class go2.core.registry.ModuleDescriptor(_module_type: ModuleType, _module_class: Type[T], _display_name: str, _requires_native_hardware: bool = False, _requires_advanced_execution: bool = False)[source]#
Bases:
Generic[T]Descriptor linking a module type to its implementation.
Contains all metadata required to construct and display a module in the system.