close
Skip to content

Latest commit

 

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyBEAR

Note: We have officially stopped supporting Python2. While it is still possible to use PyBEAR with Python 2, please be aware that certain functions may no longer be functional.

This is the Python SDK for the Westwood Robotics actuator module BEAR (Back-drivable Electromechanical Actuator for Robotics).

Current version: 0.1.3

In this version, the return format is always [([data1, data2, ...], error), ([data1, data2, ...], error), ...] no matter if returning only one register or more per BEAR.

New function: set_posi()

A new function set_posi() is added to clear absolute position error on BEAR, e.g., set_posi((id, position, tolerance)).

Contact

Website: www.westwoodrobotics.io

Email: info@westwoodrobotics.io

Notes

It is advised to use the Boosted USB2BEAR/USB2RoMeLa device for maximum speed.

Disclaimer

Use at own risk when using other generic RS485 dangles.

Udev Rules

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.

  1. Move 00-WestwoodRobotics.rules file into /etc/udev/rules.d/ with 'sudo cp'
  2. Reload the rules
sudo udevadm control --reload

Everytime 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.

Installation Procedure

  1. 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
  1. CD into PyBEAR/ directory and use pip3 to install the package(Python3).
pip3 install .
  1. Make sure pyserial, numpy, termcolor are installed. Othewise, install the missing package(s). You can check this by running:
pip3 show pyserial numpy termcolor
  1. Enjoy!

SDK Manual

Download the latest SDK Manual from www.westwoodrobotics.io for detailed instructions, helpful tips, and various examples.

For detailed examples please refer to the SDK from https://westwoodrobotics.io/support/.

New function in 0.1.3: set_posi()

A new function set_posi() is added to clear absolute position error on BEAR, e.g., set_posi((id, position, tolerance)). If tolerance is non-zero, BEAR tries to find the multi-turn value to match the expected position within the tolerance. If tolerance is zero, BEAR modifies the homing offset to match the expected position. A save_config() action will be performed automatically once set_posi() is successfully excuted.

Note: set_posi() only works with BEARs with battery-backed encoders: Panda, Kodiak and Mountain.

When BEAR is free from Absolute Position error, Hardware Fault or Initialization error, set_posi() can be used to find homing offset autonomously. For example:

# Find and set homing offset for BEAR with ID 1 so that the present position is 2.0
id = 1
position = 2.0
tolerance = 0.0
bear.set_posi((id, position, tolerance))

If BEAR is in Absolute Position error, set_posi() can be used to clear it. Note: set to non-zero tolerance when using set_posi() to clear Absolute Position error, then disable to clear the error. For example:

# Clear Absolute Position error on BEAR with ID 5 and find offset to make present position 0.0
id = 5
position = 0.0
tolerance = 0.2
bear.set_posi((id, position, tolerance))
bear.set_torque_enable((id,0))

About

PyBEAR is the Python driver for BEAR series actuator from Westwood Robotics.

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages