<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bruce-op.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xzhang</id>
	<title>BRUCE Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bruce-op.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xzhang"/>
	<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php/Special:Contributions/Xzhang"/>
	<updated>2026-05-17T06:28:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=330</id>
		<title>Other Accessories</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=330"/>
		<updated>2026-03-26T04:23:05Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* BR01 Foot PCB */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== 1. Khadas USB Extension ===&lt;br /&gt;
The files for fabricating the plastic cover and the USB Extension itself are listed as below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Hardware Design and Fabrication Files&lt;br /&gt;
!No.&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-USB_EXT&lt;br /&gt;
|The Gerber files and BOM for fabricating the USB extension. &lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/Gerber-BR01-KHADAS_USB_EXT071324.zip Link]&lt;br /&gt;
|Make sure to use the correct type of USB connector.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-USB_EXT_COVER_R&lt;br /&gt;
|The 3D model of the cover parts on the right USB extensions.&lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/BR01-USB_EXT_CAP.STEP Link]&lt;br /&gt;
|These parts are essential as they fix the USB connector in place. &lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|BR01-USB_EXT_COVER_L&lt;br /&gt;
|The 3D model of the cover parts on the left USB extensions.&lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/BR01-USB_EXT_CAP_L.STEP Link]&lt;br /&gt;
|These parts are essential as they fix the USB connector in place.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|BR01-USB_EXT_COVER_R&lt;br /&gt;
|The 3D model of the back parts on the board edge USB male plug.&lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/USB_EXT_INSERT.STEP Link]&lt;br /&gt;
|Glue this part on the back of the board edge USB male plug&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Screw&lt;br /&gt;
|Flat M4x18&lt;br /&gt;
|07/13/24&lt;br /&gt;
|N/A&lt;br /&gt;
|Replace the original flat head screw&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 2. BRUCE V1.6 Foot PCB ===&lt;br /&gt;
The PCB design and fabrication files of the contact sensor on the foot can be downloaded following [https://wiki.bruce-op.com/uploads/Other_Accessories/BR01-FOOT-PCB.zip this link].&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=291</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=291"/>
		<updated>2024-07-13T09:24:22Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* BRUCE SENSE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh Li-Ion battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to put BEAR actuators into damping mode in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Settings/BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Allow Executing Bash/Binary File as Program ===&lt;br /&gt;
&lt;br /&gt;
# Download the binary demo controller according to [https://github.com/Westwood-Robotics/BRUCE-OP/blob/main/Play/Demo/README.md README].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the following commands.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
chmod +x Play/bootup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/bootup_gamepad.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/sim_bootup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/terminate.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/low_level-aarch64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/low_level-x86_64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/high_level-aarch64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/high_level-x86_64&lt;br /&gt;
&lt;br /&gt;
chmod +x Startups/startup_setup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Startups/usb_latency_setup.sh&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Config launch setup in &amp;lt;code&amp;gt;Play/config.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and follow the guidance &amp;lt;code&amp;gt;Play/bootup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Terminate in the end &amp;lt;code&amp;gt;Play/terminate.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Make all terminals go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, run USB low latency setup &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, run shared memory modules &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt; and choose &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the sense communication thread after BRUCE can stand on the ground on its own &amp;lt;code&amp;gt;python3 -m Startups.run_sense&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Demo.low_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Demo.high_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 7, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Demo.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-11.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two joysticks with push-buttons, two shoulder rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+X&lt;br /&gt;
|Running&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Latest Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning some parameters can potentially improve its performance, stability, or further tailor it to your specific demands, e.g., &lt;br /&gt;
&lt;br /&gt;
* Demo (in &amp;lt;code&amp;gt;BRUCE-OP/Play/Demo/demo_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: CoM velocity adjustment in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;COM_VELOCITY_LIMIT&amp;lt;/code&amp;gt;: CoM velocity limit in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;px_offset&amp;lt;/code&amp;gt;: CoM position adjustment in standing [m]&lt;br /&gt;
&lt;br /&gt;
* OP (in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: CoM velocity offset compensation [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;ka&amp;lt;/code&amp;gt;: x position of CoM in standing&lt;br /&gt;
&lt;br /&gt;
=== Other Accessories ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Khadas USB Extension ====&lt;br /&gt;
There are two extra USB ports on the Khadas but they are covered by BRUCE's body rack so not very easy to access. For those who needs better access to these extra USB ports, we have developed an extension that shift the connection to the top of the body and exposes them better. Although one of them is USB3.0, only USB2.0 is supported by this extension for now. &lt;br /&gt;
{|&lt;br /&gt;
![[File:USB-EXT.png|none|thumb|300x300px]]&lt;br /&gt;
![[File:USB-EXT On BRUCE.png|none|thumb|312x312px]]&lt;br /&gt;
|}&lt;br /&gt;
Gerber files and 3D models of related parts can be downloaded in the Download section, or you can buy parts from us directly.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# &amp;lt;s&amp;gt;New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&amp;lt;/s&amp;gt;&lt;br /&gt;
#* The better solution is to design a simple adaptor PCB instead of redesigning the frame. Different groups would have very different applications thus the peripherals intended to be connected can be very different, as well as the desired mounting location, which then leads to very specific requirements of wire management. By making an adaptor board the current compact design of BRUCE can be kept while specific requirement for wire management can all be met.&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/demo_controller_0.0.5.zip Binary Demo Controller]&lt;br /&gt;
# [[Other Accessories]]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. 8502-8509.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:USB-EXT.png&amp;diff=290</id>
		<title>File:USB-EXT.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:USB-EXT.png&amp;diff=290"/>
		<updated>2024-07-13T09:13:19Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;USB Extension Assembly&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:USB-EXT_On_BRUCE.png&amp;diff=289</id>
		<title>File:USB-EXT On BRUCE.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:USB-EXT_On_BRUCE.png&amp;diff=289"/>
		<updated>2024-07-13T09:08:16Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of how the extension is mounted.&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=288</id>
		<title>Other Accessories</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=288"/>
		<updated>2024-07-13T09:04:50Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* 1. Khadas USB Extension */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== 1. Khadas USB Extension ===&lt;br /&gt;
The files for fabricating the plastic cover and the USB Extension itself are listed as below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Hardware Design and Fabrication Files&lt;br /&gt;
!No.&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-USB_EXT&lt;br /&gt;
|The Gerber files and BOM for fabricating the USB extension. &lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/Gerber-BR01-KHADAS_USB_EXT071324.zip Link]&lt;br /&gt;
|Make sure to use the correct type of USB connector.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-USB_EXT_COVER_R&lt;br /&gt;
|The 3D model of the cover parts on the right USB extensions.&lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/BR01-USB_EXT_CAP.STEP Link]&lt;br /&gt;
|These parts are essential as they fix the USB connector in place. &lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|BR01-USB_EXT_COVER_L&lt;br /&gt;
|The 3D model of the cover parts on the left USB extensions.&lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/BR01-USB_EXT_CAP_L.STEP Link]&lt;br /&gt;
|These parts are essential as they fix the USB connector in place.&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|BR01-USB_EXT_COVER_R&lt;br /&gt;
|The 3D model of the back parts on the board edge USB male plug.&lt;br /&gt;
|07/13/24&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Other_Accessories/USB_EXT/USB_EXT_INSERT.STEP Link]&lt;br /&gt;
|Glue this part on the back of the board edge USB male plug&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|Screw&lt;br /&gt;
|Flat M4x18&lt;br /&gt;
|07/13/24&lt;br /&gt;
|N/A&lt;br /&gt;
|Replace the original flat head screw&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=287</id>
		<title>Other Accessories</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=287"/>
		<updated>2024-07-13T08:16:47Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Other Accessories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== 1. Khadas USB Extension ===&lt;br /&gt;
The files for fabricating the plastic cover and the USB Extension itself are listed as below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Hardware Design and Fabrication Files&lt;br /&gt;
!No.&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-USB_EXT&lt;br /&gt;
|The Gerber files and BOM for fabricating the USB extension. &lt;br /&gt;
|07/13/24&lt;br /&gt;
|&lt;br /&gt;
|Make sure to use the correct type of USB connector.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-USB_EXT_COVER_SET&lt;br /&gt;
|The 3D model of the cover parts on the left and the right USB extensions.&lt;br /&gt;
|07/13/24&lt;br /&gt;
|&lt;br /&gt;
|These parts are essential as they fix the USB connector in place. &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=286</id>
		<title>Other Accessories</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Other_Accessories&amp;diff=286"/>
		<updated>2024-07-13T08:06:21Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: Created page with &amp;quot;== Other Accessories ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Other Accessories ==&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=285</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=285"/>
		<updated>2024-07-13T08:06:01Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Performance Tunning [Latest Version] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh Li-Ion battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to put BEAR actuators into damping mode in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Settings/BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Allow Executing Bash/Binary File as Program ===&lt;br /&gt;
&lt;br /&gt;
# Download the binary demo controller according to [https://github.com/Westwood-Robotics/BRUCE-OP/blob/main/Play/Demo/README.md README].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the following commands.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
chmod +x Play/bootup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/bootup_gamepad.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/sim_bootup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/terminate.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/low_level-aarch64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/low_level-x86_64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/high_level-aarch64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/high_level-x86_64&lt;br /&gt;
&lt;br /&gt;
chmod +x Startups/startup_setup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Startups/usb_latency_setup.sh&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Config launch setup in &amp;lt;code&amp;gt;Play/config.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and follow the guidance &amp;lt;code&amp;gt;Play/bootup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Terminate in the end &amp;lt;code&amp;gt;Play/terminate.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Make all terminals go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, run USB low latency setup &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, run shared memory modules &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt; and choose &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the sense communication thread after BRUCE can stand on the ground on its own &amp;lt;code&amp;gt;python3 -m Startups.run_sense&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Demo.low_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Demo.high_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 7, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Demo.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-11.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two joysticks with push-buttons, two shoulder rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+X&lt;br /&gt;
|Running&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Latest Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning some parameters can potentially improve its performance, stability, or further tailor it to your specific demands, e.g., &lt;br /&gt;
&lt;br /&gt;
* Demo (in &amp;lt;code&amp;gt;BRUCE-OP/Play/Demo/demo_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: CoM velocity adjustment in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;COM_VELOCITY_LIMIT&amp;lt;/code&amp;gt;: CoM velocity limit in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;px_offset&amp;lt;/code&amp;gt;: CoM position adjustment in standing [m]&lt;br /&gt;
&lt;br /&gt;
* OP (in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: CoM velocity offset compensation [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;ka&amp;lt;/code&amp;gt;: x position of CoM in standing&lt;br /&gt;
&lt;br /&gt;
=== Other Accessories ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Khadas USB Extension ====&lt;br /&gt;
There are two extra USB ports on the Khadas but they are covered by BRUCE's body rack so not very easy to access. For those who needs better access to these extra USB ports, we have developed an extension that shift the connection to the top of the body and exposes them better. Although one of them is USB3.0, only USB2.0 is supported by this extension for now. &lt;br /&gt;
&lt;br /&gt;
Gerber files and 3D models of related parts can be downloaded in the Download section, or you can buy parts from us directly.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# &amp;lt;s&amp;gt;New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&amp;lt;/s&amp;gt;&lt;br /&gt;
#* The better solution is to design a simple adaptor PCB instead of redesigning the frame. Different groups would have very different applications thus the peripherals intended to be connected can be very different, as well as the desired mounting location, which then leads to very specific requirements of wire management. By making an adaptor board the current compact design of BRUCE can be kept while specific requirement for wire management can all be met.&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/demo_controller_0.0.5.zip Binary Demo Controller]&lt;br /&gt;
# [[Other Accessories]]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. 8502-8509.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Simulation_Files&amp;diff=284</id>
		<title>Simulation Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Simulation_Files&amp;diff=284"/>
		<updated>2024-05-27T06:40:07Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The simulation models of BRUCE is now fully open to the public. This page will no longer be updated.&lt;br /&gt;
&lt;br /&gt;
For latest simulation model of BRUCE including URDF files, mesh files etc., please refer to:&lt;br /&gt;
&lt;br /&gt;
https://github.com/Westwood-Robotics/BRUCE_simulation_models &lt;br /&gt;
&lt;br /&gt;
----History:&lt;br /&gt;
&lt;br /&gt;
Please refer to the BRUCE-OP/Simulation/ directory for more details on working with BRUCE in simulation.&lt;br /&gt;
&lt;br /&gt;
Access to the BRUCE-OP Github repo is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following files are archived and no longer supported:&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_URDF_032023A.zip URDF Files (Package, Version: 031823A)]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/MASS_INERTIA_UPDATE_05072023.zip Model MASS_INERTIA data update (Update Data File, Version: 050723A)]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=283</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=283"/>
		<updated>2024-04-01T08:02:01Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Performance Tunning [Futher Version] */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh Li-Ion battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to put BEAR actuators into damping mode in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Settings/BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Allow Executing Bash/Binary File as Program ===&lt;br /&gt;
&lt;br /&gt;
# Download the binary demo controller according to [https://github.com/Westwood-Robotics/BRUCE-OP/blob/main/Play/Demo/README.md README].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the following commands.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
chmod +x Play/bootup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/bootup_gamepad.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/sim_bootup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/terminate.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/low_level-aarch64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/low_level-x86_64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/high_level-aarch64&lt;br /&gt;
&lt;br /&gt;
chmod +x Play/Demo/high_level-x86_64&lt;br /&gt;
&lt;br /&gt;
chmod +x Startups/startup_setup.sh&lt;br /&gt;
&lt;br /&gt;
chmod +x Startups/usb_latency_setup.sh&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Config launch setup in &amp;lt;code&amp;gt;Play/config.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and follow the guidance &amp;lt;code&amp;gt;Play/bootup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Terminate in the end &amp;lt;code&amp;gt;Play/terminate.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Make all terminals go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, run USB low latency setup &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, run shared memory modules &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt; and choose &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the sense communication thread after BRUCE can stand on the ground on its own &amp;lt;code&amp;gt;python3 -m Startups.run_sense&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Demo.low_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Demo.high_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 7, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Demo.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-11.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two joysticks with push-buttons, two shoulder rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+X&lt;br /&gt;
|Running&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Latest Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning some parameters can potentially improve its performance, stability, or further tailor it to your specific demands, e.g., &lt;br /&gt;
&lt;br /&gt;
* Demo (in &amp;lt;code&amp;gt;BRUCE-OP/Play/Demo/demo_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: CoM velocity adjustment in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;COM_VELOCITY_LIMIT&amp;lt;/code&amp;gt;: CoM velocity limit in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;px_offset&amp;lt;/code&amp;gt;: CoM position adjustment in standing [m]&lt;br /&gt;
&lt;br /&gt;
* OP (in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: CoM velocity offset compensation [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;ka&amp;lt;/code&amp;gt;: x position of CoM in standing&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# &amp;lt;s&amp;gt;New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&amp;lt;/s&amp;gt;&lt;br /&gt;
#* The better solution is to design a simple adaptor PCB instead of redesigning the frame. Different groups would have very different applications thus the peripherals intended to be connected can be very different, as well as the desired mounting location, which then leads to very specific requirements of wire management. By making an adaptor board the current compact design of BRUCE can be kept while specific requirement for wire management can all be met.&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/demo_controller_0.0.5.zip Binary Demo Controller]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. 8502-8509.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=251</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=251"/>
		<updated>2024-02-24T16:27:03Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Hardware Platform */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh Li-Ion battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to put BEAR actuators into damping mode in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two joysticks with push-buttons, two shoulder rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# &amp;lt;s&amp;gt;New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&amp;lt;/s&amp;gt;&lt;br /&gt;
#* The better solution is to design a simple adaptor PCB instead of redesigning the frame. Different groups would have very different applications thus the peripherals intended to be connected can be very different, as well as the desired mounting location, which then leads to very specific requirements of wire management. By making an adaptor board the current compact design of BRUCE can be kept while specific requirement for wire management can all be met.&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=250</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=250"/>
		<updated>2024-02-24T16:26:26Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Hardware Platform */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh Li-Ion battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two joysticks with push-buttons, two shoulder rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# &amp;lt;s&amp;gt;New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&amp;lt;/s&amp;gt;&lt;br /&gt;
#* The better solution is to design a simple adaptor PCB instead of redesigning the frame. Different groups would have very different applications thus the peripherals intended to be connected can be very different, as well as the desired mounting location, which then leads to very specific requirements of wire management. By making an adaptor board the current compact design of BRUCE can be kept while specific requirement for wire management can all be met.&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=249</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=249"/>
		<updated>2024-02-24T16:25:27Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Future Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two joysticks with push-buttons, two shoulder rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# &amp;lt;s&amp;gt;New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&amp;lt;/s&amp;gt;&lt;br /&gt;
#* The better solution is to design a simple adaptor PCB instead of redesigning the frame. Different groups would have very different applications thus the peripherals intended to be connected can be very different, as well as the desired mounting location, which then leads to very specific requirements of wire management. By making an adaptor board the current compact design of BRUCE can be kept while specific requirement for wire management can all be met.&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=248</id>
		<title>3D Printed Parts</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=248"/>
		<updated>2024-02-23T07:07:29Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Original Package ===&lt;br /&gt;
These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip BRUCE 3D-Print Package]&lt;br /&gt;
&lt;br /&gt;
=== Updates ===&lt;br /&gt;
The followings are updates that have been made to BRUCE. Feel free to try them out!&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-02-04-08&lt;br /&gt;
|BRUCE Sole RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[Https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT.STEP Link]&lt;br /&gt;
|the Narrow Boot, print with TPU or similar for best results.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-02-04-09&lt;br /&gt;
|BRUCE Sole Pad RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT_ARCH_BOTTOM.STEP Link]&lt;br /&gt;
|the Narrow Boot Pad, make with silicone or similar for best results.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|BR01-01-02-05&lt;br /&gt;
|BRUCE TORSO RevC&lt;br /&gt;
|Feb. 23, 2024&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Update/BR01_TORSO_RevC.STEP Link]&lt;br /&gt;
|BRUCE Torso frame update to strengthen the shoulder&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=247</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=247"/>
		<updated>2024-01-28T08:45:58Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Bluetooth Gamepad */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two joysticks with push-buttons, two shoulder rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=246</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=246"/>
		<updated>2024-01-26T18:52:10Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two axes with push-buttons, two rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:&lt;br /&gt;
[[File:Gamepad Legend.png|none|thumb|892x892px]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:Gamepad_Legend.png&amp;diff=245</id>
		<title>File:Gamepad Legend.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:Gamepad_Legend.png&amp;diff=245"/>
		<updated>2024-01-26T18:51:38Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gamepad_Legend&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=244</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=244"/>
		<updated>2024-01-26T18:45:29Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Bluetooth Gamepad */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. Wireless ESTOP remote will not be included in the box. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt; Do '''&amp;lt;u&amp;gt;NOT&amp;lt;/u&amp;gt;''' us the Wireless ESTOP remote together with this gamepad. Signals will have interference and ESTOP will malfunction. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]There are two axes with push-buttons, two rollers with push-buttons, and 14 buttons on the remote. All buttons are labeled in the following figures:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
When BRUCE is in motion, the screen is used to show the control commends and robot status:[[File:Gamepad Legend 2.jpg|thumb|none]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:BLE_Remote.jpg&amp;diff=243</id>
		<title>File:BLE Remote.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:BLE_Remote.jpg&amp;diff=243"/>
		<updated>2024-01-26T18:43:40Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BLE Remote&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=242</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=242"/>
		<updated>2024-01-26T17:39:59Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[[File:Gamepad Legend 1.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]&lt;br /&gt;
[[File:BRUCE Gamepad SIDE.jpg|thumb]]&lt;br /&gt;
[[File:Gamepad Legend 2.jpg|thumb]]&lt;br /&gt;
[[File:BRUCE Gamepad TOP.jpg|thumb]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=241</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=241"/>
		<updated>2024-01-26T00:46:21Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Bluetooth Gamepad */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[[File:Gamepad Legend 1.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''ATTENTION:'''&amp;lt;/span&amp;gt;  Do '''NOT'''&lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb|BRUCE BLE Gamepad]]&lt;br /&gt;
[[File:BRUCE Gamepad SIDE.jpg|thumb]]&lt;br /&gt;
[[File:Gamepad Legend 2.jpg|thumb]]&lt;br /&gt;
[[File:BRUCE Gamepad TOP.jpg|thumb]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:Gamepad_Legend_2.jpg&amp;diff=240</id>
		<title>File:Gamepad Legend 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:Gamepad_Legend_2.jpg&amp;diff=240"/>
		<updated>2024-01-26T00:43:54Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gamepad_Legend_2&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:Gamepad_Legend_1.jpg&amp;diff=239</id>
		<title>File:Gamepad Legend 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:Gamepad_Legend_1.jpg&amp;diff=239"/>
		<updated>2024-01-26T00:43:16Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gamepad_Legend_1&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:BRUCE_Gamepad_SIDE.jpg&amp;diff=238</id>
		<title>File:BRUCE Gamepad SIDE.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:BRUCE_Gamepad_SIDE.jpg&amp;diff=238"/>
		<updated>2024-01-26T00:42:40Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BRUCE Gamepad_SIDE&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:BRUCE_Gamepad_TOP.jpg&amp;diff=237</id>
		<title>File:BRUCE Gamepad TOP.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:BRUCE_Gamepad_TOP.jpg&amp;diff=237"/>
		<updated>2024-01-26T00:41:52Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BRUCE Gamepad_TOP&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=236</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=236"/>
		<updated>2024-01-22T02:13:55Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Bluetooth Gamepad */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
Beginning Jan 20, 2024, all BRUCE ships with a Bluetooth Gamepad that has a screen, with wireless ESTOP integrated. &lt;br /&gt;
[[File:BRUCE Gamepad.jpg|none|thumb]]&lt;br /&gt;
Currently implemented Key Combinations/Commands on BRUCE-OP are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''BRUCE Gamepad Operation'''&lt;br /&gt;
!Gamepad Operation&lt;br /&gt;
!Function&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''To Change Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Start+Back&lt;br /&gt;
|Standing&lt;br /&gt;
|-&lt;br /&gt;
|Start+Y&lt;br /&gt;
|Walking&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Standing Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Up/Down&lt;br /&gt;
|Longitudinal CoM Position (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Lateral CoM Position (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Vertical CoM Position (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll (X)&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (+/-)&lt;br /&gt;
|Body Yaw (Z)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking Mode''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|Longitudinal CoM Velocity (X)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|Lateral CoM Velocity (Y)&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Body Yaw Rate (Z)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right Shoulder Roller (R+/R-)&lt;br /&gt;
|Right Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Left Shoulder Roller (L+/L-)&lt;br /&gt;
|Left Foot Yaw (+/-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Right/Left&lt;br /&gt;
|Foot Clearance (+/-)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''Other Functions''                                                                                     &lt;br /&gt;
|-&lt;br /&gt;
|A&lt;br /&gt;
|Hand Wave&lt;br /&gt;
|-&lt;br /&gt;
|Back&lt;br /&gt;
|Restore&lt;br /&gt;
|-&lt;br /&gt;
|Fn&lt;br /&gt;
|Cooling Speed (-)&lt;br /&gt;
|-&lt;br /&gt;
|Start+Fn&lt;br /&gt;
|Cooling Speed (+)&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Z +Right Axis Z (push down)&lt;br /&gt;
|Terminate (Software E-Stop)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:BRUCE_Gamepad.jpg&amp;diff=235</id>
		<title>File:BRUCE Gamepad.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:BRUCE_Gamepad.jpg&amp;diff=235"/>
		<updated>2024-01-22T01:53:32Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BRUCE Gamepad&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=234</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=234"/>
		<updated>2024-01-22T01:50:12Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Power Hub ===&lt;br /&gt;
The Power Hub on BRUCE is located right above its battery, and it serves as the hub that collects and distributes signal and power for BRUCE. See the figure below for pinout definition:[[File:Power_Hub_RevB.jpg|thumb|Power Hub|none|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
[[File:Edge2.jpg|none|thumb|821x821px]]&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. Refer to the figure below for pinout definition on BRUCE SENSE:[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE|none|450x450px]]An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+BRUCE SENSE LED&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# New Body that exposes the two USB Type A ports on Khadas. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:Edge2.jpg&amp;diff=233</id>
		<title>File:Edge2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:Edge2.jpg&amp;diff=233"/>
		<updated>2024-01-22T01:49:33Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: Xzhang uploaded a new version of File:Edge2.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Khadas Edge 2&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:Edge2.jpg&amp;diff=232</id>
		<title>File:Edge2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:Edge2.jpg&amp;diff=232"/>
		<updated>2024-01-22T01:44:30Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Khadas Edge 2&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:Edge2_Interface.jpg&amp;diff=231</id>
		<title>File:Edge2 Interface.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:Edge2_Interface.jpg&amp;diff=231"/>
		<updated>2024-01-22T01:42:03Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Khadas Edge 2&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=230</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=230"/>
		<updated>2024-01-22T01:34:02Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Future Work =&lt;br /&gt;
&lt;br /&gt;
# Add more explanation to the code, such as line by line legKF and est_KF reference. (Q1 2024)&lt;br /&gt;
# Provide a dual camera module.(Q1 2024)&lt;br /&gt;
# Option of a new pair of leg using KBMB as Knee Actuator for better payload capacity with the tradeoff of dynamic motions.(Q2 2024)&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=229</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=229"/>
		<updated>2024-01-22T01:29:12Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* BEAR Calibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth Gamepad ===&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
=== Future Work ===&lt;br /&gt;
Add more explanation to the code, such as line by line legKF and est_KF reference.&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=228</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=228"/>
		<updated>2024-01-21T19:32:15Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Developers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
=== Future Work ===&lt;br /&gt;
Add more explanation to the code, such as line by line legKF and est_KF reference.&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=227</id>
		<title>3D Printed Parts</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=227"/>
		<updated>2023-12-25T03:17:41Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Original Package ===&lt;br /&gt;
These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip BRUCE 3D-Print Package]&lt;br /&gt;
&lt;br /&gt;
=== Updates ===&lt;br /&gt;
The followings are updates that have been made to BRUCE. Feel free to try them out!&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-02-04-08&lt;br /&gt;
|BRUCE Sole RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[Https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT.STEP Link]&lt;br /&gt;
|the Narrow Boot, print with TPU or similar for best results.&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-02-04-09&lt;br /&gt;
|BRUCE Sole Pad RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT_ARCH_BOTTOM.STEP Link]&lt;br /&gt;
|the Narrow Boot Pad, make with silicone or similar for best results.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=226</id>
		<title>3D Printed Parts</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=226"/>
		<updated>2023-12-25T03:17:09Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Original Package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Original Package ===&lt;br /&gt;
These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip BRUCE 3D-Print Package]&lt;br /&gt;
&lt;br /&gt;
=== Updates ===&lt;br /&gt;
The followings are updates that have been made to BRUCE. Feel free to try them out!&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-02-04-08&lt;br /&gt;
|BRUCE Sole RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[Https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT.STEP Link]&lt;br /&gt;
|the Narrow Boot&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-02-04-09&lt;br /&gt;
|BRUCE Sole Pad RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT_ARCH_BOTTOM.STEP Link]&lt;br /&gt;
|the Narrow Boot Pad, make with silicone for best results.&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=225</id>
		<title>3D Printed Parts</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=225"/>
		<updated>2023-12-25T03:15:43Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Original Package ===&lt;br /&gt;
These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip BRUCE 3D-Print Package]&lt;br /&gt;
&lt;br /&gt;
=== Updates ===&lt;br /&gt;
The followings are updates that have been made to BRUCE. Feel free to try them out!&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-02-04-08&lt;br /&gt;
|BRUCE Sole RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[Https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT.STEP Link]&lt;br /&gt;
|the Narrow Boot&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-02-04-09&lt;br /&gt;
|BRUCE Sole Pad RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/Update/BR01_NARROWBOOT_ARCH_BOTTOM.STEP Link]&lt;br /&gt;
|the Narrow Boot Pad&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=224</id>
		<title>3D Printed Parts</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=224"/>
		<updated>2023-12-25T03:13:21Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Updates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Original Package ===&lt;br /&gt;
These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip BRUCE 3D-Print Package]&lt;br /&gt;
&lt;br /&gt;
=== Updates ===&lt;br /&gt;
The followings are updates that have been made to BRUCE. Feel free to try them out!&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-02-04-08&lt;br /&gt;
|BRUCE Sole RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[[/www/wwwroot/wiki.bruce-op.com/uploads/UpdateBR01 NARROWBOOT.STEP|Link]]&lt;br /&gt;
|the Narrow Boot&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-02-04-09&lt;br /&gt;
|BRUCE Sole Pad RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|[[/www/wwwroot/wiki.bruce-op.com/uploads/Update/BR01 NARROWBOOT ARCH BOTTOM.STEP|Link]]&lt;br /&gt;
|the Narrow Boot Pad&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=223</id>
		<title>3D Printed Parts</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=223"/>
		<updated>2023-12-25T03:01:59Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Original Package ===&lt;br /&gt;
These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
&lt;br /&gt;
[https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip BRUCE 3D-Print Package]&lt;br /&gt;
&lt;br /&gt;
=== Updates ===&lt;br /&gt;
The followings are updates that have been made to BRUCE. Feel free to try them out!&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!Update Date&lt;br /&gt;
!Download&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-0204-08/09&lt;br /&gt;
|BRUCE Sole RevB, BRUCE Sole Pad RevB&lt;br /&gt;
|Dec. 24, 2023&lt;br /&gt;
|Link&lt;br /&gt;
|the Narrow Boot&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=222</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=222"/>
		<updated>2023-12-25T02:51:04Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [[3D Printed Parts]]&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=221</id>
		<title>3D Printed Parts</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=3D_Printed_Parts&amp;diff=221"/>
		<updated>2023-12-25T02:49:58Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: Created page with &amp;quot;Hi&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=220</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=220"/>
		<updated>2023-12-19T23:55:28Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Serial Port &amp;amp; MAC Address ===&lt;br /&gt;
&lt;br /&gt;
Please config the serial port names (of BEAR, Dynamixel, and Pico) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;Settings.BRUCE_macros.py&amp;lt;/code&amp;gt; (line 272-283) and &amp;lt;code&amp;gt;BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; for your BRUCE before use.&lt;br /&gt;
&lt;br /&gt;
=== Startup Setup Before Launch ===&lt;br /&gt;
&lt;br /&gt;
BRUCE after VERSION 0.0.4 will be automatically configured at bootup with [https://help.ubuntu.com/stable/ubuntu-help/startup-applications.html.en Startup Applications].&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the bash file and leave it there &amp;lt;code&amp;gt;Startups/startup_setup.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== BEAR Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the calibration script &amp;lt;code&amp;gt;python3 -m  Util.BEAR_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== BRUCE SENSE ===&lt;br /&gt;
BRUCE SENSE refers to the Raspberry Pi Pico on BRUCE, which is used to collect the IMU and foot contact data, as well as to control the cooling system for BEARs. An example of how to use it is provided (&amp;lt;code&amp;gt;BRUCE-OP/Examples/bruce_sense&amp;lt;/code&amp;gt;). Users can use Arduino IDE to upload its code (&amp;lt;code&amp;gt;BRUCE-OP/Library/BRUCE_SENSE/pico/pico.ino&amp;lt;/code&amp;gt;). The LED on BRUCE SENSE indicates the following status.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Color&lt;br /&gt;
!Status&lt;br /&gt;
|-&lt;br /&gt;
|Green&lt;br /&gt;
|Initialization&lt;br /&gt;
|-&lt;br /&gt;
|White&lt;br /&gt;
|Idle Mode&lt;br /&gt;
|-&lt;br /&gt;
|Off&lt;br /&gt;
|Nominal Mode&lt;br /&gt;
|-&lt;br /&gt;
|Cyan&lt;br /&gt;
|Calibration Mode&lt;br /&gt;
|-&lt;br /&gt;
|Red&lt;br /&gt;
|Right Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Blue&lt;br /&gt;
|Left Foot in Contact&lt;br /&gt;
|-&lt;br /&gt;
|Amber&lt;br /&gt;
|Cooling System On&lt;br /&gt;
|-&lt;br /&gt;
|Yellow&lt;br /&gt;
|Delay Warning&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 4th paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
It is recommended to calibrate the IMU bias on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the calibration script &amp;lt;code&amp;gt;python3 -m Util.imu_calibration&amp;lt;/code&amp;gt;. Make sure the IMU is placed as flat as possible and do not move the IMU in calibration.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
* Walking related (most parameters are included in &amp;lt;code&amp;gt;BRUCE-OP/Play/Walking/walking_macros.py&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;zf_l&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;zf_r&amp;lt;/code&amp;gt;: swing final height [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;bx_offset&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;by_offset&amp;lt;/code&amp;gt;: velocity offset compensation [m]&lt;br /&gt;
&lt;br /&gt;
* TBC&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
====== Using Linux Screen ======&lt;br /&gt;
There are multiple threads running simultaneously on BRUCE, and it is done via running threads in multiple windows of one  screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] (https://www.gnu.org/software/screen/manual/screen.html) to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Finding The Reason of A Failure ======&lt;br /&gt;
When BRUCE failed to perform a certain motion or fell, you should be able to see errors and more specific details on the failure in each thread. Follow the steps below to visit each thread for error reports:&lt;br /&gt;
&lt;br /&gt;
# If operating the robot via Bluetooth remote, login via SSH to start; if already operating via SSH, jump to step 3.&lt;br /&gt;
# Attach to the BRUCE screen session. Use  command &amp;lt;code&amp;gt;screen -ls&amp;lt;/code&amp;gt; to show all opened screen sessions, find the session with BRUCE, and take note of the ID number of the session, then use &amp;lt;code&amp;gt;screen -r ID-of-BRUCE-SESSION&amp;lt;/code&amp;gt;  to reattach to the BRUCE session.&lt;br /&gt;
# Use command &amp;lt;code&amp;gt;Ctrl+A+#&amp;lt;/code&amp;gt; to jump into each window of the screen session to find out the error printout of each thread. # is the number of a screen window, the range is 0~6.&lt;br /&gt;
&lt;br /&gt;
For example, you might see low-level error in the TOP-LEVEL screen window, and once jumped into the LOW-LEVEL window, you might find out that the error is triggered by run-bear thread.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP&lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip 3D Print Parts]  These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# X. Zhang, &amp;quot;[https://escholarship.org/uc/item/9dk9r8d3 Application of Proprioception Quasi-Direct Drive Actuators on Dynamic Robotic Systems],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2019.&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
# J. Zhang, &amp;quot;[https://escholarship.org/uc/item/8002g72b Towards Application on Optimization-Based Methods for Motion Planning of Legged Robots],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2023.&lt;br /&gt;
# J. Zhang, J. Shen, Y. Liu and D. Hong, &amp;quot;[https://arxiv.org/abs/2304.00536 Design of a Jumping Control Framework with Heuristic Landing for Bipedal Robots],&amp;quot; 2023 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023, pp. TBD.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=2D_Drawings&amp;diff=183</id>
		<title>2D Drawings</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=2D_Drawings&amp;diff=183"/>
		<updated>2023-10-07T02:48:33Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== &amp;lt;big&amp;gt;Signal Cables&amp;lt;/big&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!QTY per set&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-SC-B2B-01&lt;br /&gt;
|BEAR SIGNAL_01&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-SC-B2B-02&lt;br /&gt;
|BEAR SIGNAL_02&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-02.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|BR01-SC-B2B-03&lt;br /&gt;
|BEAR SIGNAL_03&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-03.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|BR01-SC-B2B-04&lt;br /&gt;
|BEAR SIGNAL_04&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-04.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|BR01-SC-B2B-05&lt;br /&gt;
|BEAR SIGNAL_05&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-05.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|BR01-SC-B2B-06&lt;br /&gt;
|BEAR SIGNAL_06&lt;br /&gt;
|1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|BR01-SC-B2B-07&lt;br /&gt;
|BEAR SIGNAL_07&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-07.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|BR01-SC-FC-01&lt;br /&gt;
|FOOT_SIGNAL&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-FC-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|BR01-SC-BS-01&lt;br /&gt;
|SENSE_01&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-BS-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|BR01-SC-BS-02&lt;br /&gt;
|SENSE_02&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-BS-02.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|BR01-SP-ES-01&lt;br /&gt;
|ESTOP_SIGNAL_PWR&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SP-ES-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|BR01-SP-IMU-01&lt;br /&gt;
|IMU_SIGNAL_PWR&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SP-IMU-01.pdf Download]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=2D_Drawings&amp;diff=182</id>
		<title>2D Drawings</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=2D_Drawings&amp;diff=182"/>
		<updated>2023-10-06T23:50:09Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Signal Cables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== &amp;lt;big&amp;gt;Signal Cables&amp;lt;/big&amp;gt; ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!No.&lt;br /&gt;
!Part Number&lt;br /&gt;
!Name&lt;br /&gt;
!QTY per set&lt;br /&gt;
!Link&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|BR01-SC-B2B-01&lt;br /&gt;
|BEAR SIGNAL_01&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|BR01-SC-B2B-02&lt;br /&gt;
|BEAR SIGNAL_02&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-02.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|BR01-SC-B2B-03&lt;br /&gt;
|BEAR SIGNAL_03&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-03.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|BR01-SC-B2B-04&lt;br /&gt;
|BEAR SIGNAL_04&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-04.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|BR01-SC-B2B-05&lt;br /&gt;
|BEAR SIGNAL_05&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-05.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|BR01-SC-B2B-06&lt;br /&gt;
|BEAR SIGNAL_06&lt;br /&gt;
|1&lt;br /&gt;
|Download&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|BR01-SC-B2B-07&lt;br /&gt;
|BEAR SIGNAL_07&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-B2B-07.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|BR01-SC-FC-01&lt;br /&gt;
|FOOT_SIGNAL&lt;br /&gt;
|2&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-FC-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|BR01-SC-BS-01&lt;br /&gt;
|SENSE_01&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-BS-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|BR01-SC-BS-02&lt;br /&gt;
|SENSE_02&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SC-BS-02.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|BR01-SP-ES-01&lt;br /&gt;
|ESTOP_SIGNAL_PWR&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SP-ES-01.pdf Download]&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|BR01-SP-IMU-01&lt;br /&gt;
|IMU_SIGNAL_PWR&lt;br /&gt;
|1&lt;br /&gt;
|[https://wiki.bruce-op.com/uploads/2D_Drawings/Signal_Cables/BR01-SP-IMU-01.pdf Download]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Simulation_Files&amp;diff=177</id>
		<title>Simulation Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Simulation_Files&amp;diff=177"/>
		<updated>2023-09-29T17:43:26Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please refer to the BRUCE-OP/Simulation/ directory for more details on working with BRUCE in simulation.&lt;br /&gt;
&lt;br /&gt;
Access to the BRUCE-OP Github repo is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following files are archived and no longer supported:&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_URDF_032023A.zip URDF Files (Package, Version: 031823A)]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/MASS_INERTIA_UPDATE_05072023.zip Model MASS_INERTIA data update (Update Data File, Version: 050723A)]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Simulation_Files&amp;diff=176</id>
		<title>Simulation Files</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Simulation_Files&amp;diff=176"/>
		<updated>2023-09-29T17:43:11Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please refer to the BRUCE-OP/Simulation/ directory for more details on working with BRUCE in simulation.&lt;br /&gt;
&lt;br /&gt;
Access to the BRUCE-OP Github repo is required.&lt;br /&gt;
&lt;br /&gt;
Following files are archived and no longer supported:&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_URDF_032023A.zip URDF Files (Package, Version: 031823A)]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/MASS_INERTIA_UPDATE_05072023.zip Model MASS_INERTIA data update (Update Data File, Version: 050723A)]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=175</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=175"/>
		<updated>2023-09-29T00:48:18Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the homing script &amp;lt;code&amp;gt;python3 -m  Util.homing_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Performance Tunning [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning the following parameters can potentially improve its performance, stability, or further tailor it to your specific demands. &lt;br /&gt;
&lt;br /&gt;
A. Motion related:&lt;br /&gt;
&lt;br /&gt;
Most motion related parameters are included in ./BRUCE-OP/Play/Locomotion/locomotion_macros.py&lt;br /&gt;
&lt;br /&gt;
# COP: reachable range of the distance between food and body center&lt;br /&gt;
# DCM_velocity_Compensation: velocity offsets of motions&lt;br /&gt;
&lt;br /&gt;
B. TBC&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 3rd paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
&lt;br /&gt;
It is recommended to calibrate the IMU on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#define calibration true&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Upload &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;ISM330DHCX.h&amp;lt;/code&amp;gt; to BRUCE SENSE, e.g., using [https://support.arduino.cc/hc/en-us/articles/4733418441116-Upload-a-sketch-in-Arduino-IDE Arduino IDE] with the Raspberry Pi Pico [https://github.com/earlephilhower/arduino-pico setup].&lt;br /&gt;
# Make sure the IMU is horizontal and static. This can be achieved by putting the bubble leveler that came with your BRUCE on one of the hip YAW motors and make sure the bubble is in the center of the leveler.&lt;br /&gt;
# Run the program and wait for the calibration to be done. The biases will be displayed at the end.&lt;br /&gt;
# Update the biases on Line 558-563 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; back to &amp;lt;code&amp;gt;#define calibration false&amp;lt;/code&amp;gt; and upload again to recover.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP &lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip 3D Print Parts]  These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=174</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=174"/>
		<updated>2023-06-17T07:40:13Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the homing script &amp;lt;code&amp;gt;python3 -m  Util.homing_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 3rd paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
&lt;br /&gt;
It is recommended to calibrate the IMU on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#define calibration true&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Upload &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;ISM330DHCX.h&amp;lt;/code&amp;gt; to BRUCE SENSE, e.g., using [https://support.arduino.cc/hc/en-us/articles/4733418441116-Upload-a-sketch-in-Arduino-IDE Arduino IDE] with the Raspberry Pi Pico [https://github.com/earlephilhower/arduino-pico setup].&lt;br /&gt;
# Make sure the IMU is horizontal and static. This can be achieved by putting the bubble leveler that came with your BRUCE on one of the hip YAW motors and make sure the bubble is in the center of the leveler.&lt;br /&gt;
# Run the program and wait for the calibration to be done. The biases will be displayed at the end.&lt;br /&gt;
# Update the biases on Line 558-563 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; back to &amp;lt;code&amp;gt;#define calibration false&amp;lt;/code&amp;gt; and upload again to recover.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP &lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-061723.zip 3D Print Parts]  These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=173</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=173"/>
		<updated>2023-06-12T04:07:35Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the homing script &amp;lt;code&amp;gt;python3 -m  Util.homing_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 3rd paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
&lt;br /&gt;
It is recommended to calibrate the IMU on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#define calibration true&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Upload &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;ISM330DHCX.h&amp;lt;/code&amp;gt; to BRUCE SENSE, e.g., using [https://support.arduino.cc/hc/en-us/articles/4733418441116-Upload-a-sketch-in-Arduino-IDE Arduino IDE] with the Raspberry Pi Pico [https://github.com/earlephilhower/arduino-pico setup].&lt;br /&gt;
# Make sure the IMU is horizontal and static. This can be achieved by putting the bubble leveler that came with your BRUCE on one of the hip YAW motors and make sure the bubble is in the center of the leveler.&lt;br /&gt;
# Run the program and wait for the calibration to be done. The biases will be displayed at the end.&lt;br /&gt;
# Update the biases on Line 558-563 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; back to &amp;lt;code&amp;gt;#define calibration false&amp;lt;/code&amp;gt; and upload again to recover.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP &lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-031623.zip 3D Print Parts]  These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/HIP_CALIBRATION_RevC.STEP Calibration Tools]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=172</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=172"/>
		<updated>2023-05-18T20:12:08Z</updated>

		<summary type="html">&lt;p&gt;Xzhang: /* Licensing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to BRUCE (Bipedal Robot Unit with Compliannce Enhanced) Wiki, where we update infomation on hardware and software of BRUCE.&lt;br /&gt;
&lt;br /&gt;
= About BRUCE Project =&lt;br /&gt;
&lt;br /&gt;
BRUCE is an open-platform project led by [https://www.westwoodrobotics.io/ Westwood Robotics].&lt;br /&gt;
It focuses on the development of a low-cost kid-size humanoid robot for research and education.&lt;br /&gt;
&lt;br /&gt;
=== Licensing ===&lt;br /&gt;
&lt;br /&gt;
BRUCE is dual-licensed under both commercial and open-source licenses.&lt;br /&gt;
The commercial BRUCE license gives you the full rights to create and distribute the platform on your own terms without any open-source license obligations.&lt;br /&gt;
BRUCE is also available under version 3 (or later version) of the GNU General Public License (GPL), which is ideal for use cases such as open-source projects with open-source distribution, student/academic purposes, hobby projects, internal research projects without external distribution, or other projects where all GPL obligations can be met.&lt;br /&gt;
Read the full text of [https://www.gnu.org/licenses/gpl-3.0.html the GNU GPL version 3] for details.&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
=== Hardware Platform ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_cover_photo.jpg|thumb|Photo of BRUCE platform]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:Power_Hub_RevB.jpg|thumb|Power Hub]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_SENSE.jpg|thumb|BRUCE SENSE]]&lt;br /&gt;
&lt;br /&gt;
BRUCE has a total height of 70 cm adapting an average human body proportion. It is composed of a torso, two 3-DoF arms, and two 5-DoF legs.&lt;br /&gt;
Each arm of BRUCE has a ball shoulder joint and a single DoF elbow joint.&lt;br /&gt;
Each leg of BRUCE has a spherical hip joint, a single DoF knee joint, and a single DoF ankle joint.&lt;br /&gt;
Each foot has a line contact with the ground.&lt;br /&gt;
To have better torque transparency and compliance to the unknown environment, proprioceptive actuation is equipped for each leg joint, using the [https://www.westwoodrobotics.io/koala-bear/ Koala BEAR] actuators. &lt;br /&gt;
Moreover, BRUCE's legs are designed to have low inertia for performing highly dynamic motions. A 2-DoF parallel actuation configuration realized by a cable-driven differential pulley system is applied to the hip joint to reduce the mass and inertia of the femur link. Meanwhile, two pairs of 4-bar linkage mechanisms are used to relocate the ankle actuator to the femur link for the light weight of the tibia link.&lt;br /&gt;
Finally, to ensure reliable ground contact information, a sensing foot is designed based on the working principle of an electronic switch.&lt;br /&gt;
&lt;br /&gt;
BRUCE is fully untethered. &lt;br /&gt;
All the electronics are directly mounted onto the torso for easy installation and better weight distribution. &lt;br /&gt;
[https://www.khadas.com/edge2 Khadas Edge2] with RK3588S is utilized as the onboard computing resource.&lt;br /&gt;
A 14.8V 3000mAh LiPo battery is used to power the whole system with a running time of approximately 20 minutes.&lt;br /&gt;
For the sake of safety during operation, a wireless E-Stop built in-house is mounted onboard as well to cut the power in emergencies. &lt;br /&gt;
In total, BRUCE has a net weight of around 4.8 kg.&lt;br /&gt;
The wiring diagrams of BRUCE are shown in the images.&lt;br /&gt;
&lt;br /&gt;
=== Software Architecture ===&lt;br /&gt;
&lt;br /&gt;
To make BRUCE favorable to dynamic behaviors which require fast response, the overall software framework is developed in a multithreaded environment, which includes a state estimation thread combined with robot model computation, a low-level whole-body control thread, a high-level footstep planning thread, and a top-level user input thread.&lt;br /&gt;
The main advantage of multithreading is that the idle time of the CPU can be kept to minimum since the waiting time for sensor response can be well distributed and utilized, which leads to faster overall execution as the CPU would have been idle if only a single thread was executed. &lt;br /&gt;
Data communication utilizes a custom shared memory library. All programs are implemented in Python while some parts, including kinematics, dynamics, and state estimation, are precompiled using [https://numba.pydata.org/ Numba] for acceleration.&lt;br /&gt;
&lt;br /&gt;
= Working with BRUCE =&lt;br /&gt;
&lt;br /&gt;
BRUCE is ready to go with the [https://github.com/Westwood-Robotics/BRUCE-OP default software] provided. Below are the detailed instructions on how to operate and maintain the platform.&lt;br /&gt;
&lt;br /&gt;
=== Attention ===&lt;br /&gt;
&lt;br /&gt;
* Always remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; immediately in emergencies!&lt;br /&gt;
* Your system may need some fine tuning before it can perform perfectly, i.e., due to slight differences in joint resistance and part tolerances, systems may vary in tuning parameters.&lt;br /&gt;
* The current state estimation is relatively naive, and we are working on a better version to improve stability.&lt;br /&gt;
&lt;br /&gt;
=== Dependencies ===&lt;br /&gt;
&lt;br /&gt;
* Python 3.6+ with pip, numpy, pyserial, termcolor, matplotlib, scipy, osqp, numba, dynamixel, posix_ipc&lt;br /&gt;
* [https://github.com/Westwood-Robotics/PyBEAR-WR PyBEAR] for communication with the BEAR actuators&lt;br /&gt;
&lt;br /&gt;
=== Operating ===&lt;br /&gt;
&lt;br /&gt;
''Quick Launch''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Entering the following command &amp;lt;code&amp;gt;./bootup.sh&amp;lt;/code&amp;gt; and follow the guidance.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Step 2.&lt;br /&gt;
&lt;br /&gt;
''Full Operating''&lt;br /&gt;
&lt;br /&gt;
# Go to BRUCE-OP folder &amp;lt;code&amp;gt;cd BRUCE/BRUCE-OP&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Set up USB low latency &amp;lt;code&amp;gt;Startups/usb_low_latency.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Run the shared memory module &amp;lt;code&amp;gt;python3 -m Startups.memory_manager&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 1, start the BEAR actuator thread &amp;lt;code&amp;gt;python3 -m Startups.run_bear&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start the Dynamixel motor thread &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 3, initialize BRUCE &amp;lt;code&amp;gt;python3 -m Play.initialize&amp;lt;/code&amp;gt;, enter &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;, and let BRUCE stand on the ground on its own. If the joint angle is weird, a [[Main_Page#Calibration|calibration]] needs to be conducted. &lt;br /&gt;
# In terminal 3, start the state estimation thread &amp;lt;code&amp;gt;python3 -m Startups.run_estimation&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 4, start the low-level control thread &amp;lt;code&amp;gt;python3 -m Play.Walking.low_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 5, start the high-level planning thread &amp;lt;code&amp;gt;python3 -m Play.Walking.high_level&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 6, start the top-level user keyboard input thread &amp;lt;code&amp;gt;python3 -m Play.Walking.top_level&amp;lt;/code&amp;gt;.&lt;br /&gt;
# You can now play with BRUCE and remember to press the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; in emergencies.&lt;br /&gt;
# You can recover BRUCE by releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; and then repeating Steps 4-10.&lt;br /&gt;
&lt;br /&gt;
=== Calibration ===&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_nominal_position.jpg|thumb|BRUCE nominal position]]&lt;br /&gt;
[[File:BRUCE_calibration_position.jpg|thumb|BRUCE calibration position]]&lt;br /&gt;
&lt;br /&gt;
The nominal posture for BRUCE is all limbs completely sprawled out as shown in the image. Note that the hip, knee, and ankle joints are aligned. You can check it with the following instructions:&lt;br /&gt;
# Go through Steps 1-5 in ''Full Operating''.&lt;br /&gt;
# In terminal 3, entering the following command &amp;lt;code&amp;gt;python3 -m  Play.initialize&amp;lt;/code&amp;gt; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the leg configuration is off, the related BEAR actuators need to be re-calibrated to the correct zero position with the following instructions:&lt;br /&gt;
# Disable the BEAR actuators by pressing and releasing the &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Adjust BRUCE to the calibration posture as shown in the image. Use the calibration tool if necessary.&lt;br /&gt;
# In terminal 3, run the homing script &amp;lt;code&amp;gt;python3 -m  Util.homing_calibration&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Select the actuator number that you wish to home and follow the guidance.&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Khadas Edge2 ===&lt;br /&gt;
&lt;br /&gt;
If you want to make further development with the onboard [https://www.khadas.com/edge2 Khadas Edge2], please refer to its online documents [https://docs.khadas.com/products/sbc/edge2/start here]. To use external keyboard and mouse, you can unplug the original 4-wire USB-C signal cable (the other one is 2-wire for power delivery) without disassembly.&lt;br /&gt;
&lt;br /&gt;
=== State Estimation ===&lt;br /&gt;
&lt;br /&gt;
Two versions of state estimation are provided. One is using complementary filter solely, the details of which are described in the 3rd paper of [[Main_Page#Reference|Reference]]. The other is using complementary filter for the base orientation (similar to the former) while Kalman filter for the base position and velocity, which greatly enhances the estimation performance. Interested users can refer to the document [https://wiki.bruce-op.com/uploads/BRUCE_state_estimation.pdf here].&lt;br /&gt;
&lt;br /&gt;
=== IMU Calibration ===&lt;br /&gt;
&lt;br /&gt;
It is recommended to calibrate the IMU on your BRUCE for better performance of the state estimation. &lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;#define calibration true&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Upload &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;ISM330DHCX.h&amp;lt;/code&amp;gt; to BRUCE SENSE, e.g., using [https://support.arduino.cc/hc/en-us/articles/4733418441116-Upload-a-sketch-in-Arduino-IDE Arduino IDE] with the Raspberry Pi Pico [https://github.com/earlephilhower/arduino-pico setup].&lt;br /&gt;
# Make sure the IMU is horizontal and static. This can be achieved by putting the bubble leveler that came with your BRUCE on one of the hip YAW motors and make sure the bubble is in the center of the leveler.&lt;br /&gt;
# Run the program and wait for the calibration to be done. The biases will be displayed at the end.&lt;br /&gt;
# Update the biases on Line 558-563 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; respectively.&lt;br /&gt;
# Change Line 10 of &amp;lt;code&amp;gt;pico.ino&amp;lt;/code&amp;gt; back to &amp;lt;code&amp;gt;#define calibration false&amp;lt;/code&amp;gt; and upload again to recover.&lt;br /&gt;
&lt;br /&gt;
=== Wireless ESTOP Lite ===&lt;br /&gt;
The Wireless ESTOP Lite system has been applied on BRUCE and other systems that are powered with BEAR actuators and has been a very handy gadget.&lt;br /&gt;
&lt;br /&gt;
You can find more details about it here: https://github.com/Westwood-Robotics/Wireless_ESTOP &lt;br /&gt;
&lt;br /&gt;
= Downloads =&lt;br /&gt;
&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_V1.4_DUMMY.STEP BRUCE V1.4 3D Model]&lt;br /&gt;
# [https://wiki.bruce-op.com/uploads/BRUCE_PRINT_package-031623.zip 3D Print Parts]  These are the parts that can be damaged during intense testing, so it is recommended to always print and keep some spare ones handy. You can also contact Westwood Robotics to purchase these parts if you don't have access to a 3D printer.&lt;br /&gt;
# [[Simulation Files]]&lt;br /&gt;
# [[2D Drawings|2D drawing of Signal Cables]]&lt;br /&gt;
# Calibration Tools (To be uploaded by the administrator...)&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publication on BRUCE development:&lt;br /&gt;
&lt;br /&gt;
# Y. Liu, J. Shen, J. Zhang, X. Zhang, T. Zhu and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/9811790 Design and Control of a Miniature Bipedal Robot with Proprioceptive Actuation for Dynamic Behaviors],&amp;quot; 2022 IEEE International Conference on Robotics and Automation (ICRA), 2022, pp. 8547-8553.&lt;br /&gt;
# J. Shen, J. Zhang, Y. Liu, and D. Hong, &amp;quot;[https://ieeexplore.ieee.org/document/10000075 Implementation of a Robust Dynamic Walking Controller on a Miniature Bipedal Robot with Proprioceptive Actuation],&amp;quot; 2022 IEEE-RAS International Conference on Humanoid Robots (Humanoids), 2022, pp. 39-46.&lt;br /&gt;
# J. Shen, &amp;quot;[https://escholarship.org/uc/item/52q9d7vk Locomotion Analysis and Control of a Miniature Bipedal Robot],&amp;quot; Ph.D. Dissertation, University of California, Los Angeles (UCLA), 2022.&lt;br /&gt;
&lt;br /&gt;
= Contributing to BRUCE Wiki =&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki release mailing list]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]&lt;/div&gt;</summary>
		<author><name>Xzhang</name></author>
	</entry>
</feed>