Skip to content

Instantly share code, notes, and snippets.

@scspaeth
Last active June 3, 2019 14:50
Show Gist options
  • Save scspaeth/ea830632a91ebafed087ab7cec1c5184 to your computer and use it in GitHub Desktop.
Save scspaeth/ea830632a91ebafed087ab7cec1c5184 to your computer and use it in GitHub Desktop.
Two PLOne running synchronously: Fork of PLOneGyro.phyphox to make multi-sensor
<phyphox version="1.7">
<title>Gyroscope</title>
<category>PocketLab One</category>
<description>Connect to and read gyroscopes of two PocketLab One sensors A and B.
Convert raw sensor readings to Angular Velocity in rad/s.
Forked from TI SensorTag Gyroscope.phyphox
</description>
<data-containers>
<container size="0">gyrXRawA</container>
<container size="0">gyrYRawA</container>
<container size="0">gyrZRawA</container>
<container size="0">gyrXCalA</container>
<container size="0">gyrYCalA</container>
<container size="0">gyrZCalA</container>
<container size="0">tA</container>
<container size="1">countA</container>
<container size="1">tmaxA</container>
<container size="0">gyrXRawB</container>
<container size="0">gyrYRawB</container>
<container size="0">gyrZRawB</container>
<container size="0">gyrXCalB</container>
<container size="0">gyrYCalB</container>
<container size="0">gyrZCalB</container>
<container size="0">tB</container>
<container size="1">countB</container>
<container size="1">tmaxB</container>
</data-containers>
<input>
<bluetooth name="MS-PL" mode="notification" id="Sensor A's Angular Velocities">
<config char="F000AA53-0451-4000-B000-000000000000" conversion="hexadecimal">0A</config> <!-- Measurement period n*10msec -->
<config char="F000AA52-0451-4000-B000-000000000000" conversion="hexadecimal">07</config> <!-- Axis select bit1:x bit2:y bit3:z -->
<output char="F000AA51-0451-4000-B000-000000000000" conversion="int16LittleEndian" offset="0">gyrXRawA</output>
<output char="F000AA51-0451-4000-B000-000000000000" conversion="int16LittleEndian" offset="2">gyrYRawA</output>
<output char="F000AA51-0451-4000-B000-000000000000" conversion="int16LittleEndian" offset="4">gyrZRawA</output>
</bluetooth>
<bluetooth name="MS-PL" mode="notification" id="Sensor B's Angular Velocities">
<config char="F000AA53-0451-4000-B000-000000000000" conversion="hexadecimal">0A</config> <!-- Measurement period n*10msec -->
<config char="F000AA52-0451-4000-B000-000000000000" conversion="hexadecimal">07</config> <!-- Axis select bit1:x bit2:y bit3:z -->
<output char="F000AA51-0451-4000-B000-000000000000" conversion="int16LittleEndian" offset="0">gyrXRawB</output>
<output char="F000AA51-0451-4000-B000-000000000000" conversion="int16LittleEndian" offset="2">gyrYRawB</output>
<output char="F000AA51-0451-4000-B000-000000000000" conversion="int16LittleEndian" offset="4">gyrZRawB</output>
</bluetooth>
</input>
<views>
<view label="Angular Velocity Data Sensor A">
<graph label="Angular velocity X" labelX="tA: time" unitX="s" labelY="gyrXCalA: ω" unitY="rad/s" partialUpdate="true">
<input axis="x">tA</input>
<input axis="y">gyrXCalA</input>
</graph>
<graph label="Angular velocity Y" labelX="tA: time" unitX="s" labelY="gyrYCalA: ω" unitY="rad/s" partialUpdate="true">
<input axis="x">tA</input>
<input axis="y">gyrYCalA</input>
</graph>
<graph label="Angular velocity Z" labelX="tA: time" unitX="s" labelY="gryZCalA: ω" unitY="rad/s" partialUpdate="true">
<input axis="x">tA</input>
<input axis="y">gyrZCalA</input>
</graph>
</view>
<view label="Angular Velocity Data Sensor B">
<graph label="Angular velocity X" labelX="tB: time" unitX="s" labelY="gyrXCalB: ω" unitY="rad/s" partialUpdate="true">
<input axis="x">tB</input>
<input axis="y">gyrXCalB</input>
</graph>
<graph label="Angular velocity Y" labelX="tB: time" unitX="s" labelY="gyrYCalB: ω" unitY="rad/s" partialUpdate="true">
<input axis="x">tB</input>
<input axis="y">gyrYCalB</input>
</graph>
<graph label="Angular velocity Z" labelX="tB: time" unitX="s" labelY="gryZCalB: ω" unitY="rad/s" partialUpdate="true">
<input axis="x">tB</input>
<input axis="y">gyrZCalB</input>
</graph>
</view>
</views>
<analysis optimization="true">
<multiply>
<input clear="false">gyrXRawA</input>
<input type="value">0.001065264</input> <!-- 2000 * 2*pi / 360 / 32768 -->
<output clear="true">gyrXCalA</output>
</multiply>
<multiply>
<input clear="false">gyrYRawA</input>
<input type="value">0.001065264</input>
<output clear="true">gyrYCalA</output>
</multiply>
<multiply>
<input clear="false">gyrZRawA</input>
<input type="value">0.001065264</input>
<output clear="true">gyrZCalA</output>
</multiply>
<count>
<input clear="false">gyrXRawA</input>
<output>countA</output>
</count>
<formula formula="([1]-1)*0.1">
<input clear="false">countA</input>
<output>tmaxA</output>
</formula>
<ramp>
<input as="start" type="value">0</input>
<input as="stop">tmaxA</input>
<input as="length">countA</input>
<output>tA</output>
</ramp>
<multiply>
<input clear="false">gyrXRawB</input>
<input type="value">0.001065264</input> <!-- 2000 * 2*pi / 360 / 32768 -->
<output clear="true">gyrXCalB</output>
</multiply>
<multiply>
<input clear="false">gyrYRawB</input>
<input type="value">0.001065264</input>
<output clear="true">gyrYCalB</output>
</multiply>
<multiply>
<input clear="false">gyrZRawB</input>
<input type="value">0.001065264</input>
<output clear="true">gyrZCalB</output>
</multiply>
<count>
<input clear="false">gyrXRawB</input>
<output>countB</output>
</count>
<formula formula="([1]-1)*0.1">
<input clear="false">countB</input>
<output>tmaxB</output>
</formula>
<ramp>
<input as="start" type="value">0</input>
<input as="stop">tmaxB</input>
<input as="length">countB</input>
<output>tB</output>
</ramp>
</analysis>
<export>
<set name="Gyroscope">
<data name="Time (s)A">tA</data>
<data name="Angular velocity x (rad/s)A">gyrXCalA</data>
<data name="Angular velocity y (rad/s)A">gyrYCalA</data>
<data name="Angular velocity z (rad/s)A">gyrZCalA</data>
<data name="Time (s)B">tB</data>
<data name="Angular velocity x (rad/s)B">gyrXCalB</data>
<data name="Angular velocity y (rad/s)B">gyrYCalB</data>
<data name="Angular velocity z (rad/s)B">gyrZCalB</data>
</set>
</export>
</phyphox>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment