def ReadPlotDefinitions(filename):
  """
  Read a file with plotting definitions.

  A plotting definition is a single line that defines what data to search for
  in order to plot it. The following in a file would duplicate the default
  behaviour:

    fridge goal height
    fridge goal angle
    fridge goal velocity
    fridge goal angular_velocity
    fridge output left_arm
    fridge output right_arm
    fridge output left_elevator
    fridge output right_elevator

  Lines are ignored if they start with a hash mark (i.e. '#').

  Lines that end with a "-b X" where X is a number then it designates that line
  as plotting a boolean value. X is the value plotted when the boolean is true.
  When the boolean is false then the values is plotted as zero. For example,
  the following boolean value is drawn to toggle between 2.0 and 0 when the
  boolean is True and False, respectively:

    fridge status zeroed -b 2.0

  Args:
    filename: The name of the file to read the definitions from.

  Returns:
    [[str]]: The definitions in the specified file.
  """
  defs = []
  with open(filename) as fd:
    for line in fd:
      raw_defs = line.split()

      # Only add to the list of definitions if the line's not empty and it
      # doesn't start with a hash.
      if raw_defs and not raw_defs[0].startswith('#'):
        defs.append(raw_defs)

  return defs