Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
782b13b
feat: add tacthub sdk
westside Jan 25, 2024
a99134d
fix: minor update
westside Jan 26, 2024
f8dde3e
Update README.md
westside Jan 26, 2024
7a86971
fix: remove whitespace
westside Jan 26, 2024
df1be05
feat: remove stop_by_event(), and stop_all()
laeyoung-bhaptics Jan 26, 2024
623c48f
fix: remove reassigned default values
laeyoung-bhaptics Jan 29, 2024
d7ee6db
Update README.md
westside Apr 5, 2024
8f0f86d
feat: add play_dot_mode method
laeyoung-bhaptics Apr 8, 2024
e885442
feat: add play_path_mode method (not working well)
laeyoung-bhaptics Apr 8, 2024
ca38888
feat: update path mode sample and update comments
laeyoung-bhaptics Apr 9, 2024
5fe060a
Merge pull request #6 from bhaptics/feat/dot-and-path-mode
Laeyoung Apr 9, 2024
da657b9
Update README.md
laeyoung-bhaptics Apr 9, 2024
6f36eea
feat: make readme more readable
auejin-bhaptics Apr 9, 2024
f3c0ed5
Merge pull request #7 from bhaptics/feat/tacthub-update-readme
auejin-bhaptics Apr 9, 2024
b39153b
refactor: tcp_client, udp_server
auejin-bhaptics Apr 16, 2024
c5c08c3
refactor: haptic_player
auejin-bhaptics Apr 16, 2024
0e72c40
feat: implement ping loop
auejin-bhaptics Apr 17, 2024
ee3b979
chore: change marker when event is finished
auejin-bhaptics Apr 17, 2024
857fb8b
Merge pull request #8 from bhaptics/feat/tacthub-refactor
auejin-bhaptics Apr 17, 2024
75f372d
fix: bug of not starting the ping thread
auejin-bhaptics Apr 17, 2024
9668de0
Merge pull request #9 from bhaptics/fix/tacthub-py-ping
auejin-bhaptics Apr 18, 2024
d4af197
feat: send client sdk version info to hub app
auejin-bhaptics Apr 22, 2024
06176d0
Merge pull request #10 from bhaptics/feat/version-1.0.0
auejin-bhaptics Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CenterX.tact

This file was deleted.

1 change: 0 additions & 1 deletion Circle.tact

This file was deleted.

62 changes: 56 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,60 @@
### Sample code for python
# Python SDK for bHaptics Hub

### Prerequisite
* bHaptics Player has to be installed (Windows)
* The app can be found in
bHaptics webpage: [http://www.bhaptics.com](http://bhaptics.com/)
## Prerequisites
- One or more bHaptics TactSuit devices (e.g., X40, X16).
- A mobile device with bHaptics Hub App ([Android](https://bit.ly/bhaptics-hub-android)) installed.
- A haptic project deployed in [bHaptics Developer Portal](https://developer.bhaptics.com/).
- [How to Create Projects](#how-to-create-projects)

### Conditions
- Tested under Python 3.9

### Dependencies
* websocket-client
- requests

## Getting started
1. Connect a mobile device and a desktop to the network under the same Wi-Fi.
2. Clone this repository on your desktop and install the required dependencies inside the directory.
```bash
pip3 install -r requirements.txt
```
3. Install bHaptics Hub App on your mobile device - [Android](https://bit.ly/bhaptics-hub-android).
4. Connect your TactSuit with bHaptics Hub App - [bHaptics Hub Guide](https://bit.ly/bHaptics-Hub-Guide).
5. Press the start button on the app.
6. Run the sample code inside your desktop.
```bash
python3 sample.py
```

## Example
This example demonstrates how to use the bHaptics SDK with Python:

```python
import time
from bhaptics.haptic_player import BhapticsSDK2

sdk_instance = None

if __name__ == '__main__':
# Replace `yourAppId` and `yourApiKey` with values of your own project
appId = "yourAppId"
apiKey = "yourApiKey"
sdk_instance = BhapticsSDK2(appId, apiKey)
try:
while True:
time.sleep(5)
# Replace `shoot_test` with event name of your own project
sdk_instance.play_event("shoot_test")
except KeyboardInterrupt:
print("Stopping the client...")
sdk_instance.stop()

```

## How to Create Projects
- Visit [bHaptics Developer Portal](https://developer.bhaptics.com/).
- Create your own project with one or more haptic patterns: [refer to this guide for details](https://bhaptics.notion.site/Create-haptic-events-using-bHaptics-Developer-Portal-b056c5a56e514afeb0ed436873dd87c6).
- Save the haptic patterns and deploy the project.
- Go to Settings page and check the `appId` and `apiKey` of your project.
- Update the `appId` and `apiKey` in the code with your project.

157 changes: 0 additions & 157 deletions bhaptics/better_haptic_player.py

This file was deleted.

Loading