Skip to content

Commit

Permalink
docs: update docs for migration and example application
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Bacis committed Jun 27, 2023
1 parent b97bf7b commit a735a97
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
38 changes: 38 additions & 0 deletions docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ The application is implemented as a Universal Windows app in C#. To execute the
## SDK Integration

The SDK is integrated in the example application by copying the sdk source and header files into the ```WEART_API_Integration/WEART_SDK``` directory, and adding them to the visual studio project.

In addition, the application project includes the nuget package "Newtonsoft.Json" version 13.0.3, as it is a required dependency of the SDK.

Most of the application code can be found in the ```WEART_API_Integration/MainPage.xaml.cs``` file.

### Connection to Middleware
Expand Down Expand Up @@ -188,4 +191,39 @@ private void AddEffectSample1_Click(object sender, RoutedEventArgs e)
if (_hapticObject.ActiveEffect == null)
_hapticObject.AddEffect(_effect);
}
~~~~~~~~~~~~~

### Raw Sensors Data tracking

In the right section of the window, the application displays the raw data of the different sensors aboard the TouchDIVER.
In particular, it's possible to choose the hand and actuation point from which to visualize:
* Timestamp of the last sample received
* Accelerometer data (on the x,y,z axis)
* Gyroscope data (on the x,y,z axis)
* Time of Flight distance (in mm)

To start receiving raw data, click on the "Start Raw Data" button, and to stop click on the "Stop Raw Data" button.

When it's loaded, the application creates a WeArt.Components.WeArtRawSensorsDataTrackingObject for each pair of (HandSide, ActuationPoint).
When one of the combo boxes values changes, the application adds a callback to the corresponding tracking object.
The callback is responsible for displaying the received sample:

~~~~~~~~~~~~~{.cs}
private void RenderRawDataAsync(SensorData data)
{
Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
Acc_X.Text = data.Accelerometer.X.ToString();
Acc_Y.Text = data.Accelerometer.Y.ToString();
Acc_Y.Text = data.Accelerometer.Z.ToString();
Gyro_X.Text = data.Gyroscope.X.ToString();
Gyro_Y.Text = data.Gyroscope.Y.ToString();
Gyro_Y.Text = data.Gyroscope.Z.ToString();
TimeOfFlight.Text = data.TimeOfFlight.Distance.ToString();
LastSampleTime.Text = data.Timestamp.ToString("yyyy/MM/dd HH:mm:ss.fff");
});
}
~~~~~~~~~~~~~
Binary file modified docs/img/example_app/ExampleApp_Screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ On other systems (e.g. cmake) the procedure might be different.

## Code Migration

The new SDK version is mostly compatible with the older version.
The new SDK version is mostly compatible with the older versions.
The only breaking change introduced relates to the WeArtTexture class, in which the ```VelocityX``` and ```VelocityY``` params has been removed because are not used anymore. The ```VelocityZ``` parameter has been renamed to ```Velocity```, and represents the speed at which the texture vibration is played by the thimble.

## Dependencies
The new SDK version has the following dependencies:
* Newtonsoft.Json version >= 13.0.0 (currently tested with version 13.0.3)

The dependencies can be found and installed by using the nuget package manager.

## Changelog
### Version 1.1 (latest)
### Version 1.2 (latest)
* Add raw sensors data tracking object

### Version 1.1
* Add calibration procedure start/stop and listener
* Add new default tracking message and values for closure
* Add basic effect class for haptic feedback
Expand Down

0 comments on commit a735a97

Please sign in to comment.