def __init__(self): super(CalibrationDialog, self).__init__(None) self.host = '' if len(sys.argv) > 1: self.host = sys.argv[1] self.client = False self.accel_calibration_plot = calibration_plot.AccelCalibrationPlot() self.accel_calibration_glContext = wx.glcanvas.GLContext( self.AccelCalibration) self.compass_calibration_plot = calibration_plot.CompassCalibrationPlot( ) self.compass_calibration_glContext = wx.glcanvas.GLContext( self.CompassCalibration) self.boat_plot = boatplot.BoatPlot() self.boat_plot_glContext = wx.glcanvas.GLContext(self.BoatPlot) self.dsServoMaxCurrent.SetIncrement(.1) self.dsServoMaxCurrent.SetDigits(1) self.dsServoMaxCurrent.Bind(wx.EVT_SPINCTRLDOUBLE, self.onMaxCurrent) self.lastmouse = False self.alignment_count = 0 self.timer = wx.Timer(self, self.ID_MESSAGES) self.timer.Start(50) self.Bind(wx.EVT_TIMER, self.receive_messages, id=self.ID_MESSAGES) self.heading_offset_timer = wx.Timer(self, self.ID_HEADING_OFFSET) self.Bind(wx.EVT_TIMER, lambda e: self.sHeadingOffset.SetValue( round3(self.signalk_heading_offset)), id=self.ID_HEADING_OFFSET) self.servo_timer = wx.Timer(self, self.ID_CALIBRATE_SERVO) self.Bind(wx.EVT_TIMER, self.calibrate_servo_timer, id=self.ID_CALIBRATE_SERVO) self.servoprocess = False self.alignmentQ = [1, 0, 0, 0] self.fusionQPose = [1, 0, 0, 0]
def __init__(self): super(CalibrationDialog, self).__init__(None) self.host = '' if len(sys.argv) > 1: self.host = sys.argv[1] self.client = False self.accel_calibration_plot = calibration_plot.AccelCalibrationPlot() self.accel_calibration_glContext = wx.glcanvas.GLContext( self.AccelCalibration) self.compass_calibration_plot = calibration_plot.CompassCalibrationPlot( ) self.compass_calibration_glContext = wx.glcanvas.GLContext( self.CompassCalibration) self.boat_plot = boatplot.BoatPlot() self.boat_plot_glContext = wx.glcanvas.GLContext(self.BoatPlot) self.lastmouse = False self.alignment_count = 0 self.timer = wx.Timer(self, self.ID_MESSAGES) self.timer.Start(50) self.Bind(wx.EVT_TIMER, self.receive_messages, id=self.ID_MESSAGES) self.heading_offset_timer = wx.Timer(self, self.ID_HEADING_OFFSET) self.Bind(wx.EVT_TIMER, lambda e: self.sHeadingOffset.SetValue( round3(self.pypilot_heading_offset)), id=self.ID_HEADING_OFFSET) self.have_rudder = False self.fusionQPose = [1, 0, 0, 0] self.alignmentQ = [1, 0, 0, 0] self.controltimes = {} self.client = pypilotClient(self.host) # clear out plots self.accel_calibration_plot.points = [] self.compass_calibration_plot.points = [] self.settings = {} self.set_watches()
def __init__(self): super(CalibrationDialog, self).__init__(None) self.host = '' if len(sys.argv) > 1: self.host = sys.argv[1] self.client = False self.accel_calibration_plot = calibration_plot.AccelCalibrationPlot() self.accel_calibration_glContext = wx.glcanvas.GLContext( self.AccelCalibration) self.compass_calibration_plot = calibration_plot.CompassCalibrationPlot( ) self.compass_calibration_glContext = wx.glcanvas.GLContext( self.CompassCalibration) self.boat_plot = boatplot.BoatPlot() self.boat_plot_glContext = wx.glcanvas.GLContext(self.BoatPlot) self.dsServoMaxCurrent.SetIncrement(.1) self.dsServoMaxCurrent.SetDigits(1) self.dsServoMaxCurrent.Bind(wx.EVT_SPINCTRLDOUBLE, self.onMaxCurrent) self.dsServoMaxControllerTemp.SetRange(45, 100) self.dsServoMaxControllerTemp.Bind(wx.EVT_SPINCTRL, self.onMaxControllerTemp) self.dsServoMaxMotorTemp.SetRange(30, 100) self.dsServoMaxMotorTemp.Bind(wx.EVT_SPINCTRL, self.onMaxMotorTemp) self.dsServoCurrentFactor.SetRange(.8, 1.2) self.dsServoCurrentFactor.SetIncrement(.0016) self.dsServoCurrentFactor.SetDigits(4) self.dsServoCurrentFactor.Bind(wx.EVT_SPINCTRLDOUBLE, self.onCurrentFactor) self.dsServoCurrentOffset.SetRange(-1.2, 1.2) self.dsServoCurrentOffset.SetIncrement(.01) self.dsServoCurrentOffset.SetDigits(2) self.dsServoCurrentOffset.Bind(wx.EVT_SPINCTRLDOUBLE, self.onCurrentOffset) self.dsServoVoltageFactor.SetRange(.8, 1.2) self.dsServoVoltageFactor.SetIncrement(.0016) self.dsServoVoltageFactor.SetDigits(4) self.dsServoVoltageFactor.Bind(wx.EVT_SPINCTRLDOUBLE, self.onVoltageFactor) self.dsServoVoltageOffset.SetRange(-1.2, 1.2) self.dsServoVoltageOffset.SetIncrement(.01) self.dsServoVoltageOffset.SetDigits(2) self.dsServoVoltageOffset.Bind(wx.EVT_SPINCTRLDOUBLE, self.onVoltageOffset) self.dsServoMaxSlewSpeed.SetRange(0, 100) self.dsServoMaxSlewSpeed.Bind(wx.EVT_SPINCTRL, self.onMaxSlewSpeed) self.dsServoMaxSlewSlow.SetRange(0, 100) self.dsServoMaxSlewSlow.Bind(wx.EVT_SPINCTRL, self.onMaxSlewSlow) self.dsServoGain.SetIncrement(.1) self.dsServoGain.SetDigits(1) self.dsServoGain.Bind(wx.EVT_SPINCTRLDOUBLE, self.onServoGain) self.lastmouse = False self.alignment_count = 0 self.timer = wx.Timer(self, self.ID_MESSAGES) self.timer.Start(50) self.Bind(wx.EVT_TIMER, self.receive_messages, id=self.ID_MESSAGES) self.heading_offset_timer = wx.Timer(self, self.ID_HEADING_OFFSET) self.Bind(wx.EVT_TIMER, lambda e: self.sHeadingOffset.SetValue( round3(self.signalk_heading_offset)), id=self.ID_HEADING_OFFSET) self.servo_timer = wx.Timer(self, self.ID_CALIBRATE_SERVO) self.Bind(wx.EVT_TIMER, self.calibrate_servo_timer, id=self.ID_CALIBRATE_SERVO) self.request_msg_timer = wx.Timer(self, self.ID_REQUEST_MSG) self.Bind(wx.EVT_TIMER, self.request_msg, id=self.ID_REQUEST_MSG) self.request_msg_timer.Start(200) self.servoprocess = False self.alignmentQ = [1, 0, 0, 0] self.fusionQPose = [1, 0, 0, 0]