Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

ObserverMain.cpp

Go to the documentation of this file.
00001 
00002 #include <Utils/Measurement.h>
00003 #include <matrix/Matrix.h>
00004 #include <Base/Device.h>
00005 #include <Utils/DeviceNames.h>
00006 #include <Base/Sensor.h>
00007 #include <Sensors/AttitudeSensor.h>
00008 #include <Sensors/RateGyro.h>
00009 #include <Sensors/DMURateGyro.h>
00010 #include <Sensors/DMU.h>
00011 #include <Base/Whorl.h>
00012 #include "DefaultObserver.h"
00013 #include <iostream>
00014 
00015 using namespace O_SESSAME;
00016 using namespace std;
00017 
00018 int main() {
00019         
00020         Whorl WhorlOne;
00021         
00022         /** Add the rate gyros to the Whorl object */
00023         DMURateGyro* rg1 = new DMURateGyro(1);
00024         DMURateGyro* rg2 = new DMURateGyro(2);
00025         DMURateGyro* rg3 = new DMURateGyro(3);
00026         WhorlOne.SetSensor(string("RG1"), rg1);
00027         WhorlOne.SetSensor(string("RG2"), rg2);
00028         WhorlOne.SetSensor(string("RG3"), rg3);
00029         
00030         /** Set Whorl object initial conditions */
00031         Vector zeroVector(3);   
00032         WhorlOne.SetState(zeroVector);
00033         WhorlOne.SetControl(zeroVector);
00034         
00035         /** Set Whorl object parameters */
00036         Vector params(6);
00037         params(1) = 2.0;
00038         params(4) = 3.0;
00039         params(6) = 4.0;
00040         WhorlOne.SetParameter(params);
00041         
00042         struct timeval t0;
00043         WhorlOne.GetSensor(string("RG1"))->GetMeasurement().GetTime(t0);
00044         WhorlOne.SetTimeOfEstimate(t0);
00045         
00046         DefaultObserver myObserver;
00047         myObserver.Initialize(&WhorlOne);
00048         
00049         myObserver.Run();
00050         
00051         delete rg1;
00052         delete rg2;
00053         delete rg3;
00054         
00055         cout << "I made it all the way through!" << endl;
00056         
00057 }
00058 

Generated on Wed Sep 5 12:54:23 2007 for DSACSS Operational Code by  doxygen 1.3.9.1