Changeset 19436
- Timestamp:
- 02/05/19 16:01:50 (6 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/HeadersDrive.h
r18804 r19436 19 19 kParking, 20 20 kMoving, 21 kApproaching, 21 22 kTracking, 22 23 kOnTrack, -
trunk/FACT++/src/drivectrl.cc
r19416 r19436 1625 1625 uint16_t fDeviationMax; 1626 1626 1627 float fApproachingLimit; 1628 1627 1629 vector<double> fDevBuffer; 1628 1630 uint64_t fDevCount; … … 2562 2564 if (fDrive.HasWarning() || fDrive.HasError()) 2563 2565 { 2564 if (T::GetCurrentState()==State::kOnTrack || 2565 T::GetCurrentState()==State::kTracking || 2566 T::GetCurrentState()==State::kMoving || 2566 if (T::GetCurrentState()==State::kOnTrack || 2567 T::GetCurrentState()==State::kTracking || 2568 T::GetCurrentState()==State::kMoving || 2569 T::GetCurrentState()==State::kApproaching || 2567 2570 T::GetCurrentState()==State::kParking) 2568 2571 return StopMovement(); … … 2640 2643 return State::kArmed; 2641 2644 2642 if ((T::GetCurrentState()==State::kMoving || 2645 if ((T::GetCurrentState()==State::kMoving || T::GetCurrentState()==State::kApproaching || 2643 2646 T::GetCurrentState()==State::kParking) && !fDrive.IsMoving()) 2644 2647 { … … 2730 2733 } 2731 2734 2735 if (T::GetCurrentState()==State::kMoving && fDrive.IsMoving() && fIsTracking) 2736 { 2737 // First calculate deviation between 2738 // command position and nominal position 2739 //fPointing.mount = sepos; // [deg] ref pos for alignment 2740 const PointingData data = CalcPointingPos(fDrive.GetSeTime()); 2741 2742 // Get current position and calculate deviation 2743 const Encoder sepos = fDrive.GetSePos()*360; // [deg] 2744 const Encoder dev = sepos - data.mount; 2745 2746 // Calculate absolut deviation on the sky 2747 const double absdev = GetDevAbs(data.mount.zd, sepos.zd, dev.az); 2748 2749 if (absdev<fApproachingLimit) 2750 return State::kApproaching; 2751 } 2752 2732 2753 return T::GetCurrentState()>=State::kInitialized ? 2733 2754 T::GetCurrentState() : State::kInitialized; … … 2772 2793 T::AddStateName(State::kMoving, "Moving", 2773 2794 "Telescope moving"); 2795 T::AddStateName(State::kApproaching, "Approaching", 2796 "Telescope approaching destination"); 2774 2797 T::AddStateName(State::kTracking, "Tracking", 2775 2798 "Telescope in tracking mode"); … … 2877 2900 2878 2901 // FIXME: What to do in error state? 2879 T::AddEvent("PARK" , State::kInitialized, State::kMoving, State::kTracking, State::kOnTrack,State::kHardwareWarning)2902 T::AddEvent("PARK")(State::kInitialized)(State::kMoving)(State::kApproaching)(State::kTracking)(State::kOnTrack)(State::kHardwareWarning) 2880 2903 (bind(&StateMachineDrive::Park, this)) 2881 2904 ("Park the telescope"); 2882 2905 2883 T::AddEvent("STOP")(State::kUnavailable)(State::kAvailable)(State::kArmed)(State::kInitialized)(State::kStopping)(State::kParking)(State::kMoving)(State::k Tracking)(State::kOnTrack)2906 T::AddEvent("STOP")(State::kUnavailable)(State::kAvailable)(State::kArmed)(State::kInitialized)(State::kStopping)(State::kParking)(State::kMoving)(State::kApproaching)(State::kTracking)(State::kOnTrack) 2884 2907 (bind(&StateMachineDrive::StopMovement, this)) 2885 2908 ("Stop any kind of movement."); … … 3043 3066 return 4; 3044 3067 } 3068 3069 fApproachingLimit = conf.Get<float>("approaching-limit"); 3045 3070 3046 3071 fDeviationLimit = conf.Get<uint16_t>("deviation-limit"); … … 3159 3184 ("acceleration.max.zd", var<double>(0.09), "Maximum allowed acceleration value for zenith axis") 3160 3185 ("weather-timeout", var<uint16_t>(300), "Timeout [sec] for weather data (after timeout default values are used)") 3186 ("approaching-limit", var<float>(2.25), "Limit to get 'Approaching' state") 3161 3187 ("deviation-limit", var<uint16_t>(90), "Deviation limit in arcsec to get 'OnTrack'") 3162 3188 ("deviation-count", var<uint16_t>(3), "Minimum number of reported deviation below deviation-limit to get 'OnTrack'")
Note:
See TracChangeset
for help on using the changeset viewer.