3 SDK
3.1 PyBEAR
In this section, the BEAR
TM
actuator driver Python SDK, called PyBEAR
TM
is introduced. PyBEAR
is compatible with both Python2 and Python3, supported functions are introduced as follows.
3.1.1 Getting Started
Follow these steps to get started with PyBEAR:
0) Serial port access permission Make sure you have the permissions to access the serial
ports on your computer. Adding such permission to your account in Linux can be done with
the following commands in terminal:
sudo chown -R your_username /usr/local
sudo usermod -a -G dialout your_username
1) Unzip After downloading the PyBEAR zip file, unzip the file into a preferred path, and we will
refer to this path as /usr_path from this point forward.
2) Install dependencies PyBEAR requires the NumPy module for scientific computing and
PySerial module to access the serial port. Install these two packages in bash as follows:
Python 2:
pip install numpy pyserial
Python 3:
pip3 install numpy pyserial
3) Install PyBEAR Cd into /usr_path/PyBEAR and run the installation:
Python 2:
python setup.py install
Python 3:
python3 setup.py install
Start enjoying PyBEAR!
3.1.2 Communication With BEAR
To use PyBEAR, import the driver first:
# Import Manager from PyBEAR
from pybear import Manager
0) Connect to/Disconnect from BEAR The serial port connection needs to be established
before any command can be transferred to the BEAR actuators that are connected. The
serial port can be connected by creating a serial port object.
23