Skip to content

Conversation

@BG2EBZ
Copy link

@BG2EBZ BG2EBZ commented Oct 7, 2025

…cation of JSON payload

Proposed change(s)

This PR fixes a decoding issue in server.py for the ROS 2 version of ROS–TCP–Endpoint.

Previously, the line
message_json = data.decode("utf-8")[:-1]
unconditionally removed the last byte of the incoming data.

The fix replaces it with:
message_json = data.decode("utf-8")

Useful links (GitHub issues, JIRA tickets, forum threads, etc.)

Related issue: [ROS2] Proposed fix: unsafe UTF-8 slicing in server.py causes JSON truncation

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Documentation update
  • Other (please describe)

Testing and Verification

The fix was verified using the Quest2ROS application. After applying this change, data were successfully transmitted and parsed between the Meta Quest 2 controllers and the ROS 2 (ROS–TCP Endpoint) over the same local network.

Test Configuration:

  • ROS machine OS + version: [Ubuntu 22.04 LTS, ROS 2 Humble]
  • ROS–Unity communication: [Direct TCP over LAN]

Checklist

  • Ensured this PR is up-to-date with the dev branch
  • Created this PR to target the dev branch
  • Followed the style guidelines as described in the Contribution Guidelines
  • Added tests that prove my fix is effective or that my feature works
  • Updated the Changelog and described changes in the Unreleased section
  • Updated the documentation as appropriate

Other comments

This patch is a minimal bug fix.

@unity-cla-assistant
Copy link

unity-cla-assistant commented Oct 7, 2025

CLA assistant check
All committers have signed the CLA.

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