Skip to content

sharpa_avatar: glove powered on after plugin start is stopped every 2 s (get_device_info().online stays false) #1181

Closed

Description

@lotusl-code

Describe the bug
In the sharpa_avatar plugin, a glove that is powered on after the plugin has started never streams. Every 2 s the plugin connects it and stops it again within a few milliseconds, indefinitely. Gloves that are already on when the plugin starts work normally.

Cause (from the plugin code)

  • start_glove_if_present() gets the glove with AvatarSDK::get_device(GLOVE, side) (L360), which only returns a device whose discovery row is online, then calls init() / start().
  • On the next frame, refresh_data() checks state.device->get_device_info().online (L424). For a hot-plugged glove this is false, so it calls state.reset() (L426), which calls device->stop() (L246).
  • try_connect_missing_gloves() reconnects after kGloveRetryInterval = 2 s (L39), and the cycle repeats.

So the two calls disagree: get_device() (discovery table) says online, AvatarDevice::get_device_info().online says offline. Because the upstream code resets silently, the only visible symptom is that the glove never produces data.

From the Avatar SDK 1.7.3 binary (no source available, so this part is inferred): AvatarDevice is constructed from a DeviceInfo copy (AvatarDevice(DeviceInfo const&)), get_device_info() returns that stored copy, and there is no AvatarDeviceAccess setter for online. The SDK first discovers a hot-plugged glove as link=offline and only later logs offline -> online, so the handle appears to keep online=false from when it was created.

To reproduce

  1. Start a TeleopSession that launches avatar_hand_plugin (e.g. python -m isaaccapture_examples.sharpa_avatar) with both gloves powered off.
  2. Power on one glove.
  3. The glove never streams; the plugin's stdout shows connected and streaming every 2 s.

Expected behavior
A glove powered on after the plugin starts is connected once and streams.

Observed behavior
SDK log (plugin stdout) for a right glove powered on after start. There is no online -> offline transition at all, yet SerialHand::start runs every 2 s and the glove answers each time:

21:53:42.069 DiscoverService: discovered device side=RIGHT type=0 link=offline
21:53:46.364 DiscoverService: link state changed side=RIGHT offline -> online
21:53:46.592 SerialHand::start identity before tactile sn= side=RIGHT serial_open=true
21:53:46.653 SerialHand::identity_worker_loop: firmware identity ready, tactile started side=RIGHT attempt=1
21:53:48.598 SerialHand::start identity before tactile sn=AVTG240R-... side=RIGHT serial_open=true
21:53:48.713 SerialHand::identity_worker_loop: firmware identity ready, tactile started side=RIGHT attempt=1
21:53:50.607 SerialHand::start identity before tactile sn=AVTG240R-... side=RIGHT serial_open=true
... (repeats every 2 s)

With the gloves already on before AvatarSDK::initialize(), the same sequence (get_device -> init -> start, checked with the SDK Python binding) keeps get_device_info().online == true and fetch_data succeeding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions