-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Hi there,
Thanks so much for open-sourcing Bigym!!
I had a question about the H1 upper body IK solver.
When solving for the joint h1/left_wrist and h1/right_wrist, why do you solve for the cosine difference of up direction?
The reason I am confused is suppose I want to tilt the gripper upwards (assume the red axis is the direction the gripper is facing so I would like to rotate around the green axis) like the image:
setting this as the target position will cause the joint h1/left_wrist and h1/right_wrist only rotate the gripper around the red axis instead because it solves for the cosine difference in the up direction. Something like this:
Is this intended behavior or am I understanding this incorrectly?
Also, I tried fixing this by adding rotation actuators for the site as well in generate_ee_actuators and adding left/right wrist into self._arm_joints, does this work?
# lines 119-124
for joint in all_joints:
if "wrist" not in joint.name.lower() and \
(joint not in arm_joints or GRIPPER_NAME_PREFIX in joint.name.lower()):
joint.remove()
else:
joint.damping = JOINT_DAMPING
if joint.name in JOINT_LIMITS:
joint.range = JOINT_LIMITS[joint.name]
# lines 205-227
def _generate_ee_actuators(self, site: str, origin: str):
x = self._model.actuator.add(
"position",
kp=KP,
kv=KV,
ctrlrange=RANGE_EE_POSITION,
name=f"{site}_ee_x",
)
y = self._model.actuator.add(
"position",
kp=KP,
kv=KV,
ctrlrange=RANGE_EE_POSITION,
name=f"{site}_ee_y",
)
z = self._model.actuator.add(
"position",
kp=KP,
kv=KV,
ctrlrange=RANGE_EE_POSITION,
name=f"{site}_ee_z",
)
rx = self._model.actuator.add(
"position",
kp=ROT_KP,
kv=ROT_KV,
ctrlrange="-1.571 1.571",
name=f"{site}_ee_rx",
)
ry = self._model.actuator.add(
"position",
kp=ROT_KP,
kv=ROT_KV,
ctrlrange="-1.571 1.571",
name=f"{site}_ee_ry",
)
rz = self._model.actuator.add(
"position",
kp=ROT_KP,
kv=ROT_KV,
ctrlrange="-1.571 1.571",
name=f"{site}_ee_rz",
)
