3) Write to BEAR All configure registers and most status registers can be written to achieve
proper control of BEAR modules by calling “set ” functions. The “set ” functions have no
return.
a) Write to a single register
The functions have a format of:
set_name-of-register((motor_id, value))
Format of input should always be one or several instances of “(motor id, value)” when writing
to the same register of multiple BEAR actuators.
Example:
# Enable the torque of BEAR 1, 3 and disable BEAR 2
bear.set_torque_enable((1,1),(2,0),(3,1))
# set p_gain_velocity on BEAR 1 to 0.02, BEAR 4 to 0.05
bear.set_p_gain_position((1,0.02),(4,0.05))
# set goal_position of BEAR 1 to 0, BEAR 3 to 2.5
bear.set_goal_position((1,0),(3,2.5))
b) Write to multiple registers
This function is previously known as set bulk status/config(), which is verbally mislead-
ing since this is in fact not using bulk communication protocol. set bulk status/config()
is now depreciated.
CAUTION
Will not work for ID, Mode, Baudrate, Watchdog timeout and Torque Enable
CAUTION
Multiple registers on a BEAR can be visited within one frame of communication using:
bear.set_status/config((ID1, reg1, data1, reg2, data2...),
(ID2, reg1, data1...) ...)
Multiple target motors can be visited but PyBEAR will go through them one-by-one.
Do not use set status() with config registers, nor to use set config() with status registers
CAUTION
26