forked from NVlabs/storm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_world.py
61 lines (46 loc) · 1.73 KB
/
test_world.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from pyrcareworld.envs import RCareWorld
# Create RCareWorld object
env = RCareWorld()
sphere_1 = env.create_object(id=10001, name="Sphere", is_in_scene=True)
sphere_1.setTransform(position=[0.4, 0.1, 0.4],scale=[0.2, 0.2, 0.2])
cube_1 = env.create_object(id=20001, name="Cube", is_in_scene=False)
cube_1.load()
cube_1.setTransform(position=[0.4, 0.2, 0.2],scale=[0.3, 0.4, 0.1])
cube_2 = env.create_object(id=20002, name="Cube", is_in_scene=False)
cube_2.load()
cube_2.setTransform(position=[ 0.4, 0.2, -0.3],scale=[0.3, 0.5, 0.1])
cube_3 = env.create_object(id=20003, name="Cube", is_in_scene=False)
cube_3.load()
cube_3.setTransform(position=[ 0. , -0.1, 0. ],scale=[2.0, 0.2, 2.0])
cube_ref = env.create_object(id=30001, name="Cube", is_in_scene=False)
cube_ref.load()
cube_ref.setTransform(position=[0.3, 0.5, 0.0],scale=[0.01, 0.01, 0.01])
robot_id = 639787
robot_dof = 7
robot = env.create_robot(
id=robot_id,
gripper_list=["6397870"],
robot_name="franka_panda",
base_pos=[0, 0, 0],
)
for i in range(100):
env.step()
# #positions after coordinate transformation from IsaacSim to Unity
# #original position from collision_primitives_3d.yml
# #rotation quaternion does not change after rotation around axis
init_joint_state = [133.62, -27.56, -91.45, -42.93,
-36.87, 49.87, 61.51]
env.instance_channel.set_action(
"SetJointPositionDirectly",
id=robot_id,
joint_positions=list(init_joint_state)
)
# env.stepSeveralSteps(100)
# robot.load()
while True:
env.instance_channel.set_action(
"SetJointPositionDirectly",
id=robot_id,
joint_positions=list(init_joint_state)
)
env._step()