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

feature(ProTubeVR): add compatibility for auxiliary haptics #76

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

leon0399
Copy link
Member

@leon0399 leon0399 commented Aug 7, 2023

Close #51

@leon0399 leon0399 marked this pull request as draft August 7, 2023 13:25
@github-actions
Copy link

github-actions bot commented Aug 7, 2023

Coverage after merging feature/protubevt-compat into develop

39.53%

@leon0399
Copy link
Member Author

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

PR Analysis

  • 🎯 Main theme: Adding compatibility for auxiliary haptics in ProTubeVR.
  • 📝 PR summary: This PR introduces compatibility for auxiliary haptics in ProTubeVR. It includes a proof-of-concept sketch that sets up Bluetooth communication, defines pin configurations, and handles incoming Bluetooth commands to trigger haptic feedback.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 3
    The PR is moderately complex as it involves Bluetooth communication and haptic feedback handling. However, the code is well-structured and should be relatively straightforward to review for someone familiar with the ESP32 and Bluetooth communication.
  • 🔒 Security concerns: No
    The PR does not seem to introduce any obvious security concerns. However, it's always a good idea to ensure that Bluetooth communications are secure and that the device can't be controlled by unauthorized devices.

PR Feedback

  • 💡 General suggestions: It would be beneficial to handle potential errors and edge cases in the Bluetooth communication and haptic feedback handling. Additionally, consider refactoring the code to improve modularity and readability.

  • 🤖 Code feedback:

    • relevant file: examples/poc-protubevr-compat/poc-protubevr-compat.ino
      suggestion: Consider handling the case where the Bluetooth connection is not available or gets interrupted. This could be done by adding error handling code in the btCallback function. [important]
      relevant line: void btCallback(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) {

    • relevant file: examples/poc-protubevr-compat/poc-protubevr-compat.ino
      suggestion: The generateSN function could potentially run indefinitely if no suitable serial number is found. Consider adding a limit to the number of iterations. [important]
      relevant line: const uint32_t generateSN(const uint32_t i) {

    • relevant file: examples/poc-protubevr-compat/poc-protubevr-compat.ino
      suggestion: The simpleMap function could be made more generic by also taking in_min and out_min parameters. This would allow it to handle ranges that don't start at 0. [medium]
      relevant line: constexpr inline _Tp simpleMap(_Tp x, _Tp in_max, _Tp out_max) {

    • relevant file: examples/poc-protubevr-compat/poc-protubevr-compat.ino
      suggestion: The loop function is quite long and handles multiple responsibilities. Consider breaking it down into smaller, more focused functions. [medium]
      relevant line: void loop() {

How to use

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.75%. Comparing base (1c6b8f5) to head (ae3f22c).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #76   +/-   ##
========================================
  Coverage    42.75%   42.75%           
========================================
  Files           35       35           
  Lines          877      877           
========================================
  Hits           375      375           
  Misses         502      502           
Flag Coverage Δ
unittests 42.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@leon0399 leon0399 force-pushed the feature/protubevt-compat branch from 5c2b956 to ae3f22c Compare August 11, 2024 16:27
Copy link

Memory Usage Comparison

Click to expand
Variant RAM, % RAM, bytes Flash, % Flash, bytes
bhaptics_tactal+battery 🆗 10.6 🆗 34744 🆗 49.3 🆗 645897
bhaptics_tactglove_right+battery 🆗 10.6 🆗 34744 🆗 49.3 🆗 646449
bhaptics_tactosy2_forearm_right+battery 🆗 10.6 🆗 34744 🆗 49.3 🆗 646101
bhaptics_tactosyf_foot_right+battery 🆗 10.6 🆗 34744 🆗 49.3 🆗 646001
bhaptics_tactosyh_hand_right+battery 🆗 10.6 🆗 34744 🆗 49.3 🆗 646001
bhaptics_tactsuit_x16+battery 🆗 10.6 🆗 34744 🆗 49.4 🆗 647109
bhaptics_tactsuit_x16_pca9685+battery 🆗 10.7 🆗 35000 🆗 51.0 🆗 668385
bhaptics_tactsuit_x40+battery 🆗 10.7 🆗 35104 🆗 51.8 🆗 678801
bhaptics_tactvisor+battery 🆗 10.6 🆗 34744 🆗 49.3 🆗 645853
opengloves_indexer_c+serial 🆗 6.2 🆗 20432 🆗 24.9 🆗 326421
opengloves_indexer_cf+serial 🆗 6.3 🆗 20624 🆗 26.7 🆗 350529
opengloves_indexer_cs+serial 🆗 6.2 🆗 20432 🆗 25.0 🆗 327825
opengloves_indexer_csf+serial 🆗 6.3 🆗 20624 🆗 26.8 🆗 351865
opengloves_lucidgloves_proto3+serial 🆗 6.2 🆗 20432 🆗 24.9 🆗 326281
opengloves_lucidgloves_proto4+serial 🆗 6.2 🆗 20432 🆗 24.9 🆗 326421
opengloves_lucidgloves_proto4_ffb+ble 🆗 10.7 🆗 34944 🆗 50.5 🆗 662389
opengloves_lucidgloves_proto4_ffb+bluetooth 🆗 12.2 🆗 39820 🆗 88.7 🆗 1162549
opengloves_lucidgloves_proto4_ffb+serial 🆗 6.3 🆗 20624 🆗 26.7 🆗 350545

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants