The kernel drivers for HY-SRF05, MPU-9250 and all servos are misc devices. The misc devices for the two servos create a file where the sensor data can be read. Therefore a structure is defined for each sensor so the data can be easily in the userspace. The servo driver creates two misc devices where both files can be written. One file is used to set all servos to a fixed position. The second file is used to calibrate the servos. For each file exists a structure that has to be used to write the files.

  • Sampling Frequency 10 Hz
  • Stores read values in an internal FIFO
  • Userspace (Server) can simply access FIFO and send Data via TCP Protocol:
  • #!/usr/bin/Python
    
    with open("/dev/hy-srf05", "rb") as f
        data = f.read(self._HYS_DATA_SIZE)
    message = Protocol.Command().createFromTLV(Protocol.Tag.GetHeight,data).getTransmission()
    self.com.write(message)
  • Sampling Frequency 10Hz
  • Stores read values in an internal FIFO
  • Userspace (Server) can simply access FIFO and send Data via TCP Protocol:
  • #!/usr/bin/Python
    
    with open("/dev/mpu9250_poll", "rb") as f:
        data = f.read(self._MPU_DATA_SIZE)
    message = Protocol.Command().createFromTLV(Protocol.Tag.GetCoord,data).getTransmission()
    self.com.write(message)
  • Calibrates servo motors
  • Sets initial positions of the servo motors