COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
imu_stream_plot.DataGen Class Reference
Inheritance diagram for imu_stream_plot.DataGen:
Collaboration diagram for imu_stream_plot.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_plot.DataGen.__init__ (   self,
  init = 0 
)
44  def __init__(self, init=0):
45  self.data = self.init = init
46 

Member Function Documentation

def imu_stream_plot.DataGen.next (   self)
47  def next(self):
48  self._recalc_data()
49  return self.data
50 
def imu_stream_plot.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 
58 
59  roll, pitch, yaw = genfromtxt('imu_data.txt',unpack=True, usecols=[1,2,3],delimiter=',', skip_footer=1)
60  self.data = roll
61 
62 
63  #if r > 0.9:
64  # self.data += delta * 15
65  #elif r > 0.8:
66  # attraction to the initial value
67  # delta += (0.5 if self.init > self.data else -0.5)
68  # self.data += delta
69  #else:
70  # self.data += delta
71 

Member Data Documentation

imu_stream_plot.DataGen.data
imu_stream_plot.DataGen.init

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