pibot:challenge2:softwarewin
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
pibot:challenge2:softwarewin [2021/09/12 15:44] – created jstruebel | pibot:challenge2:softwarewin [2022/10/20 19:53] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Software Setup ====== | ||
+ | |||
+ | - Open the VSCode from the Applications directory on the flash drive | ||
+ | - Click on the small green square in the bottom left corner of the screen\\ \\ <WRAP box>{{ : | ||
+ | - Select the " | ||
+ | - Type " | ||
+ | - Click the "Open Folder" | ||
+ | - Select the " | ||
+ | - Select the picar-line-maze.py file in the list on the left\\ \\ <WRAP box>{{ : | ||
+ | - Select File-> | ||
+ | - Use the information below to change the code so that the PiBot will solve the maze with obstacles | ||
+ | - After the changes to the code are complete, save it with File-> | ||
+ | |||
+ | ===== Software Explanation ===== | ||
+ | |||
+ | * Copy the GPIO settings for the ECHO and TRIGGER pins as well as the servo setting from the picar-obstacle-avoid.py file | ||
+ | * Copy the measure function from the picar-obstacle-avoid.py file | ||
+ | * Copy the pwm.set_pwm function calls for the servo from the picar-obstacle-avoid.py file | ||
+ | * Copy the ob_range variable from the picar-obstacle-avoid.py file and use it to determine if there is an obstacle that the PiBot needs to avoid | ||
+ | * Include debugging prints to help troubleshoot if the distance measured doesn' | ||
+ | * Make the changes to the intersection decision logic to sense for obstacles and react to any obstacles that are in the path\\ \\ <WRAP round tip>It may be easiest to only take a sonar measurement after making a decision (and turn if necessary) at an intersection. If there is an obstacle then the PiBot will need to undo the decision (and turn).</ | ||
+ | * Bonus points if you include moving the sonar sensor in the PiBot' | ||
+ | |||
+ | [[: | ||