Metadata-Version: 2.4
Name: dexsensor
Version: 0.1.10
Summary: A Python library for processing sensor data on Dexmate Robots
Author-email: Dexmate <contact@dexmate.ai>
Keywords: robot,robotics,sensors,camera,imu,python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: numpy>=2.2.1
Requires-Dist: eclipse-zenoh>=1.0.1
Requires-Dist: hydra-core>=1.3.2
Requires-Dist: omegaconf>=2.3.0
Requires-Dist: loguru>=0.7.3
Requires-Dist: tyro>=0.9.24
Requires-Dist: colorama>=0.4.6
Requires-Dist: pyserial>=3.5
Requires-Dist: scipy>=1.15.0
Requires-Dist: pyrplidarsdk>=0.1.0
Requires-Dist: opencv-python>=4.8.0
Requires-Dist: aiortc>=1.6.0
Requires-Dist: websockets>=11.0
Requires-Dist: aiofiles>=23.0.0
Requires-Dist: uvloop>=0.17.0
Requires-Dist: av>=14.4.0
Dynamic: license-file

# DexSensor

A unified sensor management system for Dexmate robots. DexSensor provides automatic robot detection and configuration for cameras, IMU, LiDAR, and other sensors through an easy-to-use command line interface.

![License](https://img.shields.io/badge/license-Proprietary-red.svg)
![Python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)

## Features

- **Automatic Robot Detection**: Detects robot model and loads appropriate sensor configuration
- **Multiple Robot Variants**: Support for different robot models with optimized sensor configurations  
- **Unified Sensor Management**: Consistent interface for cameras, IMU, LiDAR, and other sensors
- **Real-time Communication**: High-performance sensor data streaming
- **Flexible Configuration**: Easy configuration management with YAML files
- **Command Line Interface**: Simple CLI for sensor control and configuration

## Installation

DexSensor is distributed as a pre-built package for Dexmate robot systems.

```bash
# Install DexSensor package
pip install dexsensor

# Verify installation
dexsensor --help
```

## Quick Start

### Automatic Robot Detection

Set your robot model and launch sensors:

```bash
# Set robot name environment variable
export ROBOT_NAME=vg-rc2    # for vega-rc2
export ROBOT_NAME=vg-1      # for vega-1

# Launch sensors with automatic detection
dexsensor launch
```

### Manual Robot Selection

```bash
# Specify robot model explicitly
dexsensor launch --robot vega-rc2

# Launch specific sensors only
dexsensor launch --sensor head_camera base_front_camera

# Override configuration values
dexsensor launch --set head_camera.fps=60 lidar.enable=true
```

## Supported Robot Variants

| Variant | Description | Default Sensors |
|---------|-------------|----------------|
| `vega-rc1` | Development setup | All sensors disabled |
| `vega-rc2` | Basic operation | Head camera + front camera |
| `vega-1` | Production setup | Head camera only |
| `base` | Full configuration | All sensors available |

## Command Line Interface

### Launch Sensors

```bash
# Basic usage
dexsensor launch

# With specific robot model
dexsensor launch --robot vega-rc2

# Launch specific sensors
dexsensor launch --sensor head_camera lidar

# Launch all sensors (enables all sensors regardless of default config)
dexsensor launch --sensor all

# Launch all base cameras (base_left, base_right, base_front, base_back)
dexsensor launch --sensor base_camera

# Override configuration
dexsensor launch --set head_camera.fps=60 lidar.enable=true

# Use custom configuration file
dexsensor launch --config /path/to/config.yaml

# Combine options
dexsensor launch --robot vega-1 --set head_camera.fps=30 --sensor head_camera
```

### Configuration Management

```bash
# Generate configuration template
dexsensor gen-cfg

# Generate for specific robot model
dexsensor gen-cfg --robot vega-rc2

# Save to custom location
dexsensor gen-cfg --robot vega-1 --output /path/to/config.yaml
```

### Command Options

| Option | Description | Example |
|--------|-------------|---------|
| `--robot` | Specify robot variant | `--robot vega-rc2` |
| `--sensor` | Launch specific sensors, "all", or "base_camera" | `--sensor head_camera lidar`, `--sensor all`, or `--sensor base_camera` |
| `--config` | Use custom config file | `--config config.yaml` |
| `--set` | Override config values | `--set head_camera.fps=60` |
| `--zenoh` | Custom Zenoh config | `--zenoh zenoh.json5` |

## Configuration

### Configuration Files

DexSensor uses YAML configuration files with the following precedence:

1. **Command line overrides** (`--set key=value`)
2. **Custom configuration files** (`--config file.yaml`)
3. **Default configuration file** (`~/.dexmate/sensors/default_config.yaml`)
4. **Robot variant defaults** (based on detected/specified robot model)

### Configuration Example

```yaml
head_camera:
  enable: true
  fps: 30
  resolution: HD1080
  depth_mode: NEURAL

base_front_camera:
  enable: true
  width: 640
  height: 480
  fps: 30
  format: MJPG

lidar:
  enable: false
  ip_address: "192.168.50.41"
  udp_port: 8089

base_imu:
  enable: true

head_imu:
  enable: true
```

### Environment Variables

| Variable | Description | Example |
|----------|-------------|---------|
| `ROBOT_NAME` | Robot model for auto-detection | `export ROBOT_NAME=vg-rc2` |

## Sensor Types

DexSensor supports the following sensor types:

- **Cameras**: RGB cameras, stereo cameras (ZED), RGBD cameras
- **IMU**: Inertial measurement units for head and base
- **LiDAR**: 2D laser range finders
- **Additional sensors**: Extensible for future sensor types

## System Requirements

- **Operating System**: Linux (Ubuntu 20.04+ recommended)
- **Python**: 3.10 or higher
- **Hardware**: Compatible Dexmate robot hardware
- **Network**: Ethernet connection for sensor communication

## Troubleshooting

### Common Issues

**Sensors not detected:**
```bash
# Check robot name is set
echo $ROBOT_NAME

# Verify configuration
dexsensor gen-cfg --robot vega-rc2
```

**Permission errors:**
```bash
# Check USB device permissions
sudo usermod -a -G dialout $USER
# Log out and back in
```

**Network connectivity:**
```bash
# Test sensor network connectivity
ping 192.168.50.41  # Example LiDAR IP
```

### Log Files

DexSensor logs are available at:
- System logs: `/var/log/dexsensor/`
- User logs: `~/.dexmate/logs/`

## Support

For technical support and documentation:

- **Documentation**: Contact your Dexmate representative
- **Technical Support**: support@dexmate.ai
- **Sales Inquiries**: contact@dexmate.ai

## License

DexSensor is proprietary software licensed exclusively for use with Dexmate robot systems.

Copyright © 2024 Dexmate. All rights reserved.
