-
Notifications
You must be signed in to change notification settings - Fork 429
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
Improve spacemouse #561
base: master
Are you sure you want to change the base?
Improve spacemouse #561
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.
Thanks Yu! Left some comments!
robosuite/devices/device.py
Outdated
@@ -163,10 +163,11 @@ def input2action(self, mirror_actions=False) -> Optional[Dict]: | |||
) | |||
ac_dict[f"{active_arm}_abs"] = arm_action["abs"] | |||
ac_dict[f"{active_arm}_delta"] = arm_action["delta"] | |||
ac_dict[f"{active_arm}_gripper"] = np.array([grasp] * gripper_dof) | |||
# ac_dict[f"{active_arm}_gripper"] = np.array([grasp] * gripper_dof) | |||
ac_dict[f"{active_arm}_gripper"] = [1, 0.45 * grasp, grasp, grasp, grasp, grasp] |
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.
what does this part change?
0.45 * grasp
this seems specific to the Inspire hand. We should make it a case by case basis
Also not sure if it works for non-humanoids
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.
Agreed. This would impact other robots. Moved the changes into class InspireLeftHand
and InspireRightHand
"robot0_torso_waist_yaw": 30.0, | ||
"robot0_torso_waist_pitch": 100.0, | ||
"robot0_torso_waist_roll": 100.0, |
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.
these changes are making the robot less agile. for example reaching up inside cabinets or farther back in the counter, etc. can we try to make use of the waist only when really needed? I think this part just needs more tuning, perhaps along with the overall gains of the controller.
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.
Parameters further tuned.
robosuite/devices/spacemouse.py
Outdated
@@ -101,37 +102,26 @@ def convert(b1, b2): | |||
return scale_to_control(to_int16(b1, b2)) | |||
|
|||
|
|||
class SpaceMouse(Device): | |||
class SpaceMouseSdkWrapper: |
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.
maybe call this SpaceMouseListener instead
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.
Renamed.
@@ -79,12 +79,12 @@ | |||
<site name="ft_frame" pos="0 0 0" size="0.01 0.01 0.01" rgba="1 0 0 0" type="sphere" group="1"/> | |||
<inertial diaginertia="0 0 0" mass="0" pos="0 0 0"/> | |||
<body name="eef" pos="0 0 0" quat="0.707 0. -0.707 0."> | |||
<site name="grip_site" pos="0 0 0" size="0.01 0.01 0.01" rgba="1 1 0 1" type="sphere" group="2"/> | |||
<site name="grip_site" pos="0 0 0" size="0.01 0.01 0.01" rgba="1 1 0 0" type="sphere" group="2"/> |
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.
reason for change?
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.
It has been reverted.
<site name="ee_x" pos="0.1 0 0" size="0.005 .1" quat="0.707105 0 0.707108 0 " rgba="1 0 0 0" type="cylinder" group="1"/> | ||
<site name="ee_y" pos="0 0.1 0" size="0.005 .1" quat="0.707105 0.707108 0 0" rgba="0 1 0 0" type="cylinder" group="1"/> | ||
<site name="ee_z" pos="0 0 0.1" size="0.005 .1" quat="1 0 0 0" rgba="0 0 1 0" type="cylinder" group="1"/> | ||
<!-- This site was added for visualization. --> | ||
<site name="grip_site_cylinder" pos="0 0 0" quat="-0.5 -0.5 -0.5 0.5" size="0.005 0.5" rgba="0 1 0 0.3" type="cylinder" group="1"/> | ||
<site name="grip_site_cylinder" pos="0 0 0" quat="-0.5 -0.5 -0.5 0.5" size="0.005 0.5" rgba="0 1 0 0" type="cylinder" group="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.
reason for change?
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.
Make the long ray invisible.
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.
can we add some red sites for when each of the other 3 fingers are closed? in a lighter shade of red than the current red color marker of the hand
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.
Done.
@squarefk also I wanted to press S and start moving the other arm (at the start). but if I do it at the start the other arm does not move. can we fix this? |
297db1d
to
d10de3e
Compare
Repost the solution here: In the is_empty_input_spacemouse function from robocasa/robocasa/scripts/collect_demos.py , we only checked right_delta. Need to update the condition into:
|
d10de3e
to
fc86b58
Compare
This PR adds support for bimanual teleoperation using the existing SpaceMouse class.
When two space mice are connected, the system will automatically switch to bimanual mode.
To test the functionality without setting up an environment, users can connect either one or two space mice and run
python -m robosuite.devices.spacemouse
.