-
Notifications
You must be signed in to change notification settings - Fork 0
Inkyu/2025 12 11 gripper offset #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trossen-ai
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
…otics/trossen-lerobot into inkyu/2025-12-11-gripper-offset
Adjusting follower's gripper offset configuration.
Setting
gripper_offsetto 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.
joint_6) per arm and stores ingripper_idxs.trossen_ai_stationaryandtrossen_ai_solo, applies linear mapping to gripper joint during teleop:goal = scale * leader + offset(with debug prints), before safety clamping and write.gripper_scaleandgripper_offsettoTrossenAIStationaryRobotConfig(defaults:1.0,0).Written by Cursor Bugbot for commit f3d4c7b. This will update automatically on new commits. Configure here.