pybravo 0.1.1

Last updated:

0 purchases

pybravo 0.1.1 Image
pybravo 0.1.1 Images
Add to Cart

Description:

pybravo 0.1.1

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.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.