Teaching a Robot To Putt

Northwestern Master of Science in Robotics (MSR) student Josh Cohen shares how learning ROS helped him and his team have a Sawyer robot hit a golf ball into a hole.

Josh Cohen took Embedded Systems in Robotics and he and his team worked on a project to build a mini-golfing robot.

By Josh Cohen

This past quarter, I took Embedded Systems in Robotics, and Riley Knox, Shangzhou Ye, Yigitcan Comlek, and I worked on a project to build a mini-golfing robot. To do this, we made a putter that interfaced with the end of the 7 degrees of freedom (DOF) Sawyer arm. We wrote computer vision nodes for detecting the golf ball and hole as well as implementing motion planning algorithms to ensure the putter could get behind the ball and try to hit it into the hole. 

One of the biggest challenges that arose was mapping our overhead camera pixel frame coordinates — the values produced from computer vision finding the ball on the green — to Sawyer frame real-world coordinates so that the Sawyer could understand what the overhead camera was saying. A large source of this confusion came from not understanding at a low level what all these powerful Robot Operating System (ROS) tools were actually doing. However, this course gave us the knowledge to make design decisions about what parts of the ROS framework we would utilize and what we would implement ourselves from scratch.  

For me, that was the biggest takeaway from the Embedded Systems course as a whole. ROS is an amazing framework that has emerged from the collaborations of thousands of brilliant people, and getting the opportunity to learn how to navigate this complex, multi-domain ecosystem with someone as well versed in its many nuances as Prof. Matt Elwin was really an invaluable experience.  

With all of that in mind, I am really proud of how our final demonstration went. This final project was an awesome way to see what actualized complex robotics look like when tackled by a team. There are definitely large areas for improvement, specifically how we chose to implement the motion planning of hitting the ball. Because we implemented our solution with ROS-based design in mind, it is exceptionally modular with a specific node handling each process. Therefore, we are well set up for future work to refine and improve the behavior of our robot.  

Hopefully, others see this project as a testament to the power of ROS, open-source design, and what can be accomplished with well-executed teamwork.

Josh Cohen is a current student in Northwestern Engineering's Master of Science in Robotics (MSR) program.