robits.real package

Implementation of the RoBits framework for real physical hardware.

This package provides concrete implementations of the RoBits interfaces for controlling real robots, grippers, and cameras. It handles the complexities of communicating with physical hardware devices through their respective APIs. Robot implementation are grouped in a plugin style.

Key components:

  • Robot: Implementation for Franka Panda, XArm, UR robots

  • Control: Position and Cartesian control implementations

  • Grippers: Implementations for Franka, Xarm and Robotiq grippers

  • Cameras: Implementation for RealSense cameras

Note: Most components require specific hardware configuration and network connectivity to function properly. Please see the documentation

Subpackages

Submodules

robits.real.realsense_camera module

Implementation for Intel RealSense cameras.

This module provides an implementation of the CameraBase interface for Intel RealSense depth cameras, supporting RGB and depth imaging. It handles camera discovery, configuration, and streaming.

class robits.real.realsense_camera.RealsenseCamera(**kwargs)

Bases: CameraBase

Implementation for Intel RealSense depth cameras.

Provides RGB and depth imaging from RealSense cameras (D400 series). Supports configurable resolution, frame rate, and imaging modes. Thread-safe implementation ensures proper operation in multi-threaded applications.

property camera_name

Name of the camera

Returns:

The camera name

property depth_scale: float

..todo:: read from camera

extract_intrinsics() ndarray

Reads the intrinsics from the camera

Returns:

the intrinsics parameters

get_camera_data(timeout: int = 100) Tuple[CameraData, Dict[str, Any]]

Capture images from the RealSense camera.

Retrieves RGB and depth frames from the camera, aligns them, and returns them as a CameraData object with associated metadata.

See also

robits.core.abc.camera.CameraBase.get_camera_data

Parameters:

timeout – Timeout in milliseconds for waiting for frames

Returns:

Tuple of (CameraData, metadata_dict)

Raises:

RuntimeError – If frames cannot be captured within timeout

is_wrist_camera() bool
Returns:

True if the camera is mounted to a robot

classmethod list_camera_info() List[Tuple[str, str]]

Get information about all connected RealSense cameras.

Returns:

List of tuples containing (camera_name, serial_number)

robits.real.robotiq_gripper module

Implementation for Robotiq grippers.

This module provides an implementation of the GripperBase interface for Robotiq grippers, including the 2F85, 2F140, and Hand-E models. It handles calibration, movement commands, and state monitoring.

class robits.real.robotiq_gripper.RobotiqGripper(gripper_name: str, activate=True, **kwargs)

Bases: GripperBase

Implementation for Robotiq grippers (2F85, 2F140, and Hand-E).

This class provides an interface for controlling Robotiq grippers using the pyRobotiqGripper library. It includes functionality for calibration, opening and closing the gripper, and monitoring the gripper state.

Thread-safe implementation ensures proper operation in multi-threaded applications.

close()

Closes the gripper / hand

classmethod get_gripper_type_name()
get_info()

Returns general information about the gripper.

Returns:

Dictionary containing gripper information

get_obs()

..todo:: would be good to have the raw value as well

get_pos_raw() float
property gripper_name

Returns the name of the gripper.

Returns:

The gripper name

is_active()
is_open() bool

Returns whether the hand / gripper is open

Returns:

True if the gripper is open

load_calibration()
property normalized_width: float

Get the current gripper opening as a normalized value.

Returns the current gripper opening as a value between 0.0 (fully closed) and 1.0 (fully open), representing the fraction of the maximum opening.

Returns:

Normalized gripper width (0.0-1.0)

Raises:

Warning – If gripper is not calibrated

open()

Opens the gripper / hand

read_calibration()
set_pos(normalized_pos)