00001 #ifndef SIGEL_SIMULATION_SIG_DYNAMECHSSIMULATIONDATA_H 00002 #define SIGEL_SIMULATION_SIG_DYNAMECHSSIMULATIONDATA_H 00003 00004 #include "SIGEL_Simulation/SIG_SimulationData.h" 00005 #include "SIGEL_Simulation/SIG_DynaMechsLink.h" 00006 00007 #include <dm.h> 00008 #include <dmArticulation.hpp> 00009 #include <dmEnvironment.hpp> 00010 #include <dmLink.hpp> 00011 #include <dmIntegrator.hpp> 00012 00013 #include <qvector.h> 00014 00015 namespace SIGEL_Simulation 00016 { 00017 00025 class SIG_DynaMechsSimulationData : public SIG_SimulationData 00026 { 00027 00028 public: 00029 00043 SIG_DynaMechsSimulationData( SIGEL_Robot::SIG_Robot const & robot, 00044 SIGEL_Environment::SIG_Environment const & environment, 00045 SIG_SimulationParameters const & simulationParameter ); 00046 00047 void simulationProgress(); 00048 00049 void setNewFrame( bool newValue ); 00050 00051 dmEnvironment dynaMechsEnvironment; 00052 00053 dmArticulation dynaMechsSystem; 00054 00055 dmIntegrator *dynaMechsIntegrator; 00056 00057 QVector< SIG_DynaMechsLink > dynaMechsLinks; 00058 00059 QArray< int > jointIndices; 00060 00061 QVector< SIGEL_Robot::SIG_Drive > drives; 00062 00063 QArray< double > driveForcesTimeAccounts; 00064 00065 QVector< SIGEL_Robot::SIG_Sensor > sensors; 00066 00067 int noOfDrives; 00068 00069 private: 00070 00071 void initializeEnvironment(); 00072 00073 void initializeArticulation(); 00074 00075 SIG_DynaMechsLink *initializeJoint( SIGEL_Robot::SIG_Joint *joint, 00076 SIGEL_Robot::SIG_Link const *caller ); 00077 00078 void rotationMatrixToQuaternion( NEWMAT::Matrix rotationMatrix, 00079 double &x, 00080 double &y, 00081 double &z, 00082 double &w ); 00083 00084 double const pi; 00085 00086 }; 00087 00088 } 00089 00090 #endif // SIGEL_SIMULATION_SIG_DYNAMECHSSIMULATIONDATA_H 00091