An easy-to-use interface for the Reach Bravo 7 manipulator
Project description
pybravo :mechanical_arm:
pybravo is a Python interface for interacting with the Reach Bravo 7 manipulator over an Ethernet connection.
:warning: Disclaimer :warning:
This is an independent project, and is not affiliated with or maintained by Reach Robotics. Please refer to the Reach Robotics SDK for all official software.
Main features
The main features of pybravo include:
- An easy-to-use interface for sending and receiving packets from the Bravo arm
- Implements the Reach serial protocol
- Attach callbacks for asynchronous packet handling
Installation
pybravo can be installed from PyPI by running:
python3 -m pip install pybravo
To build pybravo from source, please refer to the following steps:
- Clone the project repository
- Navigate to the
pybravo
base directory
cd path/to/pybravo
- Install the package
python3 -m pip install .
Quick start
Refer to the following code snippet for a simple example showing how to get started with pybravo. Additional examples may be found in the project examples.
import struct
import time
from bravo import BravoDriver, PacketID, DeviceID, Packet
def example_joint_positions_cb(packet: Packet) -> None:
"""Read the joint positions from the Bravo 7.
Args:
packet: The joint position packet.
"""
position: float = struct.unpack("<f", packet.data)[0]
print(
f"The current joint position of joint {packet.device_id} is {position}"
)
if __name__ == "__main__":
bravo = BravoDriver()
# Attempt to establish a connection with the Bravo
bravo.connect()
# Attach a callback to be executed when a packet with the POSITION ID is
# received
bravo.attach_callback(PacketID.POSITION, example_joint_positions_cb)
# Create a request for the current joint positions
request = Packet(
DeviceID.ALL_JOINTS, PacketID.REQUEST, bytes([PacketID.POSITION.value])
)
# Send the request
bravo.send(request)
# Wait a second for the Bravo to respond to the request
time.sleep(1.0)
bravo.disconnect()
License
Any proprietary documents or software owned by Reach Robotics and used within this project are subject to the Reach Robotics licensing. All other software is is released under the MIT license.
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
File details
Details for the file pybravo-0.1.1.tar.gz
.
File metadata
- Download URL: pybravo-0.1.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1956aac1c0951d559da3e4625a9eac5c7450c0eef17528869f415905e7a3727 |
|
MD5 | beddb4e56f98738719e18de41efb7528 |
|
BLAKE2b-256 | d5a075b693b8f30edf59a9be756747d4f8d27dd0e40776bf0a39edd581152bc3 |
File details
Details for the file pybravo-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pybravo-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55567a060dfd4821587440c843cbf831b89f05384c2de7563c91b04e79b53854 |
|
MD5 | a0530d517e95eb6adb481d0c41f7cb80 |
|
BLAKE2b-256 | 22edff31a13053f03e30d0f5d7bb43d8f154c5d00d2f8e31a47bdfd14305d88f |