Changeset 186 in flair-src for trunk/lib/FlairCore


Ignore:
Timestamp:
Jun 23, 2017, 5:33:03 PM (8 years ago)
Author:
Sanahuja Guillaume
Message:

maj imu

Location:
trunk/lib/FlairCore/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/FrameworkManager.cpp

    r123 r186  
    8181  for (vector<const Object *>::iterator it = Childs()->begin();
    8282       it < Childs()->end(); it++) {
    83     // Printf("child %i %s
    84     // %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
     83     //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
    8584    if ((*it)->ObjectType() == "Thread") {
    8685      if (*it != pimpl_) {
     
    102101  for (vector<const Object *>::iterator it = Childs()->begin();
    103102       it < Childs()->end(); it++) {
    104     // Printf("child %i %s
    105     // %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
     103     //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
    106104    if ((*it)->ObjectType() == "IODevice") {
    107105      // Printf("del\n");
     
    122120  // permet de garder l'uicom pour notifer des destructions
    123121  while (Childs()->size() != 0) {
    124     // Printf("child %i %s
    125     // %s\n",Childs()->size(),Childs()->back()->ObjectName().c_str(),Childs()->back()->ObjectType().c_str());
     122     //Printf("child %i %s %s\n",Childs()->size(),Childs()->back()->ObjectName().c_str(),Childs()->back()->ObjectType().c_str());
    126123    if (Childs()->back() != NULL)
    127124      delete Childs()->back();
     
    135132void FrameworkManager::SetupConnection(string address, uint16_t port,Time watchdogTimeout,
    136133                                       size_t rcv_buf_size) {
    137   pimpl_->SetupConnection(address, port, rcv_buf_size);
     134  pimpl_->SetupConnection(address, port, watchdogTimeout,rcv_buf_size);
    138135}
    139136
  • trunk/lib/FlairCore/src/FrameworkManager_impl.cpp

    r137 r186  
    239239  gcs_watchdog = new Watchdog(
    240240      this, std::bind(&FrameworkManager_impl::ConnectionLost, this),
    241       (Time)1000000000);
     241      watchdogTimeout);
    242242  gcs_watchdog->Start();
    243243}
  • trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp

    r167 r186  
    2222#include <Euler.h>
    2323#include <Quaternion.h>
     24#include <math.h>
    2425
    2526using std::string;
     
    4142OneAxisRotation_impl::~OneAxisRotation_impl() {}
    4243
    43 // compute rotation of each axis through ComputeRotation(Vector3D& vector)
    4444void OneAxisRotation_impl::ComputeRotation(Quaternion &quat) const {
    45   Vector3Df rot = Vector3Df(quat.q1, quat.q2, quat.q3);
    46   ComputeRotation(rot);
    47   quat.q1 = rot.x;
    48   quat.q2 = rot.y;
    49   quat.q3 = rot.z;
     45  Quaternion rot;
     46  switch (rot_axe->CurrentIndex()) {
     47    case 0:
     48      rot=Quaternion(cosf(Euler::ToRadian(rot_value->Value()/2)),sinf(Euler::ToRadian(rot_value->Value()/2)), 0,0);
     49      break;
     50    case 1:
     51      rot=Quaternion(cosf(Euler::ToRadian(rot_value->Value()/2)),0,sinf(Euler::ToRadian(rot_value->Value()/2)),0);
     52      break;
     53    case 2:
     54      rot=Quaternion(cosf(Euler::ToRadian(rot_value->Value()/2)),0,0,sinf(Euler::ToRadian(rot_value->Value()/2)));
     55      break;
     56  }
     57  quat=quat*rot;
    5058}
    5159
  • trunk/lib/FlairCore/src/Thread_impl.cpp

    r133 r186  
    5757  this->priority = priority;
    5858  period = 100 * 1000 * 1000; // 100ms par defaut
    59   min_jitter = 1000 * 1000 * 1000;
    60   max_jitter = 0;
    61   mean_jitter = 0;
     59  min_latency = 1000 * 1000 * 1000;
     60  max_latency = 0;
     61  mean_latency = 0;
    6262  last = 0;
    6363  cpt = 0;
     
    234234  next_time += period;
    235235#endif
    236   ComputeJitter(GetTime());
     236  ComputeLatency(GetTime());
    237237}
    238238
     
    324324  {
    325325#ifndef __XENO__
    326 // if(last!=0)
     326  if(last!=0)
    327327#endif
    328328    { Printf("Thread::%s :\n", self->ObjectName().c_str()); }
     
    346346#endif
    347347    if (last != 0) {
    348       Printf("    min jitter (ns): %lld\n", min_jitter);
    349       Printf("    max jitter (ns): %lld\n", max_jitter);
    350       Printf("    jitter moy (ns): %lld\n", mean_jitter / cpt);
     348      Printf("    min latency (ns): %lld\n", min_latency);
     349      Printf("    max latency (ns): %lld\n", max_latency);
     350      Printf("    latency moy (ns): %lld\n", mean_latency / cpt);
    351351      Printf("    itertions: %lld\n", cpt);
    352352    }
     
    370370}
    371371
    372 void Thread_impl::ComputeJitter(Time time) {
     372void Thread_impl::ComputeLatency(Time time) {
    373373  Time diff, delta;
    374374  diff = time - last;
     
    384384    return;
    385385
    386   if (delta > max_jitter)
    387     max_jitter = delta;
    388   if (delta < min_jitter)
    389     min_jitter = delta;
    390   mean_jitter += delta;
     386  if (delta > max_latency)
     387    max_latency = delta;
     388  if (delta < min_latency)
     389    min_latency = delta;
     390  mean_latency += delta;
    391391  cpt++;
    392392
    393   // Printf("Thread::%s jitter moy (ns):
    394   // %lld\n",self->ObjectName().c_str(),mean_jitter/cpt);
     393  // Printf("Thread::%s latency moy (ns):
     394  // %lld\n",self->ObjectName().c_str(),mean_latency/cpt);
    395395}
    396396
  • trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h

    r122 r186  
    4444  ~FrameworkManager_impl();
    4545  void SetupConnection(std::string address, uint16_t port,flair::core::Time watchdogTimeout,
    46                        size_t rcv_buf_size = 10000);
     46                       size_t rcv_buf_size);
    4747  void SetupUserInterface(std::string xml_file);
    4848  void SetupLogger(std::string log_path);
  • trunk/lib/FlairCore/src/unexported/Thread_impl.h

    r139 r186  
    5555  flair::core::ConditionVariable *cond;
    5656  uint8_t priority;
    57   flair::core::Time max_jitter, min_jitter, mean_jitter;
     57  flair::core::Time max_latency, min_latency, mean_latency;
    5858  flair::core::Time last;
    5959  uint64_t cpt;
     
    6262  bool is_suspended;
    6363  void PrintStats(void);
    64   void ComputeJitter(flair::core::Time time);
     64  void ComputeLatency(flair::core::Time time);
    6565#ifdef __XENO__
    6666  RT_TASK task_rt;
Note: See TracChangeset for help on using the changeset viewer.