Metadata-Version: 2.1
Name: rubu
Version: 0.0.3
Summary: Temas Socket API for controlling and communicating with Temas devices
Author-email: Muhammed <info@rubu-tech.de>
License: MIT License
        
        Copyright (c) 2025 rubu-tech
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: temas,hardware-control,socket
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt

# Rubu Tech – Temas Socket API

## Overview

This Python package provides an intuitive API to control and communicate with Temas hardware devices via TCP/IP socket communication. 
It is particularly suitable for laboratory robotic systems, environments, test setups, and other precise positioning or sensing scenarios.

---

## Features

- TCP/IP socket communication to Temas devices
- Distance measurement (laser sensor)
- Precise pan and tilt positioning
- Real-time camera stream (visual and ToF)
- Easy-to-use object-oriented API
- Built-in threading support for camera streams
- Point cloud scanning
- Adjustable camera settings (exposure time, brightness, saturation, contrast, gain, lens position)

---

## Installation

Install via pip:

```bash
pip install rubu
```

---

## Usage

### Extended Example: Query distance, positioning, camera stream, and additional features

```python
import cv2
from rubu import temas

# Connect to the device (via hostname or IP address)
device = temas.Connect(hostname="temas")
# Alternatively: device = temas.Connect(ip_address="192.168.4.4")

# Initialize control class
control = temas.Control()

# Measure distance (laser, in cm)
distance = control.distance()
print(f"Measured distance: {distance} cm")

# Move to a specific position (Pan, Tilt)
control.move_pos(60, 30)

# Initialize camera (Visual Port: 8081, ToF Port: 8084)
camera = temas.Camera(port=8081)
camera.start_thread()

# Adjust camera settings
camera.set_exposure_time(32000)
camera.set_brightness(50)
camera.set_contrast(3)

while True:
    try:
        frame = camera.get_frame()
        if frame is not None:
            cv2.imshow('Visual Camera', frame)

        if cv2.waitKey(1) & 0xFF == ord('q'):
            print("Exiting camera stream...")
            break
    except Exception as e:
        print(f"Error retrieving camera frame: {e}")

# Reset camera and control
control.move_home()
camera.stop_thread()
cv2.destroyAllWindows()
print("Program terminated.")
```

---

## Contact

For more information, visit [https://rubu-tech.de](https://rubu-tech.de)  
or contact us via email: **info@rubu-tech.de**
