Skip to main content

Robotics-AI Training in Hyperrealistic Game Environments

Project description

Default_Logo_Horizontal@2x

Infinite synthetic data generation for embodied AI

PyPI version Documentation License: MIT Python Version Status Discord

https://github.com/user-attachments/assets/0ab2953d-b188-4af7-a225-71decdd2378c

Lucky Robots

Hyperrealistic robotics simulation framework with Python API for embodied AI training and testing.

Bedroom environment in Lucky World Open floor plan in Lucky World

Quick Start

  1. Download Lucky World Executable from our releases page

  2. Create conda environment (recommended)

    conda create -n luckyrobots python
    conda activate luckyrobots
    
  3. Install

    pip install luckyrobots
    
  4. Run Example

    git clone https://github.com/luckyrobots/luckyrobots.git
    cd luckyrobots/examples
    python controller.py
    

Basic Usage

from luckyrobots import LuckyRobots, Node
import numpy as np

# Create controller node
class RobotController(Node):
    async def control_loop(self):
        # Reset environment
        reset_response = await self.reset_client.call(Reset.Request())

        # Send actions
        actuator_values = np.array([0.1, 0.2, -0.1, 0.0, 0.5, 1.0])
        step_response = await self.step_client.call(Step.Request(actuator_values=actuator_values))

        # Access observations
        observation = step_response.observation
        joint_states = observation.observation_state
        camera_data = observation.observation_cameras

# Start simulation
luckyrobots = LuckyRobots()
controller = RobotController()
luckyrobots.register_node(controller)
luckyrobots.start(scene="kitchen", robot="so100", task="pickandplace")

Available Robots & Environments

Robots

  • so100: 6-DOF manipulator with gripper
  • stretch_v1: Mobile manipulator
  • dji300: Quadcopter drone

Scenes

  • kitchen: Residential kitchen environment
  • loft: Open floor plan apartment
  • drone_flight: Outdoor flight area

Tasks

  • pickandplace: Object manipulation
  • navigation: Path planning and movement

API Reference

Core Classes

LuckyRobots: Main simulation manager

  • start(scene, robot, task, observation_type): Initialize simulation
  • register_node(node): Add controller node
  • spin(): Run main loop

Node: Base class for robot controllers

  • create_client(service_type, service_name): Create service client
  • create_service(service_type, service_name, handler): Create service server

Services

Reset: Reset robot to initial state

request = Reset.Request(seed=42, options={})
response = await reset_client.call(request)

Step: Send action and get observation

request = Step.Request(actuator_values=[0.1, 0.2, -0.1])
response = await step_client.call(request)

Observations

Access sensor data from step responses:

# Joint positions and velocities
joint_states = response.observation.observation_state

# Camera images (RGB + depth)
for camera in response.observation.observation_cameras:
    image = camera.image_data  # numpy array
    name = camera.camera_name  # "head_cam", "hand_cam", etc.

Command Line Interface

# Basic usage
python controller.py --robot so100 --scene kitchen --task pickandplace

# With camera display
python controller.py --show-camera --rate 30

# Custom host/port
python controller.py --host 192.168.1.100 --port 3001

Configuration

Robot configurations are defined in src/luckyrobots/config/robots.yaml:

so100:
  action_space:
    actuator_names: [shoulder_pan, shoulder_lift, elbow_flex, wrist_flex, wrist_roll, gripper]
    actuator_limits:
      - name: shoulder_pan
        lower: -2.2
        upper: 2.2
  available_scenes: [kitchen]
  available_tasks: [pickandplace]

Architecture

Lucky Robots uses a distributed node architecture:

  • Manager Node: Central message routing
  • LuckyRobots Node: Simulation interface
  • Controller Nodes: User-defined robot controllers
  • WebSocket Transport: Inter-node communication
  • Lucky World: Physics simulation backend

Development

Setup Development Environment

git clone https://github.com/luckyrobots/luckyrobots.git
cd luckyrobots
pip install -e .

Library Development Mode

python -m luckyrobots --lr-library-dev

Creates a symlink for local development without reinstalling.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes and add tests
  4. Submit a pull request

License

MIT License - see LICENSE file.

Support

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

luckyrobots-0.1.62.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

luckyrobots-0.1.62-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file luckyrobots-0.1.62.tar.gz.

File metadata

  • Download URL: luckyrobots-0.1.62.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for luckyrobots-0.1.62.tar.gz
Algorithm Hash digest
SHA256 969c9c11769e3385d52678a2c06ba3eec436b6270edb376359303c91caf01d94
MD5 ffbb2fe01bdbed231279c036145b9d52
BLAKE2b-256 2ffe5092cae487077b4130607488681366d12688d20894ba7d1cdff79ab303d8

See more details on using hashes here.

File details

Details for the file luckyrobots-0.1.62-py3-none-any.whl.

File metadata

  • Download URL: luckyrobots-0.1.62-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for luckyrobots-0.1.62-py3-none-any.whl
Algorithm Hash digest
SHA256 132e7997f04a56e7ffd7faa7889894529ebb11f6c0d63c6c7553dbd898c9691a
MD5 5dfc430eba8b80d0ff152e9bef3673ea
BLAKE2b-256 092959dd1b562a2df17fad139420e9bed46b81b88e3ccaa4a92fb2451657c671

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page