To conclude this eventful semster I am tasked with navigating the map used in labs 9-11 by any means I want. There are more waypoints on the map/world this time and the task is to cross each one as quickly and as accurately as I can.
The order of the waypoints and the waypoints themselves are shown below as well as the grid/diagram of the pathing:
The intial plan to tackle this lab was to use the PID controller from lab 5 and 6 to control the orientation of the robot as it moves and making sure it is a caertain distance away from the walls, and use localization to help with knowing the angle and direction the robot needed to follow. Using these 3 together would result in an effeicient robot that would know where it is currently at where it needs to be change the direction and go the distance needed to the next point.
Unexpected behavior continued to pop up within my code, When I attempted to use my combine my code I my PID controllers were not operating as they were previously and the beliefs I was gathering still continued the same issues as seen in my lab 11. My PID controller for straight line movement was ok but due ot error accumaltion my robot would shoot foward and constantly overshoot the points. My orienation PID controller was causing my robot to constantly spin in circles and have huge oscillations between correcting the robot to move to the right and moving to the left. Finally while testing my localization code at the different waypoints my robots beliefs would be significantly off in the corners. All of these problems would pile on top of each other causing the robot to move violently and rapidly leading me to change my approach.
Instead of throwing on multiple layers of closed loop code that was prone to failing I decided that an open loop appraoch would be best. This allows me to quickly elminate errors that would take a very long time to fix and give me more control over the uncertainity of how my robot would react to the map.
To execute the trajectory illustrated in the grid (see Grid with Waypoints), I implemented a structured, step-by-step approach that would help me pass through each of the nine designated waypoints. The trajectory execution logic is broken into 7 sequential phases—each targeting one waypoint. At each step, the robot follows a tailored sequence of commands to advance toward the next location. All movement are handled from commands using timining, while orientation adjustments are done as needed since it was clear at times that the robot needed a push due to the friction of the floor or the tape on the wheels gripping the floor. These components work together to ensure the robot follows the intended path as accurately as possible.
Below is the video of the best run that my robot had with my open-loop appoarch:
Below this line is the code used to create the path shown in the grid picture shown earlier:
ble.send_command(CMD.MOVEF, "100|1300") time.sleep(4) ble.send_command(CMD.ADJUSTRIGHT, "255|140") time.sleep(4) ble.send_command(CMD.MOVEF, "100|1575") time.sleep(4) ble.send_command(CMD.ADJUSTRIGHT, "255|200") time.sleep(4) ble.send_command(CMD.MOVEF, "100|1270") time.sleep(4) ble.send_command(CMD.ADJUSTLEFT, "255|120") time.sleep(4) ble.send_command(CMD.MOVEF, "100|1530") time.sleep(4) ble.send_command(CMD.ADJUSTLEFT, "255|220") time.sleep(4) ble.send_command(CMD.MOVEF, "100|2500") time.sleep(4) ble.send_command(CMD.ADJUSTLEFT, "255|190") time.sleep(4) ble.send_command(CMD.MOVEF, "100|2100") time.sleep(4) ble.send_command(CMD.ADJUSTLEFT, "255|190") time.sleep(4) ble.send_command(CMD.MOVEF, "100|1300") time.sleep(4)
Each of the commands are reciving the analogWrite value needed to let the robot move at a good pace and the duration of how long it needs to do an action.
When running the trajectory execution code on the robot, I found that while the movement commands were moderately accurate, they lacked precision—often undershooting or overshooting waypoints. Thanks to the flexibility of my code, I was able to refine and retest it directly on the robot without reuploading to the Artemis platform. This allowed me to conduct over various trials, with the featured run being the most successful. Even in that trial, I had to manually adjust the robot’s position at times to ensure it completed certain sequences.