Skip to main content

HEXFELLOW Robotics Utilities

Project description

HEXFELLOW ROBOTICS UTILITIES

                    


📖 Overview

What is hex_util_ros

hex_util_ros is a lightweight Python utility library providing reusable robotic primitives for kinematics, dynamics, control, state estimation, motion planning, and more. It is part of the HEXFELLOW ecosystem and serves as the algorithmic middleware layer for robot system development.

Module Primary Purpose Key Components
math_utils 3D rotation & transformation (SO(3), SE(3), quaternion, Euler angles) hat, rot2quat, euler2rot, trans_inv, quat_slerp
dyn_util Rigid-body dynamics (forward/inverse kinematics, ID, Coriolis) HexDynUtil, HexDynUtilY6
intx_util Interaction utilities (mirroring, friction, feedback) HexMirrorUtil, HexFricUtil, HexFeedbackUtil
basic_util General-purpose numeric helpers deadzone, remap, time_interp, time_nearest
robot_util Robot-specific utility functions interp_joint, arm_pos_limit, grip_pos_limit, state_interp

What problem it solves

  • Unified math library: Provide a consistent, well-tested set of functions for SO(3), SE(3), quaternion, and Euler angle conversions, all with batched (vectorized) support and uniform input/output conventions.
  • Robot dynamics abstraction: Wrap hex_dynamic (Pinocchio-based) behind a clean API that handles flange-to-end-effector transforms, analytical IK for Y6 arms, and Coriolis/gravity compensation.
  • Reusable interaction primitives: Mirroring, tanh-based friction modeling, and PD feedback control as callable objects — ready to plug into any robot control loop.

Target users

  • Robotics engineers building low-level control loops for manipulators.
  • Developers working with the HEXFELLOW ecosystem (hex_util_runtime, hex_driver_mujoco, etc.).
  • Researchers prototyping kinematics, dynamics, and motion planning algorithms.
  • Anyone needing a clean, vectorized math library for 3D rotations and transformations.

Project structure

hex_util_ros/
├── hex_util_ros/
│   ├── __init__.py         # Public exports (__all__)
│   ├── math_utils.py       # 3D math: quaternion, rotation, pose, Euler angles
│   ├── dyn_util.py         # Rigid-body dynamics: HexDynUtil, HexDynUtilY6
│   ├── intx_util.py        # Interaction utilities: HexMirrorUtil, HexFricUtil, HexFeedbackUtil
│   ├── basic_util.py       # Basic utilities: deadzone, remap, time interpolation
│   └── robot_util.py       # Robot helpers: joint interpolation, position limits
├── test/
│   └── test_math_utils.py  # Unit tests for math_utils
├── docs/
│   └── api.md               # Full API reference
└── pyproject.toml            # Project metadata & build configuration

📦 Installation

Requirements

  • Python ≥ 3.8
  • OS: Linux
  • Dependencies:
    • hex_dynamic ≥ 0.1.3
    • numpy ≥ 1.17.4

Install from PyPI

pip install hex_util_ros

Install from Source

We use uv to manage the Python environment. Please install it first.

  1. Clone and install in editable mode:
git clone https://github.com/hexfellow/hex_util_robot.git
cd hex_util_robot
./venv.sh
  1. Activate before using:
source .venv/bin/activate

⚡ Quick Start

import numpy as np
from hex_util_ros import hat, rot2quat, quat_slerp, trans_inv
from hex_util_ros import euler2rot, angle_norm

# SO(3) hat operator
omega = np.array([0.1, 0.2, 0.3])
omega_hat = hat(omega)  # 3x3 skew-symmetric matrix

# Rotation matrix to quaternion
rot = euler2rot(np.array([0.1, 0.2, 0.3]), format='xyz')
quat = rot2quat(rot)  # [w, x, y, z]

# Quaternion slerp
q1 = np.array([1.0, 0.0, 0.0, 0.0])
q2 = np.array([0.707, 0.707, 0.0, 0.0])
q_interp = quat_slerp(q1, q2, 0.5)  # halfway quaternion

# Transform inverse
T = np.eye(4)
T[:3, 3] = [1.0, 2.0, 3.0]
T_inv = trans_inv(T)

# Normalise angle to [-pi, pi]
theta = angle_norm(3.5)  # -2.783 rad

📑 Documentation

  • API Reference — Detailed documentation of all classes and functions.

📄 License

Apache License 2.0. See LICENSE.


👥 Authors & Maintainers

Role Name Email
Author Dong Zhaorui joray.dong@hexfellow.com
Maintainer jecjune (Chen Zejun) zejun.chen@hexfellow.com
Maintainer Dong Zhaorui joray.dong@hexfellow.com

🌟 Star History

Star History Chart


👥 Contributors

Project details


Download files

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

Source Distribution

hex_util_ros-0.0.1a0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

hex_util_ros-0.0.1a0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file hex_util_ros-0.0.1a0.tar.gz.

File metadata

  • Download URL: hex_util_ros-0.0.1a0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for hex_util_ros-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 5975c987d185bd7b1655fdf8da429cef419acc486dc7267e9caacb889c7568e3
MD5 8593f9b213b6f29c77afd585138e917d
BLAKE2b-256 1dfb62322dde3f56d1a946f0019a04b7836619bbf5455c3b79063cf691d28fa6

See more details on using hashes here.

File details

Details for the file hex_util_ros-0.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: hex_util_ros-0.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for hex_util_ros-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 c74d214448876f0d079474b071ff2d4b567a6ceb5b6896b9c9363a00629cd978
MD5 eef6c3f606a9f5f48727c49c49febd8d
BLAKE2b-256 242e80d13bcedbcd6f173f766c0c9a59a1767865bd386456b89023837beeaa5e

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