Tuesday, February 17, 2015

February 17, 2015

Overview:

Continuing from yesterday's problems, we are unsure on how to make the GPS spit out lattitude and longitude in the NMEA data. We reinstated the settings in the GPS based on the profmason website for ucenter in hopes that would fix the bad GPS data, where the latitude and longitude are constantly the same value. 

After trying to run RobotControlBuilder2.py and other various modules, it seems that our python code was not reading our modules. For example, plugging in the IMU directly and running the IMUmodule.py, the output would be that the IMU was not started and only sometimes output a value of 2.0 instead of ("IMU, cannot be started"). In Arduino however, I was able to see all the raw values in the serial monitor. This meant this new problem was due to threadedserial, which had been modified last Friday (Feb. 13).

class ThreadedSerial( threading.Thread ):
    def __init__( self, module, serialPort, baud, command = 0 ):
        super(ThreadedSerial, self).__init__()
        self.name = module
        self.data = 'No Data'
        self.vars = {'reading':0}
        self._vars = {'running':0,'working':0,'override':0,'interrupt':0,'writing':0}
        self.vars['command'] = command
        self.ser = serial.Serial( None, baud, timeout = .1 )
        self.ser.port = serialPort - 1
        self.openPort( )

 The issue was "self.ser.port = serialPort - 1," which while trying to run did not have the "- 1" included. After adding the -1 back into the code, all our modules worked again.

No comments:

Post a Comment