Author: Nicolas Kosanovic
Email: [email protected]
We’d like to thank ROBOTIS for their work in developing OP3’s codebase!
Much of this guide compresses information found on the ROS and ROBOTIS E-Manual websites to create a very short-and-simple “quickstart” guide for those wishing to begin working with OP3, a miniature humanoid telepresence platform.
Furthermore, this tutorial assumes that OP3 has only been physically assembled, without any software downloaded onto the robot’s embedded PC (intel NUC) or its subcontroller (ROBOTIS OpenCR 1.0).
This page will teach you how to set up software on a ROBOTIS OP3 humanoid. Normal text within this document explains why certain actions were chosen or why they were done; white text explains what you need to do. Links to other websites (e.g. software downloads) are underlined.
To follow this tutorial, you will need the following:
- 1x Windows PC
- 1x FAT32-Formatted USB Thumb Drive (8+ GB recommended)
- 1x MicroUSB Cable
- 1x Monitor
- 1x USB Keyboard and Mouse
- 1x NUC Power Supply (19V, 5A)
- A wired internet connection via Ethernet
- 1x 12V/5A barrel jack AC Adapter compatable with OpenCR and Dynamixel XM430.
Step 1: Intel NUC Setup
To begin, let’s set up OP3’s NUC. As documented online, OP3 is meant to use Ubuntu 16.04 and ROS Kinetic; this is far beyond deprecated, as Ubuntu 16.04 stopped receiving support in 2020. Thus, we will install Ubuntu 20.04 on OP3’s embedded PC. To accomplish this:
- Download Rufus and the Ubuntu 20.04 ISO Desktop Image on a Windows-based PC.
- When the downloads are complete, insert the formatted USB thumb drive into the Windows PC and open Rufus.
- Select the Ubuntu 20.04 ISO image and flash it to the USB thumb drive.
- When Rufus is finished processing, remove the USB thumb drive and insert it within OP3’s NUC.
- Turn on OP3’s NUC. Make sure that the USB Keyboard, Mouse, Ethernet Cable, and Monitor are plugged in.
- Run through the normal Ubuntu setup GUI. Make sure to check the box to automatically download drivers while setting up Ubuntu.
- Once finished, boot into Ubuntu 20.04 as normal.
Now, you should have access to Ubuntu 20.04, with an internet connection. Congrats, we’re just a few steps away from being finished here! Next up, we’re gonna have to install some critical dependencies, ROS, and then the ROBOTIS OP3 packages. Open a new terminal with CTRL+SHIFT+T, and copy and paste the following commands one-by-one. If prompted, enter your password. This whole process should take ~30 mins to complete.
sudo apt update
sudo apt upgrade
sudo apt install git
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install ros-noetic-desktop-full
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
mkdir -p ~/op3_ros_ws/src
cd ~/op3_ros_ws/
catkin_make
source devel/setup.bash
cd src/
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-OP3.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-msgs.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Common.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Tools.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-OP3-Demo.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-Framework.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-Framework-msgs.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-Utility.git
git clone --recursive https://github.com/ROBOTIS-GIT/ROBOTIS-Math.git
git clone --recursive https://github.com/ROBOTIS-GIT/DynamixelSDK.git
sudo apt install libncurses-dev
git clone --recursive https://github.com/ahornung/humanoid_msgs.git
After doing all this, you can attempt to compile the code using the following:
cd ~/op3_ros_ws/
catkin_make
source devel/setup.bash
If it fails to compile, you can remedy this by doing the following:
- Fix OpenCV version difference problems.
- Fix QT version difference problems.
- Add “tf” to the CMakeLists file of the OP3_GUI_DEMO
op3_ros_ws>src>ROBOTIS-OP3-DEMO>op3_ball_detector>CMakeLists.txt>Line 23:
Change “OpenCV 3 Required” to “OpenCV Required”.
op3_ros_ws>src>ROBOTIS-OP3-Tools>op3_tuner_client>src>main_window.cpp>Line 25:
Add the following line: “#include <QButtonGroup>”
op3_ros_ws>src>ROBOTIS-OP3-Tools>op3_gui_demo>CMakeLists.txt>Line 14
Make a new line and enter in “tf”, to ensure that catkin will find the “tf” package as it compiles the workspace.
With these changes, you can go back to the workspace’s root directory (~/op3_ros_ws/), call “catkin_make”, and have everything compile correctly. Don’t forget to source the underlay (“source devel/setup.bash”) to continue!
Step 2: OpenCR 1.0 Setup
Moving back to the Windows-based PC for a little while, we will have to reflash the proper firmware onto the OpenCR 1.0. When doing this, turn off the OpenCR 1.0’s power switch, and remove its external power supply (if connected).
Then, connect the Windows PC to the OpenCR 1.0 via a Micro USB cable.
After this, open up the Arudino IDE (or download it if you don’t already have it installed) and then open up the preferences page by hitting CTRL+COMMA.
Click the button to the right of the “Additional Board Manager URLs” section and paste the following to allow the Arduino IDE to find the OpenCR 1.0 board.
https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json
Then, under “Tools”, open the “Boards Manager” (CTRL+SHIFT+B) and search for “OpenCR”. Install the latest version from ROBOTIS, as seen below.
Now, select Tools>Board>OpenCR.
After that, click on File>Examples>OP3>opencr_OP3. This will open a sketch composed of several .cpp and .h files.
IT IS CRITICAL THAT YOU MAKE THE FOLLOWING MODIFICATION to the “dxl_hw.cpp” file:
Comment out Line 27’s “dxl_hw_power_disable()”, and write on Line 28: “dxl_hw_power_enable()”, as shown below.
Now, upload the code to the OpenCR 1.0, and once it completes the upload, disconnect it from the Windows PC.
Finally, plug in the 12V power connector to the OpenCR board and flip the board’s switch to “ON”. If everything is done correctly, after a few seconds, all of OP3’s Dynamixel servos should blink red for once, to indicate they are receiving power.
Step 3: Run a GUI Demo
Ensure that the robot is properly suspended in the air from its back to prevent it from falling down!
Now, open two new terminals; place them on the left and right side of the screen respectively. On the left terminal, enter the following:
sudo bash
chmod a+rwx /dev/ttyUSB0
cd op3_ros_ws/
source /opt/ros/noetic/setup.bash
source devel/setup.bash
roslaunch op3_manager op3_manager.launch
Now, the robot should enter its initial pose, with its knees bent and its arms to the side. Now, in the right terminal:
sudo bash
cd op3_ros_ws/
source /opt/ros/noetic/setup.bash
source devel/setup.bash
roslaunch op3_gui_demo op3_demo.launch
Now, a GUI should pop up on-screen. To explore some basic movement commands, click the “action_module” button, then click on the “Motion” tab.
After this, you can make the robot do a few simple, prerecorded motions such as “standing up”, “sitting down”, or gesturing “thank you” by pressing the buttons on screen.
To shut the robot down in case of an emergency, flip the switch on the OpenCR board to “OFF”.
Nevertheless, this short and simple guide should get you from 0 to motion pretty quickly with OP3.
Step 4: Control the Robot Remotely!
Special thanks to Technology Lowdown’s great video on this topic: https://www.youtube.com/watch?v=DcMaNhHkDp4&ab_channel=TechnologyLowdown
Finally, the robot can be controlled remotely, removing the need to have an external keyboard, mouse, and monitor plugged in, making the robot far easier to work with during locomotion experiments. This can be set up by doing the following:
- Turn on Automatic Login in Settings>Users>Authentication & Login>Automatic Login
- Once you click the setting on, a popup window will appear. Make sure to check the “Allow connections to control the screen” and “Require a password” settings. Then type in a password that you won’t forget; this will be your VNC password that you use to log in to the OP3 computer.
- Enable Screen Sharing in Settings>Sharing>Screen Sharing>On
- Install Vino, configure its settings, and then disable VNC encryption using the following commands:
sudo apt-get install vino
sudo apt-get install xserver-xorg-video-dummy
Create the following config file:
sudo nano /etc/X11/10-xorg-dummy.conf
Now paste the following into it to configure which settings will be used for our remote display.
#/etc/X11/10-xorg-dummy.conf
Section "Monitor"
Identifier "Monitor0"
HorizSync 28.0-80.0
VertRefresh 48.0-75.0
# https://arachnoid.com/modelines/
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "1920x1080_60.00"
EndSubSection
EndSection
Finally, use this command to disable VNC encryption, so you can actually connect to OP3’s PC.
gsettings set org.gnome.Vino require-encryption false
After all this is done, restart the robot’s PC and enter the Intel NUC BIOS. The NUC is configured by Default NOT to boot in a “headless” mode. Clearly, we want it to do so, thus we need to:
- Select Advanced>Video>Display Emulation>Virtual Display. This allows the computer to emulate a display when one isn’t connected.
- Select Inconsistent Display Warning>Countdown. This particular setting allows the PC to boot (and not infinitely block) without a connected monitor.
Finally, reboot the PC, while the monitor is still plugged in. If it boots to the desktop, you should be all set!
Now, download RealVNC Viewer on the Windows PC. Input the Robot PC’s IP address (which can be found using the “ifconfig” command). After following the onscreen prompts and inputting the password, you should be able to remotely control the robot’s PC from the Windows machine.
Finally, turn off the Robot’s PC, disconnect all unnecessary cables (monitor, keyboard, mouse, etc) and boot it up once more. Wait one minute, and then attempt to login to the robot using the same IP address. If succesful, you will have full access to the robot’s computer in a very convenient way!
Assuming everything was done correctly thus far, you should be able to run the demo from Step 3 remotely. As such, you are now able to run OP3 in the same way that you’ve seen in the video linked above!