Policy
Create a policy with build_grasp_policy(cfg, robot_config, device).
Predicts pre-grasp, grasp and post-grasp configurations from an observation; see build_grasp_policy.
One scene's input from env.observe() slices plus "qpos" (1, 1, D); calibrated views skip the initial.
Sample actions; guided sampling accepts raw noise shaped (batch * samples, latent_dim).
Each scene's best proposal index by the grasp evaluator, on the features get_action left in obs.
Grasp policy architecture, losses and sampling.
Reusable presets live in graspkit/configs/grasp_policy.py.
Configurations decoded per trajectory; the trainer and evaluator assume three: pre-grasp, grasp and post-grasp.
Floating base: predict a continuous 6D rotation instead of Euler rxyz, converted back on output.
Use exact, non-iterative Euler conversion after decoding rotations.
Share wrist rotation across all three poses and wrist translation during closing.
Start index of the floating-base rotation in each action.
Add the MSE between predicted and target link positions from forward kinematics.
Observation backbone.
Condition feature size passed to the generator.
Normalization for the SpConv encoder.
Return one scene feature; False keeps per-point features for local grasp-point conditioning.
Predict floating-base translations relative to the observed point-cloud centroid.
Fixed coordinate scale applied only to vision-encoder inputs.
Rotate training observations and target poses together around the vertical axis.
Use a deterministic observed-point-cloud yaw frame for training and inference.
With local features, train a target-segmentation head and mask graspness at inference.
Points GraspPolicy.preprocess samples from an observed point cloud.
GraspPolicy.preprocess keeps only the target's points, initial and current frames together (hands occlude).
cvae (models/cvae.py) or flow matching (models/flow_matching.py).
Latent dimension of the CVAE.
Jointly learn a diagonal-Gaussian latent prior conditioned on the observation.
Encode standardized actions and decode physical actions using saved mean/std buffers.
Native reconstruction loss or MSE scaled by each phase's training action standard deviation.
Joint-position reconstruction weight: L1 for CVAE, MSE for flow.
Floating-base rotation L1 weight.
Floating-base translation L1 weight.
Weight of the kinematic loss.
Weight of the KL term to the unit Gaussian.
Weight of the local-feature objectness BCE.
Weight of the local-feature per-point graspness KL.
if True, penalize hand collision-sphere penetration into the target object (needs scene geom at train time)
the weight of the penetration loss
only penetration deeper than this (meters) is penalized (avoids punishing legitimate contact)
compute the (expensive) penetration loss every N steps to amortize per-batch scene-geometry build
delay the penetration loss until this iteration so the policy learns to grasp first (replaces fine-tuning)
Attract prior-sampled fingertip collision spheres to the target surface during training.
Decode the prior mean for CVAE or integrate from zero noise for flow.
Scale of the sampled generator noise; ignored when use_mean is True.
Latent refinement steps using a trained grasp evaluator; zero disables guidance.
Maximum L2 displacement from each initial latent draw.
Let the grasp evaluator attend to frozen local visual tokens; the actor stays unchanged.
Condition the local success critic on the current fixed-base robot configuration.
Encode hand joints instead of all actuated joints in the grasp evaluator.
Zero constant replay features after scorer normalization.