SunFounder PiCrawler Kit Manual

Hide thumbs Also See for PiCrawler Kit:

Advertisement

Quick Links

SunFounder PiCrawler Kit
www.sunfounder.com
May 31, 2024

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PiCrawler Kit and is the answer not in the manual?

Questions and answers

Summary of Contents for SunFounder PiCrawler Kit

  • Page 1 SunFounder PiCrawler Kit www.sunfounder.com May 31, 2024...
  • Page 3: Table Of Contents

    CONTENTS 1 Component List and Assembly Instructions 2 Servo Zeroing for Assembly 3 Play with Python Quick Guide on Python ......... Calibrate the PiCrawler .
  • Page 4 Install OpenSSH via Powershell ........133 6 Copyright Notice...
  • Page 5 PiCrawler work the way you want. Ezblock Studio is a development platform developed by SunFounder for beginners, aiming to lower the barriers to entry for Raspberry Pi. It has two programming languages: Graphical and Python, which can be used on almost all different...
  • Page 6 Content Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 7: Component List And Assembly Instructions

    • You can find a comprehensive tutorial about the here, including information on its hardware and API. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 8 SunFounder PiCrawler Kit Chapter 1. Component List and Assembly Instructions...
  • Page 9: Servo Zeroing For Assembly

    Quick Guide for details. on EzBlock Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 10 SunFounder PiCrawler Kit Chapter 2. Servo Zeroing for Assembly...
  • Page 11: Play With Python

    Raspberry Pi, please configure the Raspberry Pi first according to Quick Guide on Python. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? •...
  • Page 12 SunFounder PiCrawler Kit 3.1.1 1. What Do We Need? Required Components Raspberry Pi The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python.
  • Page 13 The Raspberry Pi is equipped with an audio port about 3.5 mm that can be used when your screen has no built-in speakers or when there is no screen operation. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 14 SunFounder PiCrawler Kit 3. Launch the Raspberry Pi Imager application by clicking its icon or typing rpi-imager in your terminal. 2. Install OS to Micro SD Card 1. Insert your SD card into your computer or laptop using a Reader.
  • Page 15 SunFounder PiCrawler Kit 3. Select Operating System and opt for the recommended operating system version. 4. Click Choose Storage and select the appropriate storage device for the installation. Note: Ensure you select the correct storage device. To avoid confusion, disconnect any additional...
  • Page 16 SunFounder PiCrawler Kit storage devices if multiple ones are connected. 5. Click NEXT and then EDIT SETTINGS to tailor your OS settings. Note: If you have a monitor for your Raspberry Pi, you can skip the next steps and click ‘Yes’ to begin the installation.
  • Page 17 SunFounder PiCrawler Kit 6. Define a hostname for your Raspberry Pi. The hostname is your Raspberry Pi’s network identifier. You can access your Pi using Note: <hostname>.local or <hostname>.lan. 7. Create a Username and Password for the Raspberry Pi’s administrator account.
  • Page 18 SunFounder PiCrawler Kit 8. Configure the wireless LAN by providing your network’s SSID and Password. Note: Set the Wireless LAN country to the two-letter ISO/IEC alpha2 code corresponding to your location. 9. To remotely connect to your Raspberry Pi, enable SSH in the Services tab.
  • Page 19 SunFounder PiCrawler Kit 10. The Options menu lets you configure Imager’s behavior during a write, including playing sound when finished, ejecting media when finished, and enabling telemetry. 3.1. Quick Guide on Python...
  • Page 20 SunFounder PiCrawler Kit 11. When you’ve finished entering OS customisation settings, click Save to save your customisation. Then, click Yes to apply them when writing the image. 12. If the SD card contains existing data, ensure you back it up to prevent data loss. Proceed by clicking Yes if no backup is needed.
  • Page 21 SunFounder PiCrawler Kit 13. When you see the “Write Successful” popup, your image has been completely written and verified. You’re now ready to boot a Raspberry Pi from the Micro SD Card! 14. Now you can insert the SD card set up with Raspberry Pi OS into the microSD card slot located on the underside of the Raspberry Pi.
  • Page 22 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 23 SunFounder PiCrawler Kit 3.1.3 3. Power Supply for Raspberry Pi (Important) Charge Insert the battery cable. Next, insert the USB-C cable to charge the battery. You will need to provide your own charger; we recommend a 5V 3A charger, or your commonly used smartphone charger will suffice.
  • Page 24 SunFounder PiCrawler Kit Power ON Turn on the power switch. The Power indicator light and the battery level indicator light will illuminate. Wait for a few seconds, and you will hear a slight beep, indicating that the Raspberry Pi has successfully booted.
  • Page 25 • GND: Negative battery terminal. This is a custom battery pack made by SunFounder consisting of two 18650 batteries with a capacity of 2000mAh. The connector is XH2.54 5P, which can be charged directly after being inserted into the shield.
  • Page 26 SunFounder PiCrawler Kit • Connector:XH2.54 5P Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 27 Raspberry Pi using a GUI. See below for detailed tutorials for each system. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 28 Last login: Thu Sep 22 12:18:22 2022 pi@raspberrypi:~ $ Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join?
  • Page 29 SunFounder PiCrawler Kit • Expert Support: Solve post-sale issues and technical challenges with help from our community and team. • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks.
  • Page 30 6. Once connected, your Raspberry Pi is ready for remote operations. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 31 6. Once you’ve successfully logged in, your Raspberry Pi is now connected, and you’re ready to proceed to the next step. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 32 SunFounder PiCrawler Kit Ready to explore and create with us? Click [] and join today! Remote Desktop Access for Raspberry Pi For those preferring a graphical user interface (GUI) over command-line access, the Raspberry Pi supports remote desktop functionality. This guide will walk you through setting up and using VNC (Virtual Network Computing) for remote access.
  • Page 33 SunFounder PiCrawler Kit Logging in via VNC Viewer 1. Download and install VNC Viewer on your personal computer. 2. Once installed, launch VNC Viewer. Enter the hostname or IP address of your Raspberry Pi and press Enter. 3. When prompted, enter your Raspberry Pi’s username and password, then click OK.
  • Page 34 4. After a few seconds, the Raspberry Pi OS desktop will be displayed. Now you can open the Terminal to start entering commands. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 35 -b v2.0 https://github.com/sunfounder/robot-hat.git cd robot-hat sudo python3 setup.py install Then download the code and install vilib module. git clone -b picamera2 https://github.com/sunfounder/vilib.git cd vilib sudo python3 install.py Then download the code and install picrawler module. git clone -b v2.0 https://github.com/sunfounder/picrawler.git...
  • Page 36 SunFounder PiCrawler Kit Type y and press Enter to continue running the script. Type y and press Enter to run /dev/zero in the background. Chapter 3. Play with Python...
  • Page 37 Note: If there is no sound after restarting, you may need to run the i2samp.sh script multiple times. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 38 SunFounder PiCrawler Kit 3.1.6 6. Check I2C Interface We will be using the Raspberry Pi’s I2C interface. This interface should have been enabled when installing the robot-hat module earlier. To ensure everything is in order, let’s check if it is indeed enabled.
  • Page 39 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 40 SunFounder PiCrawler Kit 2. Now, run servo_zeroing.py in the examples/ folder. cd ~/picrawler/examples sudo python3 servo_zeroing.py 3. Next, plug the servo cable into the P11 port as follows, at the same time you will see the servo arm rotate to a position(This is the 0°...
  • Page 41: Calibrate The Picrawler

    • Before assembling each servo, you need to plug the servo cable into PWM pin and turn on the power to set its angle to 0°. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 42 SunFounder PiCrawler Kit cd ~/picrawler/examples/calibration sudo python3 calibration.py After running the above code, you will see the following interface displayed in the terminal. 3. Press 2 and 3 keys respectively to choose left 2 legsthen press w, a, s, d, r, and f keys to move them to the calibration point.
  • Page 43 After the assembly is complete, you can try to run the projects below. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 44: Move

    SunFounder PiCrawler Kit Ready to explore and create with us? Click [] and join today! 3.3 Move This is PiCrawler’s first project. Perform its most basic function - move. Run the Code cd ~/picrawler/examples sudo python3 move.py After the code is executed, PiCrawler will perform the following actions in sequence: move forward, move backward, turn left, turn right, stand.
  • Page 45 SunFounder PiCrawler Kit (continued from previous page) main(): speed while True: crawler.do_action( forward ,2,speed) sleep(0.05) crawler.do_action( backward ,2,speed) sleep(0.05) crawler.do_action( turn left ,2,speed) sleep(0.05) crawler.do_action( turn right ,2,speed) sleep(0.05) crawler.do_action( turn left angle ,2,speed) sleep(0.05) crawler.do_action( turn right angle ,2,speed) sleep(0.05)
  • Page 46: Keyboard Control

    SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 47 SunFounder PiCrawler Kit (continued from previous page) show_info(): print("\033[H\033[J",end= # clear terminal windows print(manual) main(): show_info() while True: readchar.readkey() key.lower() key in( wsad key: crawler.do_action( forward ,1,speed) elif key: crawler.do_action( backward ,1,speed) elif key: crawler.do_action( turn left ,1,speed) elif key: crawler.do_action(...
  • Page 48: Sound Effect

    Quit") break sleep(0.02) Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 49 SunFounder PiCrawler Kit Install i2samp Before using that functions, first activate the speaker so that it will be enabled and can make sounds. Run i2samp.sh in, and this script will install everything needed to use i2s amplifier. ~/picrawler/ sudo bash i2samp.sh There will be several prompts asking to confirm the request.
  • Page 50 SunFounder PiCrawler Kit Code Sorry, currently there is only sound when running with sudo from time import sleep from robot_hat import Music,TTS music Music() TTS() manual Input key to call the function! q: Play background music 1: Play sound effect...
  • Page 51 SunFounder PiCrawler Kit (continued from previous page) music.sound_play_threading( ./sounds/sign.wav sleep(0.5) elif "t": words "Hello" tts.say(words) __name__ "__main__": main() How it works? Functions related to background music include these: • music = Music() : Declare the object. • music.music_set_volume(20) : Set the volume, the range is 0~100.
  • Page 52: Obstacle Avoidance

    SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 53 SunFounder PiCrawler Kit cd ~/picrawler/examples sudo python3 avoid.py After the code runs, PiCrawler will walk forward. If it detects that the distance of the obstacle ahead is less than 10cm, it will stop and sound a warning, then turn left and stop. If there is no obstacle in the direction after turning left or the obstacle distance is greater than 10, it will continue to move forward.
  • Page 54 Note: You can add different sound effects or music to musics or sounds folder via Filezilla Software. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? •...
  • Page 55: Computer Vision

    SunFounder PiCrawler Kit 3.7 Computer Vision This project will officially enter the field of computer vision! Run the Code cd ~/picrawler/examples sudo python3 display.py View the Image After the code runs, the terminal will display the following prompt: No desktop ! * Serving Flask app "vilib.vilib"...
  • Page 56 SunFounder PiCrawler Kit these photos from the ~/Pictures/PiCrawler/ directory of the Raspberry Pi. You can use tools such as to transfer photos to your PC. Filezilla Software • Color Detect Entering a number between 1~6 will detect one of the colors in “red, orange, yellow, green, blue, purple”.
  • Page 57 SunFounder PiCrawler Kit • QR Code Detect Enter r to open the QR code recognition. No other operations can be performed before the QR code is recognized. The decoding information of the QR code will be printed in the terminal.
  • Page 58 SunFounder PiCrawler Kit Entering s will print the information of the face detection (and color detection) target in the terminal. Including the center coordinates (X, Y) and size (Weight, height) of the measured object. Code from vilib import Vilib from...
  • Page 59 SunFounder PiCrawler Kit (continued from previous page) take_photo(): _time strftime( %Y-%m-%d-%H-%M-%S ,localtime(time())) name photo_%s %_time path "/home/pi/Pictures/PiCrawler/" Vilib.take_photo(name, path) print( photo save as %s%s.jpg %(path,name)) object_show(): global flag_color, flag_face True: flag_color Vilib.detect_obj_parameter[ color_n print( Color Detect: None else: color_coodinate (Vilib.detect_obj_parameter[ color_x ],Vilib.detect_obj_...
  • Page 60 SunFounder PiCrawler Kit (continued from previous page) index False flag_color Vilib.color_detect( close else: True flag_color Vilib.color_detect(color_list[index]) # color_detect(color:str -> color_ name/close) print( Color detect : %color_list[index]) # face detection elif key =="f": flag_face flag_face face_detect(flag_face) # qrcode detection elif key =="r":...
  • Page 61 • qr_h: the height of the QR code to be detected, the range is 0~320 Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 62: Record Video

    SunFounder PiCrawler Kit • Exclusive Previews: Get early access to new product announcements and sneak peeks. • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 3.8 Record Video...
  • Page 63 SunFounder PiCrawler Kit (continued from previous page) Vilib.rec_video_set["path"] f"/home/{username}/Videos/" # set path Vilib.camera_start(vflip=False,hflip=False) Vilib.display(local=True,web=True) sleep(0.8) # wait for startup print(manual) while True: # read keyboard readchar.readkey() key.lower() # start,pause None rec_flag stop rec_flag start # set name vname strftime("%Y-%m-%d-%H.%M.%S", localtime()) Vilib.rec_video_set["name"]...
  • Page 64: Bull Fight

    • Vilib.rec_video_stop(): Stop recording. Vilib.rec_video_set["path"] = "~/video/test/" sets the storage location of video files. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 65 SunFounder PiCrawler Kit Run the Code cd ~/picrawler/examples sudo python3 bull_fight.py View the Image After the code runs, the terminal will display the following prompt: No desktop ! * Serving Flask app "vilib.vilib" (lazy loading) * Environment: production WARNING: Do not use the development server in a production environment.
  • Page 66 SunFounder PiCrawler Kit Code Note: You can Modify/Reset/Copy/Run/Stop the code below. But before that, you need to go to source code path like picrawler\examples. After modifying the code, you can run it directly to see the effect. from picrawler import...
  • Page 67 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 68: Treasure Hunt

    SunFounder PiCrawler Kit 3.10 Treasure Hunt Arrange a maze in your room and place six different color cards in six corners. Then control PiCrawler to search for these color cards one by one! Note: You can download and print the PDF Color Cards for color detection.
  • Page 69 SunFounder PiCrawler Kit (continued from previous page) d: Turn right space: Say the target again Ctrl^C: Quit color "red" color_list=["red","orange","yellow","green","blue","purple"] key_dict forward backward turn_left turn_right renew_color_detect(): global color color random.choice(color_list) Vilib.color_detect(color) tts.say("Look for " color) None lock threading.Lock() key_scan_thread(): global...
  • Page 70 SunFounder PiCrawler Kit (continued from previous page) while True: Vilib.detect_obj_parameter[ color_n ]!=0 Vilib.detect_obj_ parameter[ color_w ]>100: tts.say("will done") sleep(0.05) renew_color_detect() with lock: None and wsad action key_dict[str(key)] None elif space tts.say("Look for " color) None elif quit _key_t.join() Vilib.camera_close() print("\n\rQuit")
  • Page 71 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 72: Pose

    SunFounder PiCrawler Kit Ready to explore and create with us? Click [] and join today! 3.11 Pose PiCrawler can assume a specific posture by writing a coordinate array. Here it assumes a raised right rear foot posture. Run the Code cd ~/picrawler/examples sudo python3 do_step.py...
  • Page 73 SunFounder PiCrawler Kit (continued from previous page) print(f"stand step: {stand_step}") crawler.do_step(stand_step, speed) sleep(3) print(f"new step: {new_step}") crawler.do_step(new_step,speed) sleep(3) __name__ "__main__": main() How it works? In this code, the code you need to pay attention to is this crawler.do_step(). Similar to do_action(), do_step() can also manipulate PiCrawler’s behavior. The difference is that the former can perform the continuous behavior of move forward, while the latter can be used to make separate gestures of stand and sit.
  • Page 74 SunFounder PiCrawler Kit You need to measure the coordinates of each toe individually. As shown below: Chapter 3. Play with Python...
  • Page 75 [45, 45, -30], [45, 45, -30], [45, 45, -30] Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 76: Adjust Posture

    SunFounder PiCrawler Kit • Learn & Share: Exchange tips and tutorials to enhance your skills. • Exclusive Previews: Get early access to new product announcements and sneak peeks. • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.
  • Page 77 SunFounder PiCrawler Kit • Press Ctrl+C to exit. Code from picrawler import Picrawler from time import sleep import readchar crawler Picrawler() speed manual -------- PiCrawler Controller --------- ....<=| |--| |=> ....<=| | ------| |=> 1: Select right front leg...
  • Page 78 • current_step_all_leg_value(): Returns the coordinate values of all legs. • do_single_leg(leg,coordinate[leg],speed): Modify the coordinate value of a certain leg individually. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 79: Record New Step

    SunFounder PiCrawler Kit 3.13 Record New Step We use the keyboard to control PiCrawler to make several poses in turn, and record these poses. Replay them later. Run the Code cd ~/picrawler/examples sudo python3 record_new_step_by_keyboard.py After the code runs, please operate according to the prompt that pops up in the terminal.
  • Page 80 SunFounder PiCrawler Kit (continued from previous page) space: Print all leg coodinate & Save this step p: Play all saved step esc: Quit new_step=[] save_new_step(): new_step.append(copy.deepcopy(crawler.current_step_all_leg_value())) print(new_step) play_all_new_step(): step new_step: crawler.do_step(step,speed) sleep(0.6) main(): speed print(manual) crawler.do_step( ,speed) coodinate=crawler.current_step_leg_value(leg) while True: readchar() key.lower()
  • Page 81 Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 82: Twist

    SunFounder PiCrawler Kit Ready to explore and create with us? Click [] and join today! 3.14 Twist We already know how to make PiCrawler assume a specific pose, the next step is to combine the poses to form a continuous action.
  • Page 83 Note: You can add different sound effects or music to musics or sounds folder via Filezilla Software. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? •...
  • Page 84: Emotional Robot

    SunFounder PiCrawler Kit • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 3.15 Emotional Robot This example shows several interesting custom actions of PiCrawler. Run the Code cd ~/picrawler/examples sudo python3 emotional_robot.py...
  • Page 85 __name__ "__main__": main() Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 86 SunFounder PiCrawler Kit Chapter 3. Play with Python...
  • Page 87: Play With Ezblock

    Note: If you are using a Raspberry Pi 5, you will not be able to use our graphical programming software, EzBlock, to program the PiCrawler. For beginners and novices, EzBlock is a software development platform offered by SunFounder for Raspberry Pi. Ezbock offers two programming environments: a graphical environment and a Python environment.
  • Page 88 SunFounder PiCrawler Kit 1. Firstly, Install EzBlock OS (EzBlock’s own tutorials) onto a Micro SD card, once the installation is complete, insert it into the Raspberry Pi. Note: After the installation is complete, please return to this page. 2. To ensure that the servo has been properly set to 0°, first insert the servo arm into the servo shaft and then gently rotate the rocker arm to a different angle.
  • Page 89 SunFounder PiCrawler Kit 4. Next, plug the servo cable into the P11 port as follows. 5. Press and hold the USR key, then press the RST key to execute the servo zeroing script within the system. When you see the servo arm rotate to a position(This is the 0° position, which is a random location and may not be vertical or parallel.), it indicates that the program has run.
  • Page 90 SunFounder PiCrawler Kit Note: This step only needs to be done once; afterward, simply insert other servo wires, and they will automatically zero. 6. Now, remove the servo arm, ensuring the servo wire remains connected, and do not turn off the power. Then continue the assembly following the paper assembly instructions.
  • Page 91: Install And Configure Ezblock Studio

    But if you think the assembly is perfect and no calibration is needed, you can also skip this step. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 92 SunFounder PiCrawler Kit Click the Settings button. On this page, you can change the product name, product type, view the app version or calibrate the robot. Once you click on Calibrate you can go to the calibration page. Chapter 4. Play with Ezblock...
  • Page 93 SunFounder PiCrawler Kit The calibration steps are as follows: 1. Take out the assembly leaflet, turn it to the last page, and lay it flat on the table. Then place the PiCrawler as shown below, aligning its bottom with the outline on the calibration chart.
  • Page 94 SunFounder PiCrawler Kit 3. Align the other foot on the left in the same way. 4. After calibrating the left two feet, change the calibration paper to the right, and calibrate the right two feet according to the above method.
  • Page 95 If you don’t want to write these projects one by one, we have uploaded them to Ezblock Studio’s Examples page and you can run them directly or edit them and run them later. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 96: Move

    SunFounder PiCrawler Kit 4.4 Move This is PiCrawler’s first project. Perform its most basic function - move. Program Note: • You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?.
  • Page 97 SunFounder PiCrawler Kit Click the Upload & Run button at the bottom right of the screen, and PiCrawler will execute “forward” and “backward” actions in sequence. How it works? First, you need to understand the program framework of Ezblock. as follows:...
  • Page 98 Such as “stand”, “sit”. Both blocks can be dragged from the PiCrawler category on the left. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 99: Remote Control

    SunFounder PiCrawler Kit • Special Discounts: Enjoy exclusive discounts on our newest products. • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 4.5 Remote Control In this project, we will learn how to remote control the PiCrawler.
  • Page 100 SunFounder PiCrawler Kit Switch to the Remote Control interface, and you will see the following widgets. Chapter 4. Play with Ezblock...
  • Page 101 SunFounder PiCrawler Kit After the program is running, you can activate PiCrawler through D-Pad. How it works? After dragging out the widget on the Remote Control interface, a category named Remote will appear in the block categories column of the programming interface.
  • Page 102 = block, = block can be modified to >, < and other conditions through the drop-down menu, please use it flexibly. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 103: Sound Effect

    SunFounder PiCrawler Kit • Festive Promotions and Giveaways: Take part in giveaways and holiday promotions. Ready to explore and create with us? Click [] and join today! 4.6 Sound Effect In this example, we use PiCrawler’s (to be precise, Robot HAT’s) sound effects. It consists of three parts, namely Muisc, Sound, Text to Speech.
  • Page 104 SunFounder PiCrawler Kit Switch to the Remote Control interface, and you will see the following widgets. Chapter 4. Play with Ezblock...
  • Page 105 SunFounder PiCrawler Kit After the program is running, you can press different buttons to make PiCrawler sound. How it works? Functions related to background music include these: Functions related to sound effects include these: Functions related to Text to Speech include these:...
  • Page 106: Obstacle Avoidance

    SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 107 SunFounder PiCrawler Kit Program Note: • You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?. • Or find the code with the same name on the Examples page of the EzBlock Studio and click Run or Edit directly.
  • Page 108 SunFounder PiCrawler Kit How it works? You can find the following blocks in the Module category to achieve distance detection: Chapter 4. Play with Ezblock...
  • Page 109: Computer Vision

    PiCrawler does turn left . • When the distance is greater than alert_distance, PiCrawler will move forward. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 110 SunFounder PiCrawler Kit Switch to the Remote Control interface, and you will see the following widgets. Chapter 4. Play with Ezblock...
  • Page 111 SunFounder PiCrawler Kit After the program is running, you can switch the slider widget to turn on/off the face detection; click the D-Pad to select the color of the detection; click the button to print the detection result. How it works? This block is used to enable the camera module.
  • Page 112: Bull Fight

    These two blocks are used to output information. The detection result has five output values, namely coordinate x value, coordinate y value, width, height, and number. Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 113 SunFounder PiCrawler Kit Note: You can download and print the PDF Color Cards for color detection. Program Note: • You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?.
  • Page 114 SunFounder PiCrawler Kit Switch to the Remote Control interface, you will see the following screen. Chapter 4. Play with Ezblock...
  • Page 115 SunFounder PiCrawler Kit How it works? In general, this project combines the knowledge points of Move, Computer Vision Sound Effect. Its flow is shown in the figure below: 4.9. Bull Fight...
  • Page 116 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 117: Treasure Hunt

    SunFounder PiCrawler Kit 4.10 Treasure Hunt Arrange a maze in your room and place six different color cards in six corners. Then control PiCrawler to search for these color cards one by one! Note: You can download and print the PDF Color Cards for color detection.
  • Page 118 SunFounder PiCrawler Kit How it works? In general, this project combines the knowledge points of Remote Control, Computer Vision Sound Effect. Its flow is shown in the figure below: Chapter 4. Play with Ezblock...
  • Page 119 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 120: Pose

    SunFounder PiCrawler Kit 4.11 Pose PiCrawler can assume a specific posture by writing a coordinate array. Here it assumes a raised right rear foot posture. Program Note: • You can write the program according to the following picture, please refer to the tutorial: How to Create a New Project?.
  • Page 121 SunFounder PiCrawler Kit How it works? In this code, the code you need to pay attention to is this do step. It has two uses: One: It can directly use stand or sit. Second: It can also write an array of 4 coordinate values.
  • Page 122 SunFounder PiCrawler Kit You need to measure the coordinates of each toe individually. As shown below: Chapter 4. Play with Ezblock...
  • Page 123 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 124: Adjust Posture

    SunFounder PiCrawler Kit 4.12 Adjust Posture In this example, we use the remote function to control the PiCrawler foot by foot and assume the desired posture. You can tap the button to print out the current coordinate values. These coordinate values come in handy when you create unique actions for PiCrawler.
  • Page 125 SunFounder PiCrawler Kit Switch to the Remote Control interface, and you will see the following widgets. 4.12. Adjust Posture...
  • Page 126 SunFounder PiCrawler Kit How it works? What you need to pay attention to in this project are the following three blocks: Modify the coordinate value of a certain leg individually. Returns the coordinate value of the corresponding leg. You may want to simplify the program with Functions, especially when you perform the same operation multiple times.
  • Page 127: Record New Step

    SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 128 SunFounder PiCrawler Kit Switch to the Remote Control interface, and you will see the following widgets. Chapter 4. Play with Ezblock...
  • Page 129 SunFounder PiCrawler Kit How it works? This project was born out of Posture. Added recording and replay functions. Adjust The recording function is implemented by the following code. The replay function is implemented by the following code. 4.13. Record New Step...
  • Page 130: Twist

    SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 131 SunFounder PiCrawler Kit How it works? It uses two layers of for loops to make the new_step array produce continuous and regular changes, and at the same time, do step executes the posture to form a continuous action. You can intuitively get the coordinate value array corresponding to each pose from Adjust Posture.
  • Page 132: Emotional Robot

    Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
  • Page 133 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 134 SunFounder PiCrawler Kit Chapter 4. Play with Ezblock...
  • Page 135: Appendix

    CHAPTER FIVE APPENDIX Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 136 SunFounder PiCrawler Kit Step 2: Connect to Raspberry Pi After a quick install open it up and now connect it to an FTP server. It has 3 ways to connect, here we use the Quick Connect bar. Enter the hostname/IP, username, password and port (22), then click Quick Connect or press Enter to connect to the server.
  • Page 137 SunFounder PiCrawler Kit Note: Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts. Why Join? • Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
  • Page 138 SunFounder PiCrawler Kit 2. Use the following command to install OpenSSH.Client. Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 3. After installation, the following output will be returned. Path True Online False RestartNeeded : 4. Verify the installation by using the following command. Get-WindowsCapability -Online...
  • Page 139 SunFounder PiCrawler Kit 5.2. Install OpenSSH via Powershell...
  • Page 140 SunFounder PiCrawler Kit Chapter 5. Appendix...
  • Page 141 CHAPTER COPYRIGHT NOTICE All contents including but not limited to texts, images, and code in this manual are owned by the SunFounder Company. You should only use it for personal study,investigation, enjoyment, or other non-commercial or nonprofit purposes, under therelated regulations and copyrights laws, without infringing the legal rights of the author and relevant right holders.

Table of Contents