API Reference
Core Classes
LuckyRobots
- class luckyrobots.LuckyRobots(host: str = None, port: int = None)[source]
Main LuckyRobots node for managing robot communication and control
- host = 'localhost'
- port = 3000
- robot_client = None
- world_client = None
- static get_robot_config(robot: str = None) dict[source]
Get the configuration for the LuckyRobots node
- start(scene: str = 'ArmLevel', robot: str = 'so100', task: str = 'pickandplace', observation_type: str = 'pixels_agent_pos', game_path: str = None) None[source]
Start the LuckyRobots node
- wait_for_world_client(timeout: float = 60.0) bool[source]
Wait for the world client to connect to the websocket server
- async handle_reset(request: ResetRequest) ResetResponse[source]
Handle the reset request by forwarding to the world client
Node
- class luckyrobots.Node(name: str, namespace: str = '', host: str = None, port: int = None)[source]
-
- create_publisher(message_type: Type, topic: str, queue_size: int = 10) Publisher[source]
Create a publisher for a given topic
- create_subscription(message_type: Type, topic: str, callback: Callable[[Any], None], queue_size: int = 10) Subscriber[source]
Create a subscriber for a given topic
- create_client(service_type: Type, service_name: str) ServiceClient[source]
Create a client for a given service
- async create_service(service_type: Type, service_name: str, handler: Callable[[Any], Any]) ServiceServer[source]
Create a service for a given service name
Models
- class luckyrobots.ObservationModel(*, ObservationState: Dict[str, float], ObservationCameras: List[CameraData] | None = None)[source]
Observation model that matches the JSON structure
- observation_state: Dict[str, float]
- observation_cameras: List[CameraData] | None
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].