top of page
Search
  • Writer's pictureAlex Janis

Week 4: ROS-istance Is Futile

Updated: Aug 9, 2019

This week, we got a new project: WobbleBot. It looks like a silhouette of a penguin with two nearly horizontal wheels for feet. The wheels turn in opposite directions, allowing the robot to glide forward. Our first problem with WobbleBot is that the motors aren't exactly the same, so the robot turns when we want it to go straight forward. To solve this problem, we are implementing an IMU (similar to the one on the TorsoBot) for this robot.

WobbleBot

The robotic arm was also a work in progress for this week. We wanted to implement ROS onto it. This would've been very simple because there was already a program for the robot arm, however, we redesigned the servos for the arm. This meant that the program needed to be changed. Unfortunately, no one on our team knew how to use ROS. I took a trip to the library that day after work in order to find some books on it.


The second day of this week, I worked mostly on fixing the ROS code. There were multiple errors in various sections of it, but we were able to get it to launch. ROS's programing language is very different from python (which is what I was using). Even simple commands like print() were not functioning properly in the code. I sat down and spent most of the day reading through ROS's massive tutorial online. I learned how ROS organizes programs into nodes and connects them with topics. In order for one node to communicate with another, it must publish a message to a topic. The other node (as long as it is subscribed to that specific topic) can view these messages.


We consistently got three specific errors from 3 separate programs. The first read, "Index error: index 43 is out of bounds for axis zero with size 43". This could mean any number of things but most likely meant that one of our sets of data had less values than the program thought it should have had. the second read, "Runtime Error: invalid value encountered in arccos". I took this to mean that, in the section of our code that used the arc cosine function, was taking values that were out of the domain of that function. The third read, "Runtime Error: Invalid value encountered in divide". This most likely meant that, somewhere in our program, there was a function trying to divide by zero. I believed that these errors were being caused by one problem in an earlier section of code.


In order to trouble shoot and solve these problems, I tried to print the variables that were causing these errors. However, as I mentioned earlier, ROS doesn't allow you to use the function print(). Over the course of the day, I learned more about nodes and topics and found various ways to print information about them. I was able to print all active topics and create a graph of all the nodes and how they connected to each other. That day, I did not figure out a way to print the variables.


The next day, the interns worked on the WobbleBot. We decided that we wanted to implement an IMU. This device measures acceleration and position. With the IMU, the WobbleBot would know when it turns or falls over. Once we put it on, we could add a program telling it to compensate for the uneven servos and keep its balance.


I continued working on the robotic arm. In order to print the variable I wanted, I created a new topic and a new node to subscribe to it. If I could get an existing node to publish the variable to the topic, I could get the new node to print the message. After a few more hours of research and troubleshooting, I got the data. The variable I wanted to print was related to the positions of the six servos on the robotic arm. Every once in awhile, the data would print "NaN". This means "Not a Number". My next problem was that I did not know which values belonged to which servo. I ran the program and stopped it after the NaNs appeared and copied the the data into an excel file. With over 500 values, it would have taken me days to sort through the data. So I went in to my computer and created a program that read and sorted the data from the excel file into its respective servo using software called Pandas. Then added a section that graphed the data using matplotlib. It took an hour or two of working with one of the grad students to perfect this program, but, in the end, I simply looked up the errors I was getting on the internet and tried a few different solutions. The end result was this graph:

Next week, I will focus on analyzing this graph and using it to improve on the functioning of the robotic arm.

1 view0 comments

Recent Posts

See All

Week 9: Final Week

I began a new project of transferring Dr. Adamczyk's handwritten notes into a completely textual Pressbooks format. The notes contained...

Comments


Post: Blog2_Post
bottom of page