I’m extremely happy that I have successfully completed all of the projects in my Intro to Autonomous systems class. All the hard work and dedication I poured into the course truly paid off, and I feel incredibly proud of myself for pushing through the tough moments and overcoming every challenge. This journey wasn’t always easy, but the sheer joy of seeing my projects come to life and understanding the intricacies of autonomous systems made it all worthwhile. Now that I have a solid foundation in this fascinating field, I’m excited to explore the vast potential it holds. From intelligent robotics to self-driving cars, the possibilities seem endless.
The last project involved programming an MBot-Omni robot to autonomously follow a wall, a foundational exercise in understanding robotic movement and sensor integration. I partnered with Bishal Timalsina, who is one of great programmers I know on campus. We split the task, and I was responsible for programming the cross product and the CTRL + C function for termination in the program, and Bishal worked on the minimum distance function and ensured the robot was functioning correctly. My role was pivotal in writing and testing the Python code, ensuring the robot accurately followed the wall using sensors and algorithms. This responsibility not only honed my coding skills but also provided a practical understanding of how software breathes life into robotic hardware.
The transition from C++ to Python was challenging yet rewarding. One significant hurdle was adapting the logic of functions like find_min_dist
and cross_product
to Python’s syntax and libraries. Initially, I viewed Python as secondary to C++ in the context of robotics. This project, however, upended that notion. I learned the importance of versatility in programming languages. Python’s simplicity and readability, combined with its powerful libraries like numpy, made complex tasks like calculating the cross product more intuitive. Additionally, the find_min_dist
function, crucial for detecting the nearest wall, required careful consideration of invalid sensor readings, while cross_product
was integral in determining the robot’s movement direction relative to the wall. In other words, in the beginning, my teammate and I thought our code was working perfectly. After Dr. Jones looked at our robot, she quickly realized our code was missing something because it wasn’t working very well. Then we realized we had to apply the correction vector to determine the robot’s movement direction relative to the wall.
From the C++ project, we learned how the correction vector work. This code snippet demonstrates a basic implementation of a correction vector that helps a robot follow a desired trajectory. By calculating the minimum distance and angle to the setpoint, the correction vector guides the robot towards the trajectory while taking into account its current cross-track error. The robot’s movement is then adjusted by adding the correction vector components to its current cross-track error correction, ensuring it follows the desired path.
correction = [(min_dist – setpoint) * np.cos(min_angle),
(min_dist – setpoint) * np.sin(min_angle),
0]
robot.drive(crossP[0] + correction[0], crossP[1] + correction[1], 0)
Overall, witnessing the robot successfully navigate around a wall was a moment of triumph. The enclosed images and videos capture these successful executions, showcasing the real-world application of our code. These moments were not just demonstrations of technical proficiency but also symbols of our team’s collaborative effort and dedication.
I was unable to upload a video or animated image (GIF) of the robot moving. However, the snapshots above clearly show the robot is following the wall as it moves along.
This project was a significant leap from my previous work in C++. The experience underscored the importance of adaptable programming skills and deepened my understanding of Python’s application in robotics. I never thought Python had any application in robotics engineering because I thought C++ is for that. So, that was an important lesson.
Writer: Ali Ramazani
Teammate: Bishal Timalsina
Class: Intro to Autonomous Systems
Professor: Dr. Wu, Dr. Jones