Skip to content

Image Installation and Backup

OriginBot does not have a factory installed system, you can use one of the following two ways to install it:

  1. Burn the OriginBot SD card image【Recommended】

  2. Configured via the native Ubuntu system

If you want to back up the system image in the current state during use, you can refer to the following instructions to back up the image, after backup, you can still apply the above burning method.


Burn the OriginBot SD card image

Download the OriginBot SD card image

Please download the SD card image of the robot from the table below and extract the downloaded file.

Version Release date Download link Software version included

v2.1.0

2024.3.1

originbot_sd_image_v2.1.0
The new version of the system, all application functions and the source code
ros:foxy
TogetheROS:2.1.2

If you need to download the image of the previous version, you can click here to jump to download

Burn the SD card image

(1) Use a card reader to insert the SD card into the computer, the SD card capacity is recommended ≥ 16GB;

(2)Start the image burning software ( please refer to the common software download);

(3)Confirm the SD card device number and select the system image you want to burn;

image-20220902144937771
(4)After clicking "Start", continue to click "Confirm" to start burning the image;

image-20220902145043410
(5)The progress bar will display the current burning progress, and after the burning is completed, you can exit the software.

image-20220902150201248

Start RDK X3

(1)Confirm that the robot kit has been installed correctly;

(2)Use the serial port module in the kit to connect the debugging serial port of the RDK X3 on the robot side, and the connection sequence is as follows: RDKX3_serial_connect.jpg

If you connect to Sunrise X3 pi, the interface is slightly different, and the connection sequence is as follows: image-20220612121707048

(3)Connect the serial port module to the USB port of the PC, start the serial port software, connect the serial port device, set the baud rate of 921600, and turn off the flow control;

8962317cd3d7c9eb268085d233bd9c7

image-20220902151416967

Info

If you can't find the serial port device here, please install the system driver of the serial port module first, and then try again, click here to download the serial port driver, decompress it, and double-click the dpinst64.exe to install it.

(4)Insert the SD card with the burned image and start the robot power;

image-20221021115537957

(5)You can see the log information output during the boot process in the serial port software, wait for a while, and a login prompt will appear:

image-20220902150943452

(6)Enter the username and password, both the username and password are root:

image-20220902151620051

(7)So far, the RDK X3 on the robot side has been successfully started.

Expand SD card space

In order to reduce the size of the system image and facilitate downloading and burning, the free space in the system image has been compressed, and if you need to use the full space of the SD card, you need to manually expand.

After starting RDK X3 and logging in through the serial port, you can use the following command to expand the RDK X3:

#If V1.x is used, run the following command
$ sudo growpart /dev/mmcblk2 1
$ sudo resize2fs /dev/mmcblk2p1

#If V2.x is used, run the following command
$ sudo growpart /dev/mmcblk2 2
$ sudo resize2fs /dev/mmcblk2p2

image-20220902151655008

After the operation is successful, restart the system to take effect, use the following command to confirm that the system space expansion is successful, the SD card used here is 32GB:

image-20220902151756524

Configure network connectivity

wireless network

After completing the Ubuntu installation, start the system and follow the following link to complete the configuration of the wireless network:

$ sudo nmcli device wifi rescan        # Scan wifi networks
$ sudo nmcli device wifi list          # List the Wi-Fi networks found
$ sudo wifi_connect "SSID" "PASSWD"    # Connect to a specified wifi network

image-20220902152042941

Wait until the terminal returns the message "successfully activated", which means that the WIFI connection is successful. We can Ping a website to check the connection. If you can Ping, it means that the network has been successfully connected, and now you can successfully connect to the Internet, which is convenient for subsequent software downloads and updates.

image-20220902152128764

Wired network

The OriginBot system image has been configured with the static IP of wired network: 192.168.1.10

You can directly connect the network port of RDK X3 and the network port of the PC through the network cable, and you can log in remotely through SSH.

image-20220902152416149

SSH telnet

After the network configuration is completed, you can be free from the constraints of the serial port, and you can remotely log in to the robot through the wireless network (or wired network) for development.

image-20220902152651425

Info

In this section, enter the corresponding IP address depending on whether you are using a wired network or a wireless network. You can run the ifconfig command to query the IP address, eth0 corresponds to a wired NIC, and wlan0 corresponds to a wireless NIC.

Enter the username and password: root/root, and you can log in successfully:

image-20220902152716043

Info
  • If you are in the Ubuntu environment on the PC side, you can also use the following command to implement ssh remote login in the terminal (note to change the IP address to the actual address): ssh root@192.168.31.246

  • If you're using a virtual machine, set the network to bridging mode

image-20221017215853209

Native Ubuntu system configuration

Install Ubuntu

Refer to the official manual of RDK X3(Sunrise X3 Pi) to complete the installation of the Ubuntu system, and it is recommended to use the server version.

After completing the Ubuntu installation, start the system and follow the following link to complete the configuration of the wireless network:

$ sudo nmcli device wifi rescan        # Scan wifi networks
$ sudo nmcli device wifi list          # List the Wi-Fi networks found
$ sudo wifi_connect "SSID" "PASSWD"    # Connect to a specified wifi network

After the network connection is successful, run the following command to update the system software to the latest version:

$ sudo apt update
$ sudo apt full-upgrade
$ sudo reboot

Install TogetheROS/ROS2

After restarting the Ubuntu system, run the following command to install TogetheROS, the Horizon Robotics development platform:

$ sudo apt install tros

Configure the ROS2 software source and key:

$ sudo apt update && sudo apt install curl gnupg lsb-release #Update software source
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key  -o /usr/share/keyrings/ros-archive-keyring.gpg #Set the ROS2 software source key
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null #Set the ROS2 software source
Attention

Most domestic developers will encounter the same problem here: the URL cannot be connected. The solution can refer to this post on the official website of Guyueju: "Solving the "Failed to connect to raw.githubusercontent.com" error"

Install the ROS2 core feature pack:

$ sudo apt update #Update software source
$ sudo apt install ros-foxy-ros-base ros-foxy-demo-nodes-cpp  # Install the ROS2 feature pack

It will take a bit longer and will require a little waiting.

2022_7_4 4_41_51

Now ROS2 is installed.

You can use the same command to continue installing more feature packs in ROS2.

Attention

If the ROS installation and download fails, run the following command to complete the pull of the application code of the OriginBot bot, and install the ROS and dependent libraries in order.

$ mkdir -p /userdata/dev_ws/src
$ cd /userdata/dev_ws/src
$ git clone https://gitee.com/guyuehome/originbot.git
$ cd ~/userdata/dev_ws/src/originbot/
$ ./install_prereq_fullimg.sh 

Install feature packs and dependencies

In order to meet the needs of subsequent robot development, a series of function packages and dependency libraries need to be installed:

$ sudo apt install python3-colcon-common-extensions     # The ROS2 compiler
$ sudo apt install git                                  # Install git tool
$ sudo apt install ros-foxy-slam-toolbox                # Install slam-toolbox
$ sudo apt install ros-foxy-cartographer-ros            # Install cartographer
$ sudo apt install ros-foxy-teleop-twist-keyboard       # Install a keyboard controller node
$ sudo apt install ros-foxy-robot-localization          # Install the positioning package
$ sudo apt install cloud-utils                          # Disk installation tool
$ sudo apt install ros-foxy-rmw-cyclonedds-cpp          # Install Cyclone DDS
$ sudo apt install ros-foxy-teleop-twist-joy            # Install the drive pack for the handle
$ sudo apt install ros-foxy-joy-linux                   # Install the drive pack for the handle
$ sudo apt install ros-foxy-cv-bridge                   # Install the image processing package
$ sudo apt install ros-foxy-xacro                       # Install the model parsing package
$ sudo apt install ros-foxy-robot-state-publisher       # Install the robot status Publisher package
$ sudo apt install ros-foxy-joint-state-publisher       # Install the joint status publisher package
$ sudo apt install ros-foxy-joint-state-publisher-gui   # Install the joint status publisher package
$ sudo apt install ros-foxy-image-transport             # Install the image compression package
$ sudo apt install ros-foxy-image-transport-plugins     # Install the image compression package
$ pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple  #Installs the specified opencv version
$ sudo apt-get install libboost-python1.71.0            #Install Boost dependencies

Install the sensor drive

If you are using OriginBot with LiDAR, you need to refer to the following instructions to complete the installation of the lidar SDK driver package:

# Installation tool library
$ sudo apt install cmake pkg-config
$ sudo apt-get install python swig
$ sudo apt-get install python-pip

# Build the ydlidar SDK
$ cd /userdata
$ git clone https://github.com/YDLIDAR/YDLidar-SDK.git
$ cd YDLidar-SDK
$ mkdir build
$ cd build
$ cmake ..
$ make -j2
$ sudo make install

# Install the SDK for python
$ cd ..
$ pip install .

Compile the application code

In the userdata (or root) folder, create a dev_ws/src workspace

$ mkdir -p /userdata/dev_ws/src

Next, go to this path and download the application code of the OriginBot bot:

$ cd /userdata/dev_ws/src
$ git clone https://gitee.com/guyuehome/originbot.git

Go back to the workspace path and start compiling the code:

$ cd /userdata/dev_ws
$ source /opt/tros/setup.bash
$ colcon build

Configure the lidar port number

In the function package of the lidar, a script for binding serial port numbers is provided, which can be executed according to the following instructions:

$ chmod 0777 /userdata/dev_ws/src/originbot/originbot_driver/ydlidar_ros2_driver/startup/*
$ sudo sh /userdata/dev_ws/src/originbot/originbot_driver/ydlidar_ros2_driver/startup/initenv.sh

Set environment variables

Add environment variables to bashrc:

$ vi /root/.bashrc

# Add the following at the end of the file:
source /opt/tros/setup.bash
source /userdata/dev_ws/install/local_setup.bash
Attention

The bashrc script configured here is related to the logged-in user, if you use the "sunrise" user to log in, you should modify the .bashrc file in /home/sunrise.

Back up the OriginBot SD card image

The following backup process is done on the Ubuntu system on the computer.

Compress disk space

In order to reduce the image size, we first use gparted software to compress the disk space of the SD card. Insert the SD card into the running computer, install and launch the gparted software:

$ sudo apt-get install gparted
$ sudo gparted

In the open gparted software, select the SD card in the upper right corner: img

Then right-click and select Mount Unmount SD Card: img

Go ahead and right-click, select the "Resize/Moves" option to reset the space on your SD card: img

Drag the right side of the space partition bar, compress the space, where yellow is the occupied partition, white is the free partition, pay attention to keep a little white free partition to avoid the image cannot be started. img

After confirmation, click the execute button in the software to start the compression operation. img

Once the compression is complete, you can close the gparted software.

View disk information

Open the terminal and run the fdisk command to view the current disk status.

$ sudo fdisk -u -l
img

In the figure, /dev/sdb is the disk number of the SD card, run the following command to view the partition information of the SD card:

$ sudo fdisk -u -l /dev/sdb
img

Start the backup-to-disk

Now you can use the dd command to back up your SD card to an img file.

$ sudo dd bs=512 count=[fdisk命令中最大的end数+1] if=/dev/sdb of=originbot_backup.img
img

At this time, there is no message in the terminal, but the backup has started and it will take a long time, so please wait patiently.

After the backup is completed, the terminal command will automatically pop up, and the img image backup file will be obtained in the current path. img

The generated IMG image file is large, and if necessary, you can continue to use zip and other tools for compression and decompression.

At this point, the SD card image has been backed up, and when you need to use it, you can refer to Burn the OriginBot SD card image.

图片1