Files
acRealman_xr/unity/XR_RM_PICO_UDP_Sender/README.md

2.3 KiB
Executable File

XR-RM PICO UDP Sender

Minimal Unity project for the direct PICO 4 Ultra UDP route in docs/pico4_ultra_udp_teleop_setup.md.

Configured target:

Host = 192.168.9.99
Port = 15000
Send Hz = 90
Convert Unity To Project Coordinates = true
Package Name = com.local.xr_rm_udp_sender

The default send rate is 90 Hz. If the network or headset performance is not stable enough on site, lower it manually in the PICO panel to 60 Hz.

Open this folder with the Ubuntu editor installed at:

/home/robot/Unity/Hub/Editor/2022.3.62f3c1/Editor/Unity

Install Android Build Support, Android SDK/NDK, and OpenJDK from Unity Hub.

The PICO SDK is referenced from the sibling folder:

../PICO-Unity-Integration-SDK-release_3.4.0

After opening the project:

  1. Wait for Unity Package Manager to import PICO Integration 3.4.0.
  2. Run XR-RM -> Apply UDP Sender Android Settings.
  3. Build with XR-RM -> Build Android APK, or use Unity's Android Build window.

The automated setup enables Android, PICO XR Loader, API 29, Internet access, IL2CPP + ARM64, and the PicoControllerUdpSender scene object.

Runtime scene components:

  • PicoControllerUdpSender: sends left/right controller JSON to the ROS2 host.
  • PicoUdpConfigPanel: in-headset config panel plus run HUD.
  • PicoKeepAwake: while UDP sending is on, requests PICO Enterprise wake lock, disables PICO auto sleep, applies Android KEEP_SCREEN_ON, and restores captured screen/sleep timeouts when sending stops.

Coordinate modes:

  • Project (+Z back): ROS-facing output. For pose_source=pxr_predict, the measured PICO native pose is converted with project.x=native.z, project.y=native.y, and project.z=-native.x.
  • Source raw: sends the source pose without this conversion for field diagnostics only.

The setup menu chooses the UDP target host from XR_RM_UDP_TARGET_HOST when set. Otherwise it auto-detects a local IPv4 address; on this Ubuntu machine the current Wi-Fi address is 192.168.9.99.

Batchmode build example:

cd /home/robot/WS_xr/src
XR_RM_UDP_TARGET_HOST=192.168.9.99 \
/home/robot/Unity/Hub/Editor/2022.3.62f3c1/Editor/Unity \
  -batchmode \
  -quit \
  -projectPath "$(pwd)/unity/XR_RM_PICO_UDP_Sender" \
  -executeMethod XrRmUdpSenderProjectSetup.BuildAndroidApk \
  -logFile "$(pwd)/unity_build.log"