Skip to content

Conversation

@inkyu-chef
Copy link
Collaborator

@inkyu-chef inkyu-chef commented Dec 11, 2025

Adjusting follower's gripper offset configuration.

Setting gripper_offset to 0.01 yields 2cm opened follower's gripper when leader gripper is fully closed. (i.e., 1cm per finger from the centre of the gripper).

Tested positive value and it worked, but careful adjustment required with negative values. It can cause the following error

[ERROR] [Motor Interface] Joint 6 position limit exceeded: expected in range [-0.004000, 0.044000], motor reported -0.005256. Setting to idle.

At the moment gripper_offset is set as 0 intentionally -> no impact.


Note

Adds per-gripper linear mapping (scale + offset) from leader to follower for Trossen AI robots, with auto-detected gripper joint index.

  • Manipulator control:
    • Detects follower gripper joint index (joint_6) per arm and stores in gripper_idxs.
    • For trossen_ai_stationary and trossen_ai_solo, applies linear mapping to gripper joint during teleop: goal = scale * leader + offset (with debug prints), before safety clamping and write.
  • Config:
    • Adds gripper_scale and gripper_offset to TrossenAIStationaryRobotConfig (defaults: 1.0, 0).

Written by Cursor Bugbot for commit f3d4c7b. This will update automatically on new commits. Configure here.

@inkyu-chef inkyu-chef requested a review from somudro December 11, 2025 17:03
@inkyu-chef inkyu-chef self-assigned this Dec 11, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

scale = getattr(self.config, "gripper_scale", 1.0)
offset = getattr(self.config, "gripper_offset", 0.0)
goal_pos[gripper_idx] = scale * x_leader + offset
print("leader:", leader_pos[name]) #for tuning
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: In-place tensor modification corrupts leader position data

The assignment goal_pos = leader_pos[name] creates a reference to the same tensor, not a copy. When goal_pos[gripper_idx] is modified with the scale and offset, it also mutates the original leader_pos[name] tensor in-place. This causes the debug print at line 503 to show the modified value instead of the original leader position, and could cause issues if leader_pos is used elsewhere in future code. The tensor needs to be cloned before modification.

Fix in Cursor Fix in Web

self.gripper_idxs: dict[str, int] = {}
for name, bus in self.follower_arms.items():
names = list(bus.motor_names)
print("follower_arms motor names:", names) #for tuning
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Debug print statements accidentally committed to production code

Multiple debug print statements with #for tuning comments have been left in the code. These include printing motor names during initialization and printing leader/goal positions during each teleop step. These will produce excessive console output in production and appear to be development artifacts that weren't intended to be committed.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove print or replace with log

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.

3 participants