-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from thisjustin123/justin/cloth-grasp
Example Cloth Grasp. Works for now
- Loading branch information
Showing
2 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from pyrcareworld.envs.rcareworld_env import RCareWorld | ||
|
||
# Script to test cloth grasping. Paired with "Cloth Grasp" scene. | ||
if __name__ == "__main__": | ||
env = RCareWorld() | ||
|
||
# Create a new cloth representation. | ||
cloth = env.create_cloth(id=100, name="Cloth", is_in_scene=True) | ||
|
||
# Create a new robot. | ||
robot = env.create_robot( | ||
id=315893, | ||
# Note: "3158930" is the scene gripper id, but it seems to not work. | ||
gripper_list=[315893], | ||
robot_name="kinova_gen3_7dof-robotiq85", | ||
base_pos=[0, 0, 0], | ||
) | ||
|
||
# Note: We use a General Gripper Script on the robot to get the GripperClose() and GripperOpen() functions to have visual effect. | ||
|
||
# ... | ||
for i in range(200): | ||
env.step() | ||
|
||
# Move to pants. | ||
for i in range(100): | ||
robot.moveTo([0, 0.33, 0.477]) | ||
env.step() | ||
|
||
# Grasp. Cloth Grasper script on C# causes grasp. | ||
robot.GripperClose() | ||
|
||
# Grasp... | ||
for i in range(100): | ||
env.step() | ||
|
||
# Move up. | ||
for i in range(100): | ||
robot.moveTo([0, 0.9, 0.3]) | ||
env.step() | ||
|
||
# ... | ||
for i in range(100): | ||
env.step() | ||
|
||
# Release. | ||
robot.GripperOpen() | ||
|
||
# ... | ||
for i in range(200): | ||
env.step() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters