-
-
Save crosvera/190f0e6b0b84e21793b3ef41f35afa95 to your computer and use it in GitHub Desktop.
Trying to get the current device angles.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mscl | |
tty = "/dev/ttyACM0" | |
print tty | |
connection = mscl.Connection.Serial(tty, 921600) | |
node = mscl.InertialNode(connection) | |
success = node.ping() | |
print "Ping", success | |
print "Set to idle", node.setToIdle() | |
chs = mscl.InertialChannels() | |
chs.append(mscl.InertialChannel(mscl.InertialTypes.CH_FIELD_SENSOR_SCALED_ACCEL_VEC, | |
mscl.SampleRate.Hertz(1))) | |
chs.append(mscl.InertialChannel(mscl.InertialTypes.CH_FIELD_SENSOR_DELTA_THETA_VEC, | |
mscl.SampleRate.Hertz(1))) | |
node.setActiveChannelFields(mscl.InertialTypes.CATEGORY_SENSOR, chs) | |
node.enableDataStream(mscl.InertialTypes.CATEGORY_SENSOR) | |
while True: | |
packets = node.getDataPackets(500) | |
for packet in packets: | |
print packet.descriptorSet(), packet.timestamp() | |
points = packet.data() | |
for d in points: | |
print d.channelName(), d.as_string() #d.as_float() | |
#print d.channelName() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment