sergei / ottopi

Otto the autopilot
Other
1 stars 0 forks source link

Crash when COG is not available #5

Closed sergei closed 3 years ago

sergei commented 3 years ago
Feb 22 15:19:36 ottopi ottopi[524]: Traceback (most recent call last):
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/main.py", line 180, in <module>
Feb 22 15:19:36 ottopi ottopi[524]:     main(parser.parse_args())
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/main.py", line 164, in main
Feb 22 15:19:36 ottopi ottopi[524]:     received_data = read_interface.read()
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/nmea_interface.py", line 83, in read
Feb 22 15:19:36 ottopi ottopi[524]:     self.set_nmea_data(data)
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/nmea_interface.py", line 121, in set_nmea_data
Feb 22 15:19:36 ottopi ottopi[524]:     self.nmea_parser.set_nmea_sentence(self.nmea_sentence)
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/nmeaparser.py", line 73, in set_nmea_sentence
Feb 22 15:19:36 ottopi ottopi[524]:     self.parse_rmc(t)
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/nmeaparser.py", line 159, in parse_rmc
Feb 22 15:19:36 ottopi ottopi[524]:     self.set_raw_instr_data()
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/nmeaparser.py", line 191, in set_raw_instr_data
Feb 22 15:19:36 ottopi ottopi[524]:     aws=aws, twa=twa, tws=tws, sow=sow, hdg=hdg))
Feb 22 15:19:36 ottopi ottopi[524]:   File "/home/pi/ottopi/navcomputer/navigator.py", line 151, in set_raw_instr_data
Feb 22 15:19:36 ottopi ottopi[524]:     dest_info.atw = course_true - raw_instr_data.cog  # Both angles are true
Feb 22 15:19:36 ottopi ottopi[524]: TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
sergei commented 3 years ago

Fixed while on boat.