Changeset 206 in flair-src
- Timestamp:
- Jan 9, 2018, 11:43:37 AM (7 years ago)
- Location:
- trunk/lib
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/SharedMem_impl.cpp
r203 r206 127 127 } 128 128 } else if (type==SharedMem::Type::producerConsumer) { 129 130 131 129 if (sem_producer.GetSemaphore(nsTimeout)) { 130 memcpy(buf, mem_segment, size); 131 sem_consumer.ReleaseSemaphore(); 132 132 return true; 133 133 } -
trunk/lib/FlairCore/src/Thread_impl.cpp
r202 r206 227 227 self->Err("Error rt_task_wait_period %s\n", strerror_r(-status, errorMsg, sizeof(errorMsg))); 228 228 } 229 //avoid spamming messages 230 /* 229 231 if (status == -ETIMEDOUT) { 230 232 self->Err("overrun: %lld\n", overruns_r); 231 } 233 }*/ 232 234 #else 233 235 self->SleepUntil(next_time); 234 236 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); 236 239 while (next_time < current) { 237 240 next_time += period; -
trunk/lib/FlairFilter/src/PidThrust.cpp
r157 r206 43 43 } 44 44 45 void PidThrust::Reset(void) {46 pimpl_->i = 0;47 pimpl_->offset_g = 0;48 }49 50 45 void PidThrust::ResetI(void) { pimpl_->i = 0; } 51 46 … … 62 57 } 63 58 64 void PidThrust:: ResetOffset(void) { pimpl_->offset_g = 0; }59 void PidThrust::SetDefaultOffset(void) { pimpl_->offset_g = pimpl_->offset->Value(); } 65 60 66 void PidThrust::SetOffset( void) { pimpl_->offset_g = pimpl_->offset->Value(); }61 void PidThrust::SetOffset(float value) { pimpl_->offset_g = value; } 67 62 68 63 bool PidThrust::OffsetStepUp(void) { -
trunk/lib/FlairFilter/src/PidThrust.h
r15 r206 55 55 56 56 /*! 57 * \brief Reset integral and offset to 058 *59 */60 void Reset(void);61 62 /*!63 57 * \brief Reset integral to 0 64 58 * … … 67 61 68 62 /*! 69 * \brief Reset offset to 063 * \brief Set offset to a specified value 70 64 * 65 * \param value desired value 71 66 */ 72 void ResetOffset(void);73 67 void SetOffset(float value); 68 74 69 /*! 75 70 * \brief Set offset to specified value in ground station 76 71 * 77 72 */ 78 void Set Offset(void);73 void SetDefaultOffset(void); 79 74 80 75 /*! -
trunk/lib/FlairMeta/src/SimuX4.cpp
r186 r206 76 76 ((SimuUs *)GetUsRangeFinder())->Start(); 77 77 ((SimuCamera *)GetVerticalCamera())->Start(); 78 ((SimuCamera *)GetHorizontalCamera())->Start();78 //((SimuCamera *)GetHorizontalCamera())->Start(); 79 79 if(GetGps()) ((SimuGps *)GetGps())->Start(); 80 80 } -
trunk/lib/FlairMeta/src/UavStateMachine.cpp
r201 r206 469 469 joy->SetZRef(0); 470 470 471 uZ->Set Offset(); // positionne l'offset de compensation de la gravité à sa471 uZ->SetDefaultOffset(); // positionne l'offset de compensation de la gravité à sa 472 472 // valeur initiale (station sol) 473 473 … … 761 761 return true; 762 762 } 763 764 NestedSat* UavStateMachine::GetURoll(void) { return uRoll;}; 765 NestedSat* UavStateMachine::GetUPitch(void) { return uPitch;}; 766 Pid* UavStateMachine::GetUYaw(void) { return uYaw;}; 767 PidThrust* UavStateMachine::GetUZ(void) { return uZ;}; 768 TrajectoryGenerator1D * UavStateMachine::GetAltitudeTrajectory(void) { return altitudeTrajectory;}; -
trunk/lib/FlairMeta/src/UavStateMachine.h
r167 r206 228 228 const sensor::TargetController *GetJoystick(void) const; 229 229 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); 230 236 231 237 gui::Tab *setupLawTab, *graphLawTab; -
trunk/lib/FlairSensorActuator/src/NmeaGps.cpp
r194 r206 176 176 177 177 int result; 178 //Printf("%s\n",frame); 178 Printf("%s\n",frame); 179 Printf("%x %x\n",&parser,parser.buffer); 179 180 result = nmea_parse(&parser, frame, frame_size, &info); 181 Printf("%x %x\n",&parser,parser.buffer); 180 182 if (result != 1) { 181 183 Warn("unrecognized nmea sentence: %s\n",frame); 182 184 return; 183 185 } 184 186 Printf("3\n"); 187 Printf("%x %x\n",&parser,parser.buffer); 185 188 result = nmea_parse_GPGGA(frame, frame_size, &pack); 186 189 Printf("%x %x\n",&parser,parser.buffer); 187 190 if (result == 1) { 191 Printf("%x %x\n",&parser,parser.buffer); 188 192 nmea_info2pos(&info, &pos); 189 193 Printf("%x %x\n",&parser,parser.buffer); 190 194 // 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); 191 195 //Printf("lat:%f long:%f\n",pos.lat,pos.lon); -
trunk/lib/FlairSensorActuator/src/SimuCamera.cpp
r158 r206 97 97 // échange de pointeur sur 98 98 // double buffering 99 99 100 output->ReleaseMutex(); 100 101 memcpy(&time,shmemReadBuf+buf_size-sizeof(Time),sizeof(Time)); -
trunk/lib/FlairSensorActuator/src/SimuGps.cpp
r170 r206 48 48 fixQuality = new SpinBox(GetGroupBox()->NewRow(), "fix quality", 1, 8, 1, 1); 49 49 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 51 52 shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), 52 53 sizeof(gps_states_t)); … … 152 153 153 154 nmea_gen_GPGGA(buf,sizeof(buf),&gga); 155 Printf("1\n"); 154 156 parseFrame(buf,sizeof(buf)); 155 157 … … 157 159 vtg.spk=sqrtf(state.ve*state.ve+state.vn*state.vn)*3600./1000.; 158 160 nmea_gen_GPVTG(buf,sizeof(buf),&vtg); 161 Printf("2\n"); 159 162 parseFrame(buf,sizeof(buf)); 160 163 } -
trunk/lib/FlairSensorActuator/src/SimuGps.h
r170 r206 99 99 core::SharedMem *shmem; 100 100 gui::SpinBox *dataRate,*fixQuality,*numberOfSatellites; 101 gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef ;101 gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef,*magneticDeclination; 102 102 }; 103 103 } // end namespace sensor
Note:
See TracChangeset
for help on using the changeset viewer.