COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
imu_stream_plot2.DataGen Class Reference
Inheritance diagram for imu_stream_plot2.DataGen:
Collaboration diagram for imu_stream_plot2.DataGen:

Public Member Functions

def __init__ (self, init=0)
 
def next (self)
 

Public Attributes

 data
 
 init
 

Private Member Functions

def _recalc_data (self)
 

Detailed Description

A silly class that generates pseudo-random data for
    display in the plot.

Constructor & Destructor Documentation

def imu_stream_plot2.DataGen.__init__ (   self,
  init = 0 
)
44  def __init__(self, init=0):
45  self.data = self.init = init
46 

Member Function Documentation

def imu_stream_plot2.DataGen.next (   self)
47  def next(self):
48  self._recalc_data()
49  return self.data
50 
def imu_stream_plot2.DataGen._recalc_data (   self)
private
51  def _recalc_data(self):
52  delta = random.uniform(-0.5, 0.5)
53  r = random.random()
54  #self.data += delta *15
55 
56  #x, y = loadtxt('example.txt',unpack=True, usecols=[0,1],delimiter=',')
57  with open("imu_data.txt") as i:
58  for line in i:
59  try:
60  commaline = i.read()
61  roll, pitch, yaw = commaline.strip().split(",")
62  map(int, line.split())
63  self.data = roll
64  except ValueError:
65  continue

Member Data Documentation

imu_stream_plot2.DataGen.data
imu_stream_plot2.DataGen.init

The documentation for this class was generated from the following file: