Before assembling Before installing the robot, you need to install the software (refer to second half of the document) to control the robot on the Raspberry Pi. Because the servo needs to be returned to the original position during the robot assembly process, which requires the assistance of a Raspberry Pi with software that runs normally. How to make a servo return to original position Connect the servo to the Raspberry Pi that is turned on.
Software Installation You can Find general video tutorials for the software installation section in: https://www.adeept.com/video/detail-30.html Raspberry Pi system installation & setup Download image file of Raspberry Pi system (Raspbian) First we need to log in to the Raspberry Pi official website to download the image file of the Raspberry Pi system Raspberry Pi official website: https://www.raspberrypi.
Burn the Raspberry Pi system (Raspbian) into SD card First, insert the SD card into the card reader, then connect the card reader to the computer, run Win32 Disk Imager, select the drive letter of the SD card in the Device on the right. Do not choose the wrong, because the next operation will burn the Raspberry Pi system in the selected drive letter, and delete all the files in that drive letter.
Enable the SSH service of Raspberry Pi and set WIFI for Raspberry Pi The way we use does not need to set up the Raspberry Pi with peripherals such as display and keyboard. While waiting for the Raspberry Pi system to write to the SD card, you can proceed to prepare two files and copy the two files to the SD card to be burned with the Raspberry Pi system. And then insert the SD card into the Raspberry Pi to boot. The Raspberry Pi will automatically start the SSH service and connect to WIFI.
Where country = US is area setting , you can leave it unchanged; Change WIFI of ssid = "WIFI" to the name of your own WIFI (the name of the WIFI that the Raspberry Pi needs to connect automatically when booting); Change PASSWORD of psk=“PASSWORD”to WIFI password; key_mgmt is the encryption method. You can check the settings in the router. In most cases, leave it by default. Save. Change the extension of the wpa_supplicant.txt file to .
Choose the free version. Download portable edition, so that to directly unzip and use after downloading. Install robot programs in Raspberry Pi Insert the SD card that was previously burned into the Raspberry Pi system and copied with the ssh and wpa_supplicant.conf files into the Raspberry Pi, and then power the Raspberry Pi.
driver board (Robot HAT), you can power the Raspberry Pi driver board and the Raspberry Pi through the micro USB interface on the driver board, or power the Raspberry Pi through connecting the power interface on the driver board to the battery holder with lithium batteries. We recommend to power with micro USB, since the installation process may take a long time. You can also directly power the Raspberry Pi without installing a driver board. Turn on the Raspberry Pi.
When entering the password, the password or * will not displayed on the screen, but it does not mean that the password was not entered successfully. After entering, press Enter to log in to the Raspberry Pi. This session is saved in the left column (Fig. ② below). The next time you connect the Raspberry Pi, just double-click here to connect the Raspberry Pi again. (Note: If the IP address of Raspberry Pi changes, you need to start a new session from scratch.
That's it, the connection to the Raspberry Pi is complete. Download the robot program Setting up the robot program step by step and installing it will take a lot of time and effort. In the software package, we provide an installation package to install and automatically perform related settings. First, download the product project (software package) in the Raspberry Pi terminal. Enter the following command (Note that all lowercase input must be used): sudo git clone https://github.
command to clear them : sudo killall python3 An error message may appear during the installation process, but don't worry. It is normal for an error to occur during the installation process. Whether the installation is successful depends on the successful operation of server.py. Wait patiently for the installer to run. When the line restart appears, the installer has completed execution. If the connection to the Raspberry Pi is disconnected before the restart occurs, please run setup.
Click Downloads->Download Python 3.7.0. After downloading Python, double-click the installation package to install it. When installing Python, be sure to select Add python to PATH, as shown in the following figure: Install Numpy NumPy is a basic software package for scientific computing with Python. OpenCV needs its related functions. Press + R and enter cmd, click "OK" to open CMD.
After clicking "OK", the CMD interface will pop up, as shown below: Enter: pip3 install numpy Then press Enter to start downloading and installing Numpy. Download opencv_python.whl and install OpenCV Download address: https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv After getting to this page, you may need to manually enter "#opencv" after the URL to redirect to the location where opencv is located.
Choose the version to download here. 4.2.0 is the latest version of opencv when this document was made; cp37 corresponds to python3.7 installed on the computer; amd64 corresponds to 64-bit python. Depending on the version of python you download, you may need to choose a different version of opencv. The way to check the python version and digits is to enter the command in cmd: python, and then enter the python shell.
The Users directory of each computer may not be the same. You can find the location of your Users directory in the command line window that opened by pressing + R and typing cmd. Install OpenCV Enter the following command in cmd: pip3 install opencv_python Then press TAB, the computer will automatically complete the remaining file names, as shown below: Then press Enter to install openCV. Intsall zmq and pybase64 zmq and pybase64 are libraries for real-time video.
automatically every time you turn it on), enter the IP address of the Raspberry Pi in the GUI control terminal on the PC, and then click Connect to control the robot. The specific control method of the GUI can be found on the latter part of the manual. MobaXterm file transfer tutorial When there are some problems with the software installation, or when you want to modify or customize the robot control script, you will need to modify the files in the Raspberry Pi.
open the file. File modifying and saving The editing method after opening the file is the same as usual (it uses the editor that comes with MobaXterm by default). The only thing to note is that when you save the file, MobaXterm will prompt you if you want to synchronize the files in the Raspberry Pi.
GUI tutorial The GUI is a graphical interface that runs on the PC for robot control. It is contained in the client directory of the package, and is usually called GUI.py. If you installed python according to the manual, just double-click GUI.py to open it. Depending on the product, the GUI is also composed of different modules and windows. Below is a list of most of the GUI modules and windows. You can compare the modules and windows of your GUI to understand their functions and usage.
The picture captured by the camera will be displayed. Depending on the product type, the window rendering method may be different, and some products can also interact with this window. IP address input box Enter the IP address of Raspberry Pi here and click Connect to connect the GUI to the Raspberry Pi.
displayed. Movement control Back and forth, left and right movement control. Other GUI modules Most GUI modules and windows will only appear on products with certain features. Color space video streaming window The picture captured by the camera is converted to the HSV color space mode. The difference between colors in this mode is shown in red and green, which makes it easy to observe the performance under the color tracking function.
Potentiometer port switch Control the on and off of port1, port2 and port 3 on the development board. If you turn on an interface, the Raspberry Pi will provide 3.7V power for this interface. Note: In order to avoid damaging the development board or the Raspberry Pi, do not connect overloaded components to these three interfaces. Speed control slider Controls the speed at which the robot car moves. If the value is set too small, the robot car will not be moved or difficult to move.
StandUp and StayLow: Control the spider robot to stand and lie down. Lean-L and Lean-R: roll left and right Left and Right: Tilt left and right Up and Down: control the standing height Ultrasonic radar 扫描后: After scanning: Before scanning: Showing the results of an ultrasound scan. Color setting module Used to set the color to look for in color tracking and the line color to be tracked in video tracking mode. Clicking on Color Set will change the color of color checking.
Used to correct the deviation angle of the servo. Drag the slider to fine-tune the servo angle, and click Save as Default to save the current servo position as the default position. Function button group A considerable part of the functions of the robot are controlled by a single button. For the aesthetic of the GUI, these function buttons are grouped together to form a function button group. Depending on the models of the robots, the function buttons on their corresponding GUI are also different.
Camera After enabling, the robot will stabilizing automatically adjust the attitude of the camera to keep it in the horizontal position when turned on. Gait switching Specific function for quadruped spider robots. After enabling, it is switched to diagonal gait (the default is triangle gait). Self-stabilizing Specific function for spider robots. After mode enabling, the robot will keep horizontal by adjusting the legs.
Exposure adjustment module Used to adjust the exposure of the camera. It is mainly used in conjunction with the visual line tracking mode. You can adjust the exposure value to make the robot better recognize the line to be tracked. You can turn on video rendering to see the effect of setting exposure values on robot tracking.
Common issues Q: Setup.py disconnects during runtime? A: setup.py will restart automatically after execution. Check to if there is a line restart on the console. If so, the installation program has been executed. Q: Errors prompt up when running setup.py? A: An error may occur during the installation process, which is not necessarily a problem during the installation process. There is also a server.py file in the package.
do not move the ssh or wpa_supplicant.conf files to the SD card. This will prevent the Raspberry Pi connecting to wifi. Q: without permission to modify or delete files? A: Use the command 'sudo chmod 777 [file name]' to open the permissions of the files. Note that this command needs to be executed using an administrator account. In general, the default account pi is an administrator account Q: I want to check the error message of server.