Make the PICO grip and trigger axes available, off by default - #255
Open
ra9fuji-ui wants to merge 1 commit into
Open
Make the PICO grip and trigger axes available, off by default#255ra9fuji-ui wants to merge 1 commit into
ra9fuji-ui wants to merge 1 commit into
Conversation
`generate_finger_data` takes the PICO grip as an argument but never writes it into the fingertip frames, so the axis is lost before it reaches the IK solver. The trigger is reduced to a boolean at a 0.5 threshold even though the solver interpolates continuously. Add three opt-in environment variables: GEAR_SONIC_GRIP_AXIS=1 carry the grip axis on Dex3 joint 0 GEAR_SONIC_GRIP_AXIS_GAIN=1.0 joint-0 value in rad at grip == 1.0 GEAR_SONIC_TRIGGER_CONTINUOUS=1 pass the trigger travel through Joint 0 is free: the only gesture this producer emits is `middle_close`, whose amp0 is 0.0 (g1_gripper_ik_solver.py), so joint 0 is otherwise always zero. Dex3 joint 0 spans +-1.05 rad (dex3_hands.hpp) and the built-in gestures use +-0.5, so the default gain is inside the limit and unambiguous against both. Every switch defaults to off and the guarded paths are additive -- the old trigger branch survives as the `elif` -- so with no environment variable set the file behaves exactly as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
generate_finger_datareceives the PICO grip as an argument but never writes itinto the fingertip frames, so the axis is discarded before it reaches
G1GripperInverseKinematicsSolver. The trigger is separately collapsed to aboolean at a 0.5 threshold, even though the solver itself interpolates
(
q_open + grip * (q_closed - q_open)).This adds three opt-in environment variables:
GEAR_SONIC_GRIP_AXIS=1GEAR_SONIC_GRIP_AXIS_GAIN=1.0grip == 1.0GEAR_SONIC_TRIGGER_CONTINUOUS=1Why joint 0 is safe to use
The only gesture this producer emits is
middle_close, whoseamp0is0.0(
g1_gripper_ik_solver.py), so joint 0 is otherwise always zero. Dex3 joint 0spans ±1.05 rad (
dex3_hands.hppMAX_LIMITS/MIN_LIMITS) and the built-ingestures use ±0.5, so the default gain of 1.0 is inside the joint limit and
unambiguous against both. Both hands end up with the same sign on joint 0, so
one expression covers each side.
Default behaviour is unchanged
Every switch defaults to off, and the guarded paths are additive — the original
trigger branch survives as the
elif.I checked this by running the upstream and patched
generate_finger_datasideby side over 2,222 input combinations (trigger × grip × hand). The returned
arrays are identical whenever no variable is set, and also when a variable is
present but set to
0.Context
We run a G1 fitted with Inspire RH56DFX hands. Per #109 the deployment does not
support that hand natively, which is fine — we consume the Dex3 command stream
outside GEAR-SONIC and retarget it, so GEAR-SONIC itself needs no
Inspire-specific code. This PR adds none: joint 0 is a plain Dex3 axis, and
any consumer of the Dex3 command stream can use it. Without this change the grip
axis is simply unavailable to anything downstream.
Tested on a real G1 with a PICO controller on 2026-08-13.