Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [RFC]: OpenHaptics protocol #9

Open
leon0399 opened this issue Oct 17, 2022 · 1 comment
Open

[WIP] [RFC]: OpenHaptics protocol #9

leon0399 opened this issue Oct 17, 2022 · 1 comment
Labels

Comments

@leon0399
Copy link
Member

leon0399 commented Oct 17, 2022

Here I am just writing ideas from my mind to future implement in our own protocol, when current protocol from bHaptics when it ceases to meet the needs

OpenHaptics Protocol

Coordinates encoding

Each axis (X and Y) is uint8_t between 0 and 255

Coordinates preview
(0, 0)                                 (128, 0)                                 (255, 0)









(0, 128)                               (128, 128)                               (255, 128)









(0, 255)                               (128, 255)                               (255, 255)

Intensity

Intensity is uint8_t:

0: 0%, 255: 100%

Effects layer

Effect layer is 16 possible values (4 bits - uint8_t << 4)

Proposed Effects layer IDs (WIP)
  • Vibro: 0x0
  • Touch (LRA): 0x1
  • Temperature (Peltier): 0x2
  • Electricity (TENS): 0x3

Body Parts IDs mapping

Every diverging part of the body is separated into Front and Back faces.
Coordinate path has 255 possible values (8 bits - uint8_t)

Proposed Body Parts IDs (WIP)
  • human://chest:
    • human://chest/front: 0x00
    • human://chest/back: 0x01
  • human://arm:
    • human://arm/left: 0x02
    • human://arm/right: 0x03
  • human://forearm:
    • human://forearm/left: 0x04
    • human://forearm/right: 0x05
  • human://hand:
    • human://hand/left:
      • human://hand/left/palm:
        • human://hand/left/palm/front: 0x06
        • human://hand/left/palm/back: 0x07
      • human://hand/left/finger:
        • human://hand/left/finger/thumb: 0x08
        • human://hand/left/finger/index: 0x09
        • human://hand/left/finger/middle: 0x0a
        • human://hand/left/finger/ring: 0x0b
        • human://hand/left/finger/pinky: 0x0c
    • human://hand/right:
      • human://hand/right/palm:
        • human://hand/right/palm/front: 0x0d
        • human://hand/right/palm/back: 0x0e
      • human://hand/right/finger:
        • human://hand/right/finger/thumb: 0x0f
        • human://hand/right/finger/index: 0x10
        • human://hand/right/finger/middle: 0x11
        • human://hand/right/finger/ring: 0x12
        • human://hand/right/finger/pinky: 0x13
  • human://upper_leg:
    • human://upper_leg/left: 0x14
    • human://upper_leg/right: 0x15
  • human://lower_leg:
    • human://lower_leg/left: 0x16
    • human://lower_leg/right: 0x17
  • human://foot:
    • human://foot/left:
      • human://foot/left/top: 0x18
      • human://foot/left/bottom: 0x19
    • human://foot/right:
      • human://foot/right/top: 0x1a
      • human://foot/right/bottom: 0x1b
  • human://neck: 0x1c
  • human://head:
    • human://head/face: 0x1d
    • human://head/back: 0x1e
    • human://head/top: 0x1f
@leon0399 leon0399 pinned this issue Oct 17, 2022
@leon0399
Copy link
Member Author

After some thought, I've decided on the given packet structure:

  • Layer: 4 bits
  • Reserved: 4 bits
  • Body part path: 8 bits
  • Length of the motors values array: 8 bits
  • Array of motors values:
    • Motor coordinate: 16 bits (8 + 8 per X + Y)
    • Motor intensity: 8 bits

Thus:

  • Preamble is 24 bits (3 bytes)
  • Single motor value is 24 bits (3 bytes)

Transition limits

  • With minimal 23 bytes MTU, single transmission is (23 - 3 (preamble)) / 3 (single motor) = 6 motors
  • With default automatic iOS MTU change to 185 bytes is (185 - 3 (preamble)) / 3 (single motor) = 60 motors

Future software can automatically adjust MTU for each device in order to handle every motor change in a single packet (e.g. 20 motors per body part on x40 vest), so MTU for x40 vest might be 3*20 + 3 = 63 bytes

@leon0399 leon0399 added the RFC label Nov 28, 2022
@leon0399 leon0399 changed the title [WIP] [RFC] OpenHaptics protocol [WIP] [RFC]: OpenHaptics protocol Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant