Changeset 206 in flair-src


Ignore:
Timestamp:
Jan 9, 2018, 11:43:37 AM (3 years ago)
Author:
Sanahuja Guillaume
Message:

m

Location:
trunk/lib
Files:
11 edited

Legend:

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

    r203 r206  
    127127    }
    128128  } else if (type==SharedMem::Type::producerConsumer) {
    129       if (sem_producer.GetSemaphore(nsTimeout)) {
    130         memcpy(buf, mem_segment, size);
    131         sem_consumer.ReleaseSemaphore();
     129    if (sem_producer.GetSemaphore(nsTimeout)) {
     130      memcpy(buf, mem_segment, size);
     131      sem_consumer.ReleaseSemaphore();
    132132      return true;
    133133    }
  • trunk/lib/FlairCore/src/Thread_impl.cpp

    r202 r206  
    227227    self->Err("Error rt_task_wait_period %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
    228228        }
     229//avoid spamming messages
     230/*
    229231  if (status == -ETIMEDOUT) {
    230232    self->Err("overrun: %lld\n", overruns_r);
    231         }
     233        }*/
    232234#else
    233235  self->SleepUntil(next_time);
    234236  Time current = GetTime();
    235   if(current>next_time+period) self->Err("overrun of %lld\n", current-next_time);
     237//avoid spamming messages
     238  //if(current>next_time+period) self->Err("overrun of %lld\n", current-next_time);
    236239  while (next_time < current) {
    237240    next_time += period;
  • trunk/lib/FlairFilter/src/PidThrust.cpp

    r157 r206  
    4343}
    4444
    45 void PidThrust::Reset(void) {
    46   pimpl_->i = 0;
    47   pimpl_->offset_g = 0;
    48 }
    49 
    5045void PidThrust::ResetI(void) { pimpl_->i = 0; }
    5146
     
    6257}
    6358
    64 void PidThrust::ResetOffset(void) { pimpl_->offset_g = 0; }
     59void PidThrust::SetDefaultOffset(void) { pimpl_->offset_g = pimpl_->offset->Value(); }
    6560
    66 void PidThrust::SetOffset(void) { pimpl_->offset_g = pimpl_->offset->Value(); }
     61void PidThrust::SetOffset(float value) { pimpl_->offset_g = value; }
    6762
    6863bool PidThrust::OffsetStepUp(void) {
  • trunk/lib/FlairFilter/src/PidThrust.h

    r15 r206  
    5555
    5656  /*!
    57   * \brief Reset integral and offset to 0
    58   *
    59   */
    60   void Reset(void);
    61 
    62   /*!
    6357  * \brief Reset integral to 0
    6458  *
     
    6761
    6862  /*!
    69   * \brief Reset offset to 0
     63  * \brief Set offset to a specified value
    7064  *
     65  * \param value desired value
    7166  */
    72   void ResetOffset(void);
    73 
     67  void SetOffset(float value);
     68 
    7469  /*!
    7570  * \brief Set offset to specified value in ground station
    7671  *
    7772  */
    78   void SetOffset(void);
     73  void SetDefaultOffset(void);
    7974
    8075  /*!
  • trunk/lib/FlairMeta/src/SimuX4.cpp

    r186 r206  
    7676  ((SimuUs *)GetUsRangeFinder())->Start();
    7777  ((SimuCamera *)GetVerticalCamera())->Start();
    78   ((SimuCamera *)GetHorizontalCamera())->Start();
     78  //((SimuCamera *)GetHorizontalCamera())->Start();
    7979  if(GetGps()) ((SimuGps *)GetGps())->Start();
    8080}
  • trunk/lib/FlairMeta/src/UavStateMachine.cpp

    r201 r206  
    469469    joy->SetZRef(0);
    470470
    471     uZ->SetOffset(); // positionne l'offset de compensation de la gravité à sa
     471    uZ->SetDefaultOffset(); // positionne l'offset de compensation de la gravité à sa
    472472                     // valeur initiale (station sol)
    473473
     
    761761  return true;
    762762}
     763
     764NestedSat* UavStateMachine::GetURoll(void) { return uRoll;};
     765NestedSat* UavStateMachine::GetUPitch(void) { return uPitch;};
     766Pid* UavStateMachine::GetUYaw(void) { return uYaw;};
     767PidThrust* UavStateMachine::GetUZ(void) { return uZ;};
     768TrajectoryGenerator1D * UavStateMachine::GetAltitudeTrajectory(void) { return altitudeTrajectory;};
  • trunk/lib/FlairMeta/src/UavStateMachine.h

    r167 r206  
    228228  const sensor::TargetController *GetJoystick(void) const;
    229229  MetaDualShock3 *joy;
     230 
     231  filter::NestedSat *GetURoll(void);
     232  filter::NestedSat *GetUPitch(void);
     233  filter::Pid *GetUYaw(void);
     234  filter::PidThrust *GetUZ(void);
     235  filter::TrajectoryGenerator1D *GetAltitudeTrajectory(void);
    230236
    231237  gui::Tab *setupLawTab, *graphLawTab;
  • trunk/lib/FlairSensorActuator/src/NmeaGps.cpp

    r194 r206  
    176176
    177177  int result;
    178 //Printf("%s\n",frame);
     178Printf("%s\n",frame);
     179Printf("%x %x\n",&parser,parser.buffer);
    179180  result = nmea_parse(&parser, frame, frame_size, &info);
     181  Printf("%x %x\n",&parser,parser.buffer);
    180182  if (result != 1) {
    181183    Warn("unrecognized nmea sentence: %s\n",frame);
    182184    return;
    183185  }
    184 
     186Printf("3\n");
     187Printf("%x %x\n",&parser,parser.buffer);
    185188  result = nmea_parse_GPGGA(frame, frame_size, &pack);
    186 
     189Printf("%x %x\n",&parser,parser.buffer);
    187190  if (result == 1) {
     191    Printf("%x %x\n",&parser,parser.buffer);
    188192    nmea_info2pos(&info, &pos);
    189      
     193     Printf("%x %x\n",&parser,parser.buffer);
    190194   //  Printf("nb:%i fix:%i lat:%f long:%f alt:%f vel:%f angle:%f\n",pack.satinuse,pack.sig,info.lat,info.lon,info.elv,info.speed*1000./3600.,info.direction);
    191195//Printf("lat:%f long:%f\n",pos.lat,pos.lon);
  • trunk/lib/FlairSensorActuator/src/SimuCamera.cpp

    r158 r206  
    9797                                                   // échange de pointeur sur
    9898                                                   // double buffering
     99                                           
    99100    output->ReleaseMutex();
    100101    memcpy(&time,shmemReadBuf+buf_size-sizeof(Time),sizeof(Time));
  • trunk/lib/FlairSensorActuator/src/SimuGps.cpp

    r170 r206  
    4848  fixQuality = new SpinBox(GetGroupBox()->NewRow(), "fix quality", 1, 8, 1, 1);
    4949  numberOfSatellites = new SpinBox(GetGroupBox()->NewRow(), "number of satellites", 1, 15, 1, 5);
    50 
     50  magneticDeclination= new DoubleSpinBox(GetGroupBox()->NewRow(), "magnetic declination", " deg", -180, 180, .1, 2,0);
     51 
    5152  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
    5253                        sizeof(gps_states_t));
     
    152153
    153154    nmea_gen_GPGGA(buf,sizeof(buf),&gga);
     155    Printf("1\n");
    154156    parseFrame(buf,sizeof(buf));
    155157
     
    157159    vtg.spk=sqrtf(state.ve*state.ve+state.vn*state.vn)*3600./1000.;
    158160    nmea_gen_GPVTG(buf,sizeof(buf),&vtg);
     161    Printf("2\n");
    159162    parseFrame(buf,sizeof(buf));
    160163  }
  • trunk/lib/FlairSensorActuator/src/SimuGps.h

    r170 r206  
    9999  core::SharedMem *shmem;
    100100  gui::SpinBox *dataRate,*fixQuality,*numberOfSatellites;
    101   gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef;
     101  gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef,*magneticDeclination;
    102102};
    103103} // end namespace sensor
Note: See TracChangeset for help on using the changeset viewer.