Exemplo n.º 1
0
def main():
    if len(sys.argv) < 2:
        print("Serial not specified")
        return

    path = sys.argv[1]
    if not Path(path).exists():
        print("Not found:", sys.argv[1])
        return

    cli = CLI(path)
    print(cli.tx('telemetry'))
    cli.close()
Exemplo n.º 2
0
def read_sensor(cli: CLI, sensor: str) -> numpy.array:
    output = json.loads(cli.tx('telemetry'))
    axes = jsonpath(output, 'sensor.%s.axes' % sensor)[0]
    return numpy.array([axes['x'], axes['y'], axes['z']])
Exemplo n.º 3
0
def get_sensitive(cli: CLI, sensor: str) -> int:
    output = json.loads(cli.tx('telemetry'))
    return jsonpath(output, 'sensor.%s.sensitive' % sensor)[0]
Exemplo n.º 4
0
def get_bias(cli: CLI, sensor: str) -> numpy.array:
    output = yaml.load(cli.tx('show'), Loader=yaml.FullLoader)
    axes = jsonpath(output, 'imu.%s.bias' % sensor)[0]
    return numpy.array([axes['x'], axes['y'], axes['z']])