phetsims / quadrilateral

"Quadrilateral" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

branch: calibration #18

Open jessegreenberg opened 2 years ago

jessegreenberg commented 2 years ago

A branch to test a way to calibrate the sim to a physical device.

jessegreenberg commented 2 years ago

On this branch we have a prototype for calibrating the device to sim model space and controlling vertex positions from angle/length data from the device.

For the calibration we ask the user to create the largest shape possible and take a snapshot of physical lengths in that configuration. We use those lengths to create a linear function to map physical space into model space.

For the control, a function was added to turn angle/length data into positions of vertices. It works by anchoring the top side horizontally and then centering the shape around the of model space.

https://phet-dev.colorado.edu/html/jg-tests/quadrilateral/calibration-demo-1/quadrilateral-calibration-demo.html

jessegreenberg commented 2 years ago

It works OK but it is unfortunate that we have no knowledge of which side moves or the orientation of the device. We discussed in meeting today that we may add a gyroscope or other sensors to have the sim model more accurately match the physical model.

jessegreenberg commented 2 years ago

Scott and I were able to get this working well with the current quadrilateral device today.