toddlerbot.tools package

Submodules

toddlerbot.tools.audio_player_async module

toddlerbot.tools.calibrate_zero module

toddlerbot.tools.edit_keyframe module

toddlerbot.tools.joystick module

toddlerbot.tools.keyboard module

Keyboard input handler for robot control actions.

This module provides a simple keyboard interface for triggering specific actions via key presses. It uses pynput to capture keyboard events and map them to registered callback functions.

class toddlerbot.tools.keyboard.Keyboard

Bases: object

A class for handling keyboard input events.

check(name: str, **kwargs)

Checks and updates the state of a key input, triggering associated functions.

This method evaluates the current state of a specified key input. If the key input is active and has not been flagged, it triggers the associated function and updates the flag. If the key input is inactive and has been flagged, it resets the flag.

Parameters:
  • name (str) – The name of the key input to check.

  • **kwargs – Additional keyword arguments to pass to the associated function.

get_keyboard_input() Dict[str, float]

Retrieve the current state of keyboard inputs.

Returns:

A dictionary mapping key identifiers to their respective input values.

Return type:

Dict[str, float]

on_press(key)

Handle key press events to update key input states.

This method updates the key_inputs dictionary based on the character of the key pressed. Specifically, it sets the value to 1.0 for the ‘save’ key when ‘s’ is pressed and for the ‘next’ key when ‘n’ is pressed. Special keys are ignored.

Parameters:

key – The key event object containing information about the key press.

on_release(key)

Handle key release events to update key input states.

This method is triggered when a key is released. It specifically checks for the ‘s’ and ‘n’ keys and resets their corresponding states in the key_inputs dictionary to 0.0. If the released key does not have a character attribute, the exception is caught and ignored.

Parameters:

key – The key event object containing information about the released key.

register(name: str, func: Callable)

Registers a function to a specified key if the key is already present in key_inputs but not in key_funcs.

Parameters:
  • name (str) – The key associated with the function to be registered.

  • func (Callable) – The function to be registered under the specified key.

toddlerbot.tools.overlay_eval module

toddlerbot.tools.run_sysID module

toddlerbot.tools.sim2real_eval module

toddlerbot.tools.teleoperate module

toddlerbot.tools.zmq_jpeg_receiver module

Module contents

Tools and utilities for ToddlerBot development and operation.

This package contains various development and operational tools for working with the ToddlerBot system, including:

  • System identification and motor calibration tools

  • Zero-point calibration utilities

  • Keyframe animation editor for motion design

  • Teleoperation interfaces and controllers

  • Audio processing and communication tools

  • Simulation-to-real transfer evaluation tools

  • ZMQ-based communication utilities

  • Keyboard and joystick input handlers

These tools support the entire development workflow from initial setup and calibration through policy development, testing, and deployment on real hardware.