Joint-to-motor level control API for mimic robotics AG's robotic hands.
Project description
mimic_hand_middleware
Repository for the joint-to-motor level control of mimic's robotic hands.
System specifications
We support the following platforms:
- x86 architecture
- Ubuntu Jammy (22.04)
- 2 USB-A ports
Install
To install the hand API, clone the this repo and run its install script:
mkdir ~/git && cd ~/git
git clone git@github.com:mimicrobotics/mimic_hand_middleware.git
./scripts/install.sh
Since the script installs new udev rules for the hand, when prompted, you'll need to enter a sudo password. The new python environment will be installed in $HOME/python_venvs/mimic_hand, so when opening a new terminal, make sure to activate this environment by running:
source ~/python_venvs/mimic_hand/bin/activate
When connecting the hand's USB board to your PC, Ubuntu will set the latency timer of the async buffer to 16 ms. This is too slow for our purposes, so we override it by running:
./scripts/connect_mimic_hand.sh
Optionally, you can paste the lines above into your ~/.bashrc file - this will source your environment and modify the latency timers every time you open a new terminal.
Run
First, you can run a test sequence on all of the joints by running:
source ~/python_venvs/mimic_hand/bin/activate
python tests/test_joint_cmd.py
You can also move the hand around yourself in a simple GUI:
source ~/python_venvs/mimic_hand/bin/activate
python python tests/grasp_gui.py
Using our API
The main interface to our hands is the GripperController class. You can initialize it as follows:
from mimic_hand_middleware import GripperController
gc = GripperController()
gc.connect_motors() # connect, set maximum current and operation mode (current-limited position control)
gc.init_joints(calibrate=False) # enable torques on the motors
Sending joint commands to the hands
Motor commands are sent to all motors at once, as a numpy array of shape (16,). Commands are sent in degrees. To have a look at the zero positions, you can start up the grasp_gui, and select joint control mode to home all joints to 0.
# commanding joint angles in degrees
gc.command_motor_angles(motor_cmd_array)
The numbering of joints follows a simple convention: idx 0 starts from the base of the thumb, then indexes increase with the distance from the finger base until 3 on the thumb, then on the index etc.
Reading motor angles, speeds and currents from the hands
You can read the current motor angles, speeds and currents as follows:
motor_status = self.gc.get_motor_pos_vel_cur()
Where motor_status is a list of length of 3, containing numpy arrays for motor positions (rad) speeds (rad/s) and currents (mA).
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mimic_hand_middleware-0.3.0.0.tar.gz.
File metadata
- Download URL: mimic_hand_middleware-0.3.0.0.tar.gz
- Upload date:
- Size: 8.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.12 Linux/6.8.0-52-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c96b7c4175077d331829a61f1ee37b249355e6539cf567ca2050399d07be2828
|
|
| MD5 |
93f30d1deb7e93e01f9de07908e39656
|
|
| BLAKE2b-256 |
1a8d98d70c177910203e09197845bc7df46941f36163ebc540a7503ff35b5c2e
|
File details
Details for the file mimic_hand_middleware-0.3.0.0-py3-none-any.whl.
File metadata
- Download URL: mimic_hand_middleware-0.3.0.0-py3-none-any.whl
- Upload date:
- Size: 8.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.12 Linux/6.8.0-52-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecc6ead5478589da4009b870c6b1d55f7fdd47211b2b5eae6f4a5cdbf8cd16d9
|
|
| MD5 |
82995086e26ddc5c277518dc9b58f8f6
|
|
| BLAKE2b-256 |
c45d5fa5122df5e290ed661c5bf0c7880688beefb9d2f48ca2b119d1e19e6f44
|