Sunday, February 11, 2018

ROS Addition: Piece de Resistance

I learned that ROS_INFO and ROS_DEBUG route to a ROS message topic called /rosout.  Knowing that would have saved me so much time!!!!!  Way back at the beginning, when I was trying to make an overlay of the AMCL package, I put a lot of debug statements in the AMCL code and could never figure out where they were being printed.  I later discovered the "rqt" tool, but /rosout is much easier!

The greatest part is that I can log messages to ROS_INFO and record them into my bag file by adding the /rosout topic to the list that my bag file is recording with each data run.  The list of topics being recorded is pretty long now!

This allows me to log the exact time that the robot has been kidnapped, as well as the to and from locations that the robot is being moved to.  Now I have EVERYTHING I need in the bag file - no more need for a separate .txt file to record the kidnap event, like I used to have.

I'm really happy with my apparatus for creating trial data - bag data for the win!

Adjusting the Neural Network Design

Even though my histogram ratio attribute was a good classifier for kidnap activity, I struggled to train my neural net to identify the calculation.  I wasn't doing much on the neural net's internal structure, however - I was letting Matlab handle most of it, and setting the initial layer to 15 neurons.  I probably should have been more strategic about the neural net's layers if I wanted to improve my results.

I learned a valuable lesson by discussing my problem with my research advisor.  The fact that I could perform a calculation on the histogram of the particle filter particle weights and label the results as 1 or 0 means that I'm imposing my own (unnecessary) limits on the problem (that the ratio of the tallest to 2nd tallest histograms is the solution).  If I instead give the neural network the raw histogram bin data, the neural network will have more flexibility to find its own version of the relationship between the histogram bin heights that are assigned to "Kidnap" and "Normal" events.

Now, my dataset consists of 10 variables - the heights of each of the 10 histogram bins that correspond to the weights of the particles in the particle filter.