lib/sgs/navigate.rb in sgslib-1.5.0 vs lib/sgs/navigate.rb in sgslib-1.5.1
- old
+ new
@@ -69,11 +69,30 @@
end
#
# Main daemon function (called from executable)
def self.daemon
- loop do
- sleep 300
+ puts "Navigation system starting up..."
+ #
+ # Load the mission data from Redis and augment it with the
+ # contents of the mission file.
+ config = SGS::Config.load
+ mission = SGS::Mission.file_load config.mission_file
+ #
+ # Now listen for GPS data...
+ SGS::GPS.subscribe do |count|
+ puts "Received new GPS count: #{count}"
+ case SGS::MissionStatus.state
+ when STATE_COMPASS_FOLLOW
+ when STATE_WIND_FOLLOW
+ mission.navigate
+ when STATE_COMPLETE
+ when STATE_TERMINATED
+ when STATE_FAILURE
+ mission.hold_station
+ end
+ gps = SGS::GPS.load
+ p gps
end
end
#
# What is the mode name?