Skip to content

Instantly share code, notes, and snippets.

@scspaeth
Last active June 7, 2019 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scspaeth/fddfd4dda4826cfad8d79c06e274be7a to your computer and use it in GitHub Desktop.
Save scspaeth/fddfd4dda4826cfad8d79c06e274be7a to your computer and use it in GitHub Desktop.
Forked: Gyroscope.phyphox (phone's sensor) and added integration in editor by following IntegratedAcceleration.phyphox
<phyphox version="1.6" locale="en">
<title>Integrated Gyro</title>
<category>Tools</category>
<description>Get data from the iPhone gyroscope and integrate once to obtain angles of rotation.</description>
<link label="Wiki">http://phyphox.org/wiki/index.php?title=Sensor:_Gyroscope</link>
<link label="x / y / z">http://phyphox.org/sensors/</link>
<icon format="string">IAV</icon>
<translations>
<translation locale="de">
<title>Gyroskop</title>
<category>Sensoren</category>
<description>Rohdaten des Gyroskops auslesen.</description>
<link label="x / y / z">http://phyphox.org/de/unterstutzte-sensoren/</link>
<string original="Gyroscope X">Gyroskop X</string>
<string original="Gyroscope Y">Gyroskop Y</string>
<string original="Gyroscope Z">Gyroskop Z</string>
</translation>
<translation locale="cs">
<title>Gyroskop</title>
<category>Senzory</category>
<description>Zobrazí neupravená data z gyroskopu.</description>
<string original="Graph">Graf</string>
<string original="Gyroscope X">Gyroskop X</string>
<string original="Gyroscope Y">Gyroskop Y</string>
<string original="Gyroscope Z">Gyroskop Z</string>
</translation>
<translation locale="pl">
<title>Żyroskop</title>
<category>Surowe dane</category>
<description>Uzyskaj surowe dane z czujnika żyroskopowego.</description>
<string original="Graph">Wykres</string>
<string original="Gyroscope X">Żyroskop - składowa x</string>
<string original="w (rad/s)">ω (rad/s)</string>
<string original="Gyroscope Y">Żyroskop - składowa y</string>
<string original="w (rad/s)">ω (rad/s)</string>
<string original="Gyroscope Z">Żyroskop - składowa z</string>
<string original="w (rad/s)">ω (rad/s)</string>
</translation>
</translations>
<data-containers>
<container size="0" static="false">gyrX</container>
<container size="0" static="false">gyrY</container>
<container size="0" static="false">gyrZ</container>
<container size="0" static="false">gyr</container>
<container size="0" static="false">gyr_time</container>
<container size="1" static="false">count</container>
<container size="1" static="false">period</container>
<container size="0" static="false">temp</container>
<container size="0" static="false">angX</container>
<container size="0" static="false">temp (1)</container>
<container size="0" static="false">angY</container>
<container size="0" static="false">temp (2)</container>
<container size="0" static="false">angZ</container>
</data-containers>
<input>
<sensor rate="10" average="true" type="gyroscope">
<output component="x">gyrX</output>
<output component="y">gyrY</output>
<output component="z">gyrZ</output>
<output component="t">gyr_time</output>
<output component="abs">gyr</output>
</sensor>
</input>
<output>
</output>
<analysis sleep="0" onUserInput="false">
<count>
<input as="buffer" clear="false">gyrX</input>
<output as="count">count</output>
</count>
<divide>
<input as="dividend" clear="false">gyr_time</input>
<input as="divisor" clear="false">count</input>
<output as="quotient">period</output>
</divide>
<integrate>
<input as="in" clear="false">gyrX</input>
<output as="out">temp</output>
</integrate>
<multiply>
<input as="factor">temp</input>
<input as="factor" clear="false">period</input>
<output as="product">angX</output>
</multiply>
<integrate>
<input as="in" clear="false">gyrY</input>
<output as="out">temp (1)</output>
</integrate>
<multiply>
<input as="factor">temp (1)</input>
<input as="factor" clear="false">period</input>
<output as="product">angY</output>
</multiply>
<integrate>
<input as="in" clear="false">gyrZ</input>
<output as="out">temp (2)</output>
</integrate>
<multiply>
<input as="factor">temp (2)</input>
<input as="factor" clear="false">period</input>
<output as="product">angZ</output>
</multiply>
</analysis>
<views>
<view label="Graph">
<graph label="Gyroscope X" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="true" history="1" labelX="t (s)" labelY="w (rad/s)" logX="false" logY="false" xPrecision="3" yPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" minX="0" maxX="0" minY="0" maxY="0">
<input axis="y">gyrX</input>
<input axis="x">gyr_time</input>
</graph>
<graph label="Gyroscope Y" aspectRatio="2.5" style="lines" lineWidth="1" color="ffff00" partialUpdate="true" history="1" labelX="t (s)" labelY="w (rad/s)" logX="false" logY="false" xPrecision="3" yPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" minX="0" maxX="0" minY="0" maxY="0">
<input axis="y">gyrY</input>
<input axis="x">gyr_time</input>
</graph>
<graph label="Gyroscope Z" aspectRatio="2.5" style="lines" lineWidth="1" color="ff6060" partialUpdate="true" history="1" labelX="t (s)" labelY="w (rad/s)" logX="false" logY="false" xPrecision="3" yPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" minX="0" maxX="0" minY="0" maxY="0">
<input axis="y">gyrZ</input>
<input axis="x">gyr_time</input>
</graph>
</view>
<view label="Angle Graph">
<graph label="Angle X" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="t (s)" labelY="ang (rad)" logX="false" logY="false" xPrecision="3" yPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" minX="0" maxX="0" minY="0" maxY="0">
<input axis="y">angX</input>
<input axis="x">gyr_time</input>
</graph>
<graph label="Angle Y" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="t (s)" labelY="ang (rad)" logX="false" logY="false" xPrecision="3" yPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" minX="0" maxX="0" minY="0" maxY="0">
<input axis="y">angY</input>
<input axis="x">gyr_time</input>
</graph>
<graph label="Angle Z" aspectRatio="2.5" style="lines" lineWidth="1" color="ff7e22" partialUpdate="false" history="1" labelX="t (s)" labelY="ang (rad)" logX="false" logY="false" xPrecision="3" yPrecision="3" scaleMinX="auto" scaleMaxX="auto" scaleMinY="auto" scaleMaxY="auto" minX="0" maxX="0" minY="0" maxY="0">
<input axis="y">angZ</input>
<input axis="x">gyr_time</input>
</graph>
</view>
</views>
<export>
<set name="AngVel & Ang Data">
<data name="Time (s)">gyr_time</data>
<data name="Gyroscope x (rad/s)">gyrX</data>
<data name="Gyroscope y (rad/s)">gyrY</data>
<data name="Gyroscope z (rad/s)">gyrZ</data>
<data name="Angle x (rad)">angX</data>
<data name="Angle y (rad)">angY</data>
<data name="Angle z (rad)">angZ</data>
</set>
</export>
</phyphox>
@scspaeth
Copy link
Author

scspaeth commented Jun 4, 2019

Revison 2 corrects anomalous results for the AngZ in the views of angle graphs. May have unintentionally changed the checked status in the Experiment editor for this calculation. Revised experiment now produces more sensible results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment