Simulation Platform
In order to support developers to develop, debug and test without actual robot hardware, Daystar Bot SDK provides simulation platform SDK to provide a virtual environment for robot development and testing, avoiding too many experiments on actual hardware, thus improving development efficiency and reducing risks.
1. Overview
1.1. Brief introduction of simulation platform:
Webots is an open source 3D robotics simulation platform designed for robotics research, education and industrial applications. It supports a variety of robot types, including wheeled robots, quadruped robots, robotic arms, drones, etc. It can perform high-precision robot motion simulation with the support of the physics engine, and implements the Daystar Bot simulation SDK based on the Webots platform.
1.2. Functional support:
support the basic operation control of the robot
support to get the status of the robot
2. Installation and Environment Configuration
2.1 System Requirements:
Linux system (recommend):ubuntu20.04
Windows system: win11, with independent graphics card, need to install WSL and run in Linux environment
2.2 Download, installation and environment configuration:
download address: simulation Tool Download
Linux system
install Webots
- decompress and download webots.tar (including webots tool, simulation sdk, robot dog model)
tar -xvzf webots.tar.gz
- for the first time, run the following command in the decompressed webots directory to install the simulation platform and dependent environment
sudo ./saturn_sim_init.sh
Window System
Step 1: install WSL and upgrade to WSL 2
- please refer to the official Microsoft link to install:
https://learn.microsoft.com/zh-cn/windows/wsl/install
- after installation, you need to manually create the. wslconfig file and copy it to the C disk user directory (C:\Users \ <your_username>), restart wsl to take effect after saving.
# Settings apply across all Linux distros running on WSL 2
[wsl2]
networkingMode=mirrored
firewall=true
dnsTunneling=true
autoProxy=true
Step 2: Install Webots
- Decompress the downloaded webots.tar (including webots tools, simulation sdk, robot dog model)
tar-xvzf webots.tar.gz
- For the first time, execute the following command to install the simulation platform and dependent environment in the decompressed webots directory
sudo./saturn_sim_init.sh
2.3 Start the simulation platform:
After the installation is complete, you can use the simulation environment. The instructions for enabling simulation are as follows:
./run_sim.sh
the startup interface is as follows. The resource files required by webots will be downloaded online for the first time. Please keep the network open and wait patiently.
3. Quick Start
3.1 Load Default Robot Model
After the webots resource is successfully downloaded, you can choose to load the robot dog model preset by the Daystar Bot simulation SDK:
- click on the upper left corner of the webots tool File: File --> Open World --> saturn_V2.0_simple_model.wbt
- model path: webots\webots_release\rc_core\webots\worlds\saturn_V2.0_simple_model.wbt
After successful loading, the interface is displayed as follows:
3.2 Basic operation guide
After running the webots to load the model, connect the device where the application developed based on the DaystarBot SDK is located to the emulation platform device **the same network **it can realize the control of the simulation platform robot dog in the LAN environment.
4. Frequently Asked Questions
question 1: run run_sim.sh script to start webots prompt library file not found error
solution: install the missing dependencies (run sudo apt-get install -f), and then run the srun_sim.sh script again to restart webots.
question 2: starting the webots program prompts "error while loading shared libraries: libopencv_core.so.4.2: cannot open shared object file: No such file or directory"
solution: manually install the OpenCV -4.2 compatible package
sudo add-apt-repository universe
sudo apt update
sudo apt install -y libopencv-core4.2
If the sudo apt install -y libopencv-core4.2 fails, execute the following command to Softlink to the 4.2 version:
question 3: starting the webots program prompts "error while loading shared libraries:: cannot open shared object file: No such file or directory"
solution: run ldconfig -p l grep libopencv_imgcodecs to view the path and version of the current libopencv_imgcodecs library, and then run the following command to soft-link to the 4.2 version.
question 4: execute wsl -- install, indicating that the name or address of the server cannot be resolved.
solution: modify the Hosts file and manually add the mapping between domain names and IP addresses to resolve DNS issues.
- query available IP addresses visit IP query website( https://site.ip138.com/raw.Githubusercontent.com/), get raw.githubusercontent.com the currently available IP (such 185.199.110.133 ).
- Modifying the Hosts file
- path:
C:\Windows\System32\drivers\etc\hosts
.
Open the file in Notepad with administrator privileges and add a line at the end:
- 185.199.110.133 raw.githubusercontent.com
- if you are prompted that the permission is insufficient when saving, you need to modify the file permission: Right-click the File → Properties → Security → Add User Everyone and give full control.
- verify DNS resolution execute in the command prompt ping raw.githubusercontent.com , confirm that IP can be successfully parsed.
question 5: if the 3D model cannot be loaded after opening webots, a black screen will be displayed (as shown in the following figure).
solution: you can try to update the video card driver of your computer to a new version and restart webots.