<?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=Jshen</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=Jshen"/>
	<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php/Special:Contributions/Jshen"/>
	<updated>2026-05-17T06:27:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=329</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=329"/>
		<updated>2025-01-20T08:55:15Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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_hardware_overview.png|thumb|BRUCE hardware overview]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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;
A hardware overview and schematic diagram 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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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.Walking.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.Walking.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.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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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.6.zip Binary Demo Controller]&lt;br /&gt;
# [[Other Accessories]]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=328</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=328"/>
		<updated>2024-09-04T04:33:34Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
=== 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_hardware_overview.png|thumb|BRUCE hardware overview]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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;
A hardware overview and schematic diagram 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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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.6.zip Binary Demo Controller]&lt;br /&gt;
# [[Other Accessories]]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:BRUCE_hardware_overview.png&amp;diff=327</id>
		<title>File:BRUCE hardware overview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:BRUCE_hardware_overview.png&amp;diff=327"/>
		<updated>2024-07-31T05:41:51Z</updated>

		<summary type="html">&lt;p&gt;Jshen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=325</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=325"/>
		<updated>2024-07-31T05:35:12Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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_hardware_overview.png|thumb|BRUCE hardware overview]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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;
A hardware overview and schematic diagram 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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=323</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=323"/>
		<updated>2024-07-31T05:34:14Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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_hardware_overview.png|thumb|BRUCE hardware overview]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 schematic diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=322</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=322"/>
		<updated>2024-07-31T05:33:42Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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_hardware_overview.jpg|thumb|BRUCE hardware overview]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 schematic diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=321</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=321"/>
		<updated>2024-07-31T05:32:12Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Introduction */&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_harware_overview.jpg|thumb|BRUCE hardware overview]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 schematic diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=320</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=320"/>
		<updated>2024-07-31T05:20:30Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Introduction */&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_harware_overview1.jpg|thumb|BRUCE hardware overview1]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_harware_overview2.jpg|thumb|BRUCE hardware overview2]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_schematic_diagram.jpg|thumb|BRUCE schematic diagram]]&lt;br /&gt;
&lt;br /&gt;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 schematic diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=319</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=319"/>
		<updated>2024-07-30T09:50:31Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&lt;br /&gt;
[[File:BLE Remote.jpg|none|thumb|869x869px]]&lt;br /&gt;
After BRUCE is launched, 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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=318</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=318"/>
		<updated>2024-07-30T09:46:55Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Finding The Reason of A Failure */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] to learn the basic operation and functions of Linux Screen.&lt;br /&gt;
&lt;br /&gt;
====== Looking Into Malfunction ======&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=317</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=317"/>
		<updated>2024-07-30T09:40:34Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
=== 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:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= For Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=316</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=316"/>
		<updated>2024-07-30T09:38:58Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Wireless ESTOP Lite */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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. You can find more details [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=315</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=315"/>
		<updated>2024-07-30T09:38:48Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Wireless ESTOP Lite */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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 [https://github.com/Westwood-Robotics/Wireless_ESTOP here].&lt;br /&gt;
&lt;br /&gt;
=== Performance Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=314</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=314"/>
		<updated>2024-07-30T09:37:06Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* IMU 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;
=== 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:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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, in case a new IMU is used. &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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=313</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=313"/>
		<updated>2024-07-30T09:33:06Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Simulation Environment */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/README.md&amp;lt;/code&amp;gt; for more information.&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=312</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=312"/>
		<updated>2024-07-30T09:32:38Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Simulation Environment */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation environment is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/READ.md&amp;lt;/code&amp;gt; for more information.&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=311</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=311"/>
		<updated>2024-07-30T09:32:04Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Simulation Environment */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/READ.md&amp;lt;/code&amp;gt; for more information.&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=310</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=310"/>
		<updated>2024-07-30T09:31:56Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Simulation Environment */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;BRUCE-OP/Simulation/READ.md&amp;lt;/code&amp;gt; folder for more information.&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=309</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=309"/>
		<updated>2024-07-30T09:31:34Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Simulation Environment */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;README.md&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;BRUCE-OP/Simulation&amp;lt;/code&amp;gt; folder for more information.&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=308</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=308"/>
		<updated>2024-07-30T09:31:22Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Simulation Environment */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;README.md&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;BRUCE-OP/Simulation&amp;lt;/code&amp;gt; folder for more information.&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=307</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=307"/>
		<updated>2024-07-30T09:29:22Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
=== 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:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&lt;br /&gt;
=== Simulation Environment ===&lt;br /&gt;
BRUCE Gym simulation is based on a custom library to interact with Gazebo. Please refer to &amp;lt;code&amp;gt;README.md&amp;lt;code&amp;gt; in the &amp;lt;code&amp;gt;BRUCE-OP/Simulation&amp;lt;code&amp;gt; folder for more information.&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=306</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=306"/>
		<updated>2024-07-30T09:10:57Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&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 Tuning [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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=305</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=305"/>
		<updated>2024-07-30T08:00:08Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Using Linux Screen */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&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 concurrently on BRUCE, and it is achieved with multiple windows under one screen session. It is recommended to go through [https://www.gnu.org/software/screen/manual/screen.html this manual] 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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=304</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=304"/>
		<updated>2024-07-30T07:53:37Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Reference */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&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;
Publications 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=303</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=303"/>
		<updated>2024-07-30T07:09:20Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&lt;br /&gt;
|Terminate (Software &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt;)&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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=302</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=302"/>
		<updated>2024-07-30T07:08:29Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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 figure:&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;
|CoM X Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM Y Position&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Z Position&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis X&lt;br /&gt;
|Body Roll Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Axis Y&lt;br /&gt;
|Body Pitch Angle&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller &lt;br /&gt;
|Body Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |    ''In Walking/Running Mode''&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis X&lt;br /&gt;
|CoM X Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Left Axis Y&lt;br /&gt;
|CoM Y Velocity&lt;br /&gt;
|-&lt;br /&gt;
|Right Shoulder Roller&lt;br /&gt;
|Body Yaw Rate&lt;br /&gt;
|-&lt;br /&gt;
|Start + Right Shoulder Roller&lt;br /&gt;
|Right Foot Yaw Angle&lt;br /&gt;
|-&lt;br /&gt;
|Start + Left Shoulder Roller&lt;br /&gt;
|Left Foot Yaw Angle&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; |    ''Others''&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&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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=301</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=301"/>
		<updated>2024-07-30T06:18:24Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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 &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; integrated. Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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;''' use the Wireless &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; remote together with this gamepad. Signals will have interference and &amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;'''E-STOP'''&amp;lt;/span&amp;gt; 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=300</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=300"/>
		<updated>2024-07-30T06:17:24Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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;''' use 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=299</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=299"/>
		<updated>2024-07-30T05:50:24Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
=== 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:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=298</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=298"/>
		<updated>2024-07-30T05:43:47Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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 angles are 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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=297</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=297"/>
		<updated>2024-07-30T05:42:38Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=296</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=296"/>
		<updated>2024-07-30T03:34:22Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Serial Port &amp;amp; MAC Address */&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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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 BRUCE SENSE) and MAC address of your gamepad (if applicable) in &amp;lt;code&amp;gt;BRUCE/BRUCE_SERIAL_PORT&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BRUCE/BRUCE-OP/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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=File:BRUCE_software_architecture.png&amp;diff=295</id>
		<title>File:BRUCE software architecture.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=File:BRUCE_software_architecture.png&amp;diff=295"/>
		<updated>2024-07-30T03:10:16Z</updated>

		<summary type="html">&lt;p&gt;Jshen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=294</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=294"/>
		<updated>2024-07-30T03:09:53Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
[[File:BRUCE_software_architecture.png|thumb|BRUCE software architecture]]&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 diagram of BRUCE is shown in the image.&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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=293</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=293"/>
		<updated>2024-07-30T02:41:36Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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 diagram of BRUCE is shown in the image.&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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=292</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=292"/>
		<updated>2024-07-30T02:35:25Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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;
&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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=282</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=282"/>
		<updated>2024-03-30T09:36:28Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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 [Futher 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=281</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=281"/>
		<updated>2024-03-30T09:35:45Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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 [Futher 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;: velocity adjustment in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;COM_VELOCITY_LIMIT&amp;lt;/code&amp;gt;: 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;: 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=280</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=280"/>
		<updated>2024-03-30T09:35:25Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* 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 [Futher Version] ===&lt;br /&gt;
While BRUCE is in a healthy functional status, tuning 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;: velocity adjustment in moving [m]&lt;br /&gt;
# &amp;lt;code&amp;gt;COM_VELOCITY_LIMIT&amp;lt;/code&amp;gt;: 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;: 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=279</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=279"/>
		<updated>2024-03-14T09:25:45Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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 [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;
# [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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=278</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=278"/>
		<updated>2024-03-14T09:24:46Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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 enter &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;, enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;y&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;, enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;y&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 [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;
# [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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=277</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=277"/>
		<updated>2024-03-14T09:24:29Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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 enter &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; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;y&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 [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;
# [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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=276</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=276"/>
		<updated>2024-03-14T09:21:46Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Reference */&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 enter &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; and enter &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;y&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 [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;
# [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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=275</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=275"/>
		<updated>2024-03-14T09:17:20Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Allow Executing Bash/Binary File as Program */&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 enter &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; and enter &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;y&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 [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;
# [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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=274</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=274"/>
		<updated>2024-03-14T09:17:11Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Allow Executing Bash/Binary File as Program */&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 enter &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; and enter &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;y&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 [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;
# [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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=273</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=273"/>
		<updated>2024-03-14T09:17:01Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Allow Executing Bash/Binary File as Program */&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 enter &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; and enter &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;y&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 [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;
# [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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=272</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=272"/>
		<updated>2024-03-14T09:15:29Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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 enter &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; and enter &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;y&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 [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;
# [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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=271</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=271"/>
		<updated>2024-03-14T09:14:06Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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 enter &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; and enter &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;y&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-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+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 [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;
# [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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=270</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=270"/>
		<updated>2024-03-14T09:13:04Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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 afterwards &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 enter &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; and enter &amp;lt;code&amp;gt;y&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; and enter &amp;lt;code&amp;gt;y&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-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+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 [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;
# [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. 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>Jshen</name></author>
	</entry>
	<entry>
		<id>https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=269</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bruce-op.com/index.php?title=Main_Page&amp;diff=269"/>
		<updated>2024-03-14T09:12:15Z</updated>

		<summary type="html">&lt;p&gt;Jshen: /* Operating */&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 Dynamixel motor thread afterwards &amp;lt;code&amp;gt;python3 -m Startups.run_dxl&amp;lt;/code&amp;gt;.&lt;br /&gt;
# In terminal 2, start 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 enter &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.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 6, 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 7, 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+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 [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;
# [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. 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>Jshen</name></author>
	</entry>
</feed>