This is the Python SDK for the Westwood Robotics actuator module BEAR (Back-drivable Electromechanical Actuator for Robotics).
Email: [email protected]
It is advised to use the Boosted USB2BEAR/USB2RoMeLa device for maximum speed.
Use at own risk when using other generic RS485 dangles.
When using the Boosted USB2BEAR/USB2RoMeLa device, you can use udev rules to allow local machine to asign a unique SYMLINK according to the serial number of the USB dangle.
- Move 00-WestwoodRobotics.rules file into /etc/udev/rules.d/ with 'sudo cp'
- Reload the rules
sudo udevadm control --reloadEverytime a Boosted USB2BEAR/USB2RoMeLa device is plugged in, a symlink that is: '/dev/serial#' will be created. For example, a device with serial number UB021 will have this SYMLINK: /dev/UB021
USB2RoMeLa from RoMeLa has 3 digit hexadecimal serial numbers.
USB2BEAR from Westwood Robotics has 4 digit hexadecimal serial numbers.
- Modify the permissions of your computer such that PyBEAR can access the serial port.
sudo chown -R your_username /usr/local
sudo usermod -a -G dialout your_username- Install dependencies.
pip install numpy pyserial- Run installation on your local Python installation or your virtual environment.
python setup.py install- Enjoy!
# Import Manager from PyBEAR
from pybear import Manager
# Create a serial port object
bear = Manager.BEAR(port='/dev/ttyUSB0', baudrate=8000000)
# Enable torque
bear.set_torque_enable((1,1))
# Enable multiple torques
bear.set_torque_enable((1,1), (2,1))
# Enable Direct Force mode
bear.set_mode(1,3)
# Apply Direct Force D gain
bear.set_d_gain_direct_force((1,0.1))