Optional Numpy Compute Backend #3075
46 passed, 8 failed and 7 skipped
✅ 12302141302-tests-test_controllers/test_controllers.xml
1 tests were completed in 657s with 1 passed, 0 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 1✅ | 657s |
✅ pytest
tests.test_controllers
✅ test_arm_control
❌ 12302141302-tests-test_curobo/test_curobo.xml
1 tests were completed in 598s with 0 passed, 1 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 1❌ | 598s |
❌ pytest
tests.test_curobo
❌ test_curobo
def test_curobo():
✅ 12302141302-tests-test_multiple_envs/test_multiple_envs.xml
10 tests were completed in 565s with 8 passed, 0 failed and 2 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 8✅ | 2⚪ | 565s |
✅ pytest
tests.test_multiple_envs
✅ test_multi_scene_dump_load_states
✅ test_multi_scene_get_local_position
✅ test_multi_scene_set_local_position
✅ test_multi_scene_scene_prim
✅ test_multi_scene_particle_source
✅ test_multi_scene_position_orientation_relative_to_scene
✅ test_tiago_getter
✅ test_tiago_setter
⚪ test_behavior_getter
⚪ test_behavior_setter
❌ 12302141302-tests-test_primitives/test_primitives.xml
10 tests were completed in 550s with 0 passed, 6 failed and 4 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 6❌ | 4⚪ | 550s |
❌ pytest
tests.test_primitives.TestPrimitives
❌ test_navigate[Tiago]
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a7520>
❌ test_navigate[Fetch]
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a6530>
❌ test_grasp[Tiago]
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a7a60>
❌ test_grasp[Fetch]
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a4670>
❌ test_place[Tiago]
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a5600>
❌ test_place[Fetch]
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a52d0>
⚪ test_open_prismatic[Tiago]
⚪ test_open_prismatic[Fetch]
⚪ test_open_revolute[Tiago]
⚪ test_open_revolute[Fetch]
✅ 12302141302-tests-test_robot_states_no_flatcache/test_robot_states_no_flatcache.xml
3 tests were completed in 592s with 3 passed, 0 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 3✅ | 592s |
✅ pytest
tests.test_robot_states_no_flatcache
✅ test_camera_pose_flatcache_off
✅ test_camera_semantic_segmentation
✅ test_object_in_FOV_of_robot
✅ 12302141302-tests-test_robot_teleoperation/test_robot_teleoperation.xml
1 tests were completed in 30ms with 0 passed, 0 failed and 1 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 1⚪ | 30ms |
✅ pytest
tests.test_robot_teleoperation
⚪ test_teleop
❌ 12302141302-tests-test_scene_graph/test_scene_graph.xml
1 tests were completed in 476s with 0 passed, 1 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 1❌ | 476s |
❌ pytest
tests.test_scene_graph
❌ test_scene_graph
def test_scene_graph():
✅ 12302141302-tests-test_transform_utils/test_transform_utils.xml
34 tests were completed in 128s with 34 passed, 0 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 34✅ | 128s |
✅ pytest
tests.test_transform_utils.TestQuaternionOperations
✅ test_quat2mat_special_cases
✅ test_quat_multiply
✅ test_quat_conjugate
✅ test_quat_inverse
✅ test_quat_distance
tests.test_transform_utils.TestVectorOperations
✅ test_normalize
✅ test_dot_product
✅ test_l2_distance
tests.test_transform_utils.TestMatrixOperations
✅ test_rotation_matrix_properties
✅ test_rotation_matrix
✅ test_transformation_matrix
✅ test_transformation_matrix_no_point
✅ test_matrix_inverse
tests.test_transform_utils.TestCoordinateTransformations
✅ test_cartesian_to_polar
tests.test_transform_utils.TestPoseTransformations
✅ test_pose2mat_and_mat2pose
✅ test_pose_inv
tests.test_transform_utils.TestAxisAngleConversions
✅ test_axisangle2quat_and_quat2axisangle
✅ test_vecs2axisangle
✅ test_vecs2quat
tests.test_transform_utils.TestEulerAngleConversions
✅ test_euler2quat_and_quat2euler
✅ test_euler2mat_and_mat2euler
tests.test_transform_utils.TestQuaternionApplications
✅ test_quat_apply
✅ test_quat_slerp
tests.test_transform_utils.TestTransformPoints
✅ test_transform_points_2d
✅ test_transform_points_3d
tests.test_transform_utils.TestMiscellaneousFunctions
✅ test_convert_quat
✅ test_random_quaternion
✅ test_random_axis_angle
✅ test_align_vector_sets
✅ test_copysign
✅ test_anorm
✅ test_check_quat_right_angle
✅ test_z_angle_from_quat
✅ test_integer_spiral_coordinates
Annotations
Check failure on line 0 in 12302141302-tests-test_curobo/test_curobo.xml
github-actions / Test Results
pytest ► tests.test_curobo ► test_curobo
Failed test found in:
12302141302-tests-test_curobo/test_curobo.xml
Error:
def test_curobo():
Raw output
def test_curobo():
# Make sure object states are enabled
assert gm.ENABLE_OBJECT_STATES
# Create env
cfg = {
"env": {
"action_frequency": 30,
"physics_frequency": 300,
},
"scene": {
"type": "Scene",
},
"objects": [
{
"type": "PrimitiveObject",
"name": "obj0",
"primitive_type": "Cube",
"scale": [0.4, 0.4, 0.4],
"fixed_base": True,
"position": [0.5, -0.1, 0.2],
"orientation": [0, 0, 0, 1],
},
{
"type": "PrimitiveObject",
"name": "eef_marker_0",
"primitive_type": "Sphere",
"radius": 0.05,
"visual_only": True,
"position": [0, 0, 0],
"orientation": [0, 0, 0, 1],
"rgba": [1, 0, 0, 1],
},
{
"type": "PrimitiveObject",
"name": "eef_marker_1",
"primitive_type": "Sphere",
"radius": 0.05,
"visual_only": True,
"position": [0, 0, 0],
"orientation": [0, 0, 0, 1],
"rgba": [0, 1, 0, 1],
},
],
"robots": [],
}
robot_cfgs = [
{
"type": "FrankaPanda",
"obs_modalities": "rgb",
"position": [0.7, -0.55, 0.0],
"orientation": [0, 0, 0.707, 0.707],
"self_collisions": True,
"action_normalize": False,
"controller_config": {
"arm_0": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"gripper_0": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
},
},
{
"type": "R1",
"obs_modalities": "rgb",
"position": [0.7, -0.7, 0.056],
"orientation": [0, 0, 0.707, 0.707],
"self_collisions": True,
"action_normalize": False,
"controller_config": {
"base": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"trunk": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"arm_left": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"arm_right": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"gripper_left": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"gripper_right": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
},
},
{
"type": "Tiago",
"obs_modalities": "rgb",
"position": [0.7, -0.85, 0],
"orientation": [0, 0, 0.707, 0.707],
"self_collisions": True,
"action_normalize": False,
"controller_config": {
"base": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"trunk": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"camera": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"arm_left": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"arm_right": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"gripper_left": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
"gripper_right": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": None,
"use_delta_commands": False,
"use_impedances": True,
},
},
},
]
for robot_cfg in robot_cfgs:
cfg["robots"] = [robot_cfg]
env = og.Environment(configs=cfg)
robot = env.robots[0]
obj = env.scene.object_registry("name", "obj0")
eef_markers = [env.scene.object_registry("name", f"eef_marker_{i}") for i in range(2)]
floor_touching_base_link_prim_paths = (
[os.path.join(robot.prim_path, link_name) for link_name in robot.floor_touching_base_link_names]
if isinstance(robot, LocomotionRobot)
else []
)
robot.reset()
# Open the gripper(s) to match cuRobo's default state
for arm_name in robot.gripper_control_idx.keys():
gripper_control_idx = robot.gripper_control_idx[arm_name]
robot.set_joint_positions(th.ones_like(gripper_control_idx), indices=gripper_control_idx, normalized=True)
robot.keep_still()
for _ in range(5):
og.sim.step()
env.scene.update_initial_state()
env.scene.reset()
# Create CuRobo instance
batch_size = 2
n_samples = 20
cmg = CuRoboMotionGenerator(
robot=robot,
batch_size=batch_size,
debug=False,
use_cuda_graph=True,
use_default_embodiment_only=True,
)
# Sample values for robot
th.manual_seed(1)
lo, hi = robot.joint_lower_limits.clone().view(1, -1), robot.joint_upper_limits.clone().view(1, -1)
if isinstance(robot, HolonomicBaseRobot):
lo[0, :2] = -0.1
lo[0, 2:5] = 0.0
lo[0, 5] = -math.pi
hi[0, :2] = 0.1
hi[0, 2:5] = 0.0
hi[0, 5] = math.pi
random_qs = lo + th.rand((n_samples, robot.n_dof)) * (hi - lo)
# Test collision with the environment (not including self-collisions)
collision_results = cmg.check_collisions(q=random_qs)
target_pos, target_quat = defaultdict(list), defaultdict(list)
floor_plane_prim_paths = {child.GetPath().pathString for child in og.sim.floor_plane._prim.GetChildren()}
# View results
false_positive = 0
false_negative = 0
target_pos_in_world_frame = defaultdict(list)
for i, (q, curobo_has_contact) in enumerate(zip(random_qs, collision_results)):
# Set robot to desired qpos
robot.set_joint_positions(q)
robot.keep_still()
og.sim.step_physics()
# To debug
# cmg.save_visualization(robot.get_joint_positions(), "/scr/chengshu/Downloads/test.obj")
# Sanity check in the GUI that the robot pose makes sense
for _ in range(10):
og.sim.render()
# Validate that expected collision result is correct
self_collision_pairs = set()
floor_contact_pairs = set()
wheel_contact_pairs = set()
obj_contact_pairs = set()
for contact in robot.contact_list():
assert contact.body0 in robot.link_prim_paths
if contact.body1 in robot.link_prim_paths:
self_collision_pairs.add((contact.body0, contact.body1))
elif contact.body1 in floor_plane_prim_paths:
if contact.body0 not in floor_touching_base_link_prim_paths:
floor_contact_pairs.add((contact.body0, contact.body1))
else:
wheel_contact_pairs.add((contact.body0, contact.body1))
elif contact.body1 in obj.link_prim_paths:
obj_contact_pairs.add((contact.body0, contact.body1))
else:
assert False, f"Unexpected contact pair: {contact.body0}, {contact.body1}"
touching_itself = len(self_collision_pairs) > 0
touching_floor = len(floor_contact_pairs) > 0
touching_object = len(obj_contact_pairs) > 0
curobo_has_contact = curobo_has_contact.item()
physx_has_contact = touching_itself or touching_floor or touching_object
# cuRobo reports contact, but physx reports no contact
if curobo_has_contact and not physx_has_contact:
false_positive += 1
print(
f"False positive {i}: {curobo_has_contact} vs. {physx_has_contact} (touching_itself/obj/floor: {touching_itself}/{touching_object}/{touching_floor})"
)
# physx reports contact, but cuRobo reports no contact
elif not curobo_has_contact and physx_has_contact:
false_negative += 1
print(
f"False negative {i}: {curobo_has_contact} vs. {physx_has_contact} (touching_itself/obj/floor: {touching_itself}/{touching_object}/{touching_floor})"
)
# neither cuRobo nor physx reports contact, valid planning goals
elif not curobo_has_contact and not physx_has_contact:
for arm_name in robot.arm_names:
# For holonomic base robots, we need to be in the frame of @robot.root_link, not @robot.base_footprint_link
if isinstance(robot, HolonomicBaseRobot):
base_link_pose = robot.root_link.get_position_orientation()
eef_link_pose = robot.eef_links[arm_name].get_position_orientation()
eef_pos, eef_quat = T.relative_pose_transform(*eef_link_pose, *base_link_pose)
else:
eef_pos, eef_quat = robot.get_relative_eef_pose(arm_name)
target_pos[robot.eef_link_names[arm_name]].append(eef_pos)
target_quat[robot.eef_link_names[arm_name]].append(eef_quat)
target_pos_in_world_frame[robot.eef_link_names[arm_name]].append(robot.get_eef_position(arm_name))
print(
f"Collision checking false positive: {false_positive / n_samples}, false negative: {false_negative / n_samples}."
)
assert (
false_positive / n_samples == 0.0
), f"Collision checking false positive rate: {false_positive / n_samples}, should be == 0.0."
assert (
false_negative / n_samples == 0.0
), f"Collision checking false negative rate: {false_negative / n_samples}, should be == 0.0."
env.scene.reset()
for arm_name in robot.arm_names:
target_pos[robot.eef_link_names[arm_name]] = th.stack(target_pos[robot.eef_link_names[arm_name]], dim=0)
target_quat[robot.eef_link_names[arm_name]] = th.stack(target_quat[robot.eef_link_names[arm_name]], dim=0)
target_pos_in_world_frame[robot.eef_link_names[arm_name]] = th.stack(
target_pos_in_world_frame[robot.eef_link_names[arm_name]], dim=0
)
# Cast defaultdict to dict
target_pos = dict(target_pos)
target_quat = dict(target_quat)
target_pos_in_world_frame = dict(target_pos_in_world_frame)
print(f"Planning for {len(target_pos[robot.eef_link_names[robot.default_arm]])} eef targets...")
# Generate collision-free trajectories to the sampled eef poses (including self-collisions)
successes, traj_paths = cmg.compute_trajectories(
target_pos=target_pos,
target_quat=target_quat,
is_local=True,
max_attempts=1,
timeout=60.0,
ik_fail_return=5,
enable_finetune_trajopt=True,
finetune_attempts=1,
return_full_result=False,
success_ratio=1.0,
attached_obj=None,
)
# Make sure collision-free trajectories are generated
success_rate = successes.double().mean().item()
print(f"Collision-free trajectory generation success rate: {success_rate}")
assert success_rate == 1.0, f"Collision-free trajectory generation success rate: {success_rate}"
# 1cm and 3 degrees error tolerance for prismatic and revolute joints, respectively
error_tol = th.tensor(
[0.01 if joint.joint_type == "PrismaticJoint" else 3.0 / 180.0 * math.pi for joint in robot.joints.values()]
)
# for bypass_physics in [True, False]:
for bypass_physics in [True]:
for traj_idx, (success, traj_path) in enumerate(zip(successes, traj_paths)):
if not success:
continue
# Reset the environment
env.scene.reset()
# Move the markers to the desired eef positions
for marker, arm_name in zip(eef_markers, robot.arm_names):
eef_link_name = robot.eef_link_names[arm_name]
marker.set_position_orientation(position=target_pos_in_world_frame[eef_link_name][traj_idx])
q_traj = cmg.path_to_joint_trajectory(traj_path)
# joint_positions_set_point = []
# joint_positions_response = []
for i, q in enumerate(q_traj):
if bypass_physics:
print(f"Teleporting waypoint {i}/{len(q_traj)}")
robot.set_joint_positions(q)
robot.keep_still()
og.sim.step()
for contact in robot.contact_list():
assert contact.body0 in robot.link_prim_paths
if (
contact.body1 in floor_plane_prim_paths
and contact.body0 in floor_touching_base_link_prim_paths
):
continue
if th.tensor(list(contact.impulse)).norm() == 0:
continue
print(f"Unexpected contact pair during traj rollout: {contact.body0}, {contact.body1}")
> assert (
False
), f"Unexpected contact pair during traj rollout: {contact.body0}, {contact.body1}"
E AssertionError: Unexpected contact pair during traj rollout: /World/scene_0/controllable__r1__robot_yybcvt/left_arm_link6, /World/scene_0/controllable__r1__robot_yybcvt/left_arm_link1
E assert False
tests/test_curobo.py:422: AssertionError
Check failure on line 0 in 12302141302-tests-test_primitives/test_primitives.xml
github-actions / Test Results
pytest ► tests.test_primitives.TestPrimitives ► test_navigate[Tiago]
Failed test found in:
12302141302-tests-test_primitives/test_primitives.xml
Error:
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a7520>
Raw output
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a7520>
robot = 'Tiago'
def test_navigate(self, robot):
categories = ["floors", "ceilings", "walls"]
env = setup_environment(categories, robot=robot)
objects = []
obj_1 = {
"object": DatasetObject(name="cologne", category="bottle_of_cologne", model="lyipur"),
"position": [-0.3, -0.8, 0.5],
"orientation": [0, 0, 0, 1],
}
objects.append(obj_1)
primitives = [StarterSemanticActionPrimitiveSet.NAVIGATE_TO]
primitives_args = [(obj_1["object"],)]
> primitive_tester(env, objects, primitives, primitives_args)
tests/test_primitives.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_primitives.py:82: in primitive_tester
execute_controller(controller.apply_ref(primitive, *args, attempts=1), env)
tests/test_primitives.py:69: in execute_controller
for action in ctrl_gen:
omnigibson/action_primitives/starter_semantic_action_primitives.py:518: in apply_ref
yield from ctrl(*args)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1682: in _navigate_to_obj
pose = self._sample_pose_near_object(obj, pose_on_obj=pose_on_obj, **kwargs)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1808: in _sample_pose_near_object
with PlanningContext(self.env, self.robot, self.robot_copy, "simplified") as context:
omnigibson/action_primitives/starter_semantic_action_primitives.py:146: in __enter__
self._assemble_robot_copy()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <omnigibson.action_primitives.starter_semantic_action_primitives.PlanningContext object at 0x7f0e40d1bfd0>
def _assemble_robot_copy(self):
if m.TIAGO_TORSO_FIXED:
fk_descriptor = "left_fixed"
else:
fk_descriptor = (
> "combined" if "combined" in self.robot.robot_arm_descriptor_yamls else self.robot.default_arm
)
E AttributeError: 'Tiago' object has no attribute 'robot_arm_descriptor_yamls'
omnigibson/action_primitives/starter_semantic_action_primitives.py:160: AttributeError
Check failure on line 0 in 12302141302-tests-test_primitives/test_primitives.xml
github-actions / Test Results
pytest ► tests.test_primitives.TestPrimitives ► test_navigate[Fetch]
Failed test found in:
12302141302-tests-test_primitives/test_primitives.xml
Error:
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a6530>
Raw output
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a6530>
robot = 'Fetch'
def test_navigate(self, robot):
categories = ["floors", "ceilings", "walls"]
env = setup_environment(categories, robot=robot)
objects = []
obj_1 = {
"object": DatasetObject(name="cologne", category="bottle_of_cologne", model="lyipur"),
"position": [-0.3, -0.8, 0.5],
"orientation": [0, 0, 0, 1],
}
objects.append(obj_1)
primitives = [StarterSemanticActionPrimitiveSet.NAVIGATE_TO]
primitives_args = [(obj_1["object"],)]
> primitive_tester(env, objects, primitives, primitives_args)
tests/test_primitives.py:105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_primitives.py:82: in primitive_tester
execute_controller(controller.apply_ref(primitive, *args, attempts=1), env)
tests/test_primitives.py:69: in execute_controller
for action in ctrl_gen:
omnigibson/action_primitives/starter_semantic_action_primitives.py:518: in apply_ref
yield from ctrl(*args)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1682: in _navigate_to_obj
pose = self._sample_pose_near_object(obj, pose_on_obj=pose_on_obj, **kwargs)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1808: in _sample_pose_near_object
with PlanningContext(self.env, self.robot, self.robot_copy, "simplified") as context:
omnigibson/action_primitives/starter_semantic_action_primitives.py:146: in __enter__
self._assemble_robot_copy()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <omnigibson.action_primitives.starter_semantic_action_primitives.PlanningContext object at 0x7f0e4c9165c0>
def _assemble_robot_copy(self):
if m.TIAGO_TORSO_FIXED:
fk_descriptor = "left_fixed"
else:
fk_descriptor = (
> "combined" if "combined" in self.robot.robot_arm_descriptor_yamls else self.robot.default_arm
)
E AttributeError: 'Fetch' object has no attribute 'robot_arm_descriptor_yamls'
omnigibson/action_primitives/starter_semantic_action_primitives.py:160: AttributeError
Check failure on line 0 in 12302141302-tests-test_primitives/test_primitives.xml
github-actions / Test Results
pytest ► tests.test_primitives.TestPrimitives ► test_grasp[Tiago]
Failed test found in:
12302141302-tests-test_primitives/test_primitives.xml
Error:
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a7a60>
Raw output
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a7a60>
robot = 'Tiago'
def test_grasp(self, robot):
categories = ["floors", "ceilings", "walls", "coffee_table"]
env = setup_environment(categories, robot=robot)
objects = []
obj_1 = {
"object": DatasetObject(name="cologne", category="bottle_of_cologne", model="lyipur"),
"position": [-0.3, -0.8, 0.5],
"orientation": [0, 0, 0, 1],
}
objects.append(obj_1)
primitives = [StarterSemanticActionPrimitiveSet.GRASP]
primitives_args = [(obj_1["object"],)]
> primitive_tester(env, objects, primitives, primitives_args)
tests/test_primitives.py:122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_primitives.py:82: in primitive_tester
execute_controller(controller.apply_ref(primitive, *args, attempts=1), env)
tests/test_primitives.py:69: in execute_controller
for action in ctrl_gen:
omnigibson/action_primitives/starter_semantic_action_primitives.py:518: in apply_ref
yield from ctrl(*args)
omnigibson/action_primitives/starter_semantic_action_primitives.py:743: in _grasp
yield from self._navigate_if_needed(obj, pose_on_obj=grasp_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1663: in _navigate_if_needed
if self._target_in_reach_of_robot(pose_on_obj):
omnigibson/action_primitives/starter_semantic_action_primitives.py:913: in _target_in_reach_of_robot
return self._target_in_reach_of_robot_relative(relative_target_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:925: in _target_in_reach_of_robot_relative
return self._ik_solver_cartesian_to_joint_space(relative_target_pose) is not None
omnigibson/action_primitives/starter_semantic_action_primitives.py:965: in _ik_solver_cartesian_to_joint_space
robot_description_path=self._manipulation_descriptor_path,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <omnigibson.action_primitives.starter_semantic_action_primitives.StarterSemanticActionPrimitives object at 0x7f0e38d34c70>
@property
def _manipulation_descriptor_path(self):
"""The appropriate manipulation descriptor for the current settings."""
if isinstance(self.robot, Tiago) and m.TIAGO_TORSO_FIXED:
assert self.arm == "left", "Fixed torso mode only supports left arm!"
return self.robot.robot_arm_descriptor_yamls["left_fixed"]
# Otherwise just return the default arm control idx
> return self.robot.robot_arm_descriptor_yamls[self.arm]
E AttributeError: 'Tiago' object has no attribute 'robot_arm_descriptor_yamls'
omnigibson/action_primitives/starter_semantic_action_primitives.py:950: AttributeError
Check failure on line 0 in 12302141302-tests-test_primitives/test_primitives.xml
github-actions / Test Results
pytest ► tests.test_primitives.TestPrimitives ► test_grasp[Fetch]
Failed test found in:
12302141302-tests-test_primitives/test_primitives.xml
Error:
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a4670>
Raw output
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a4670>
robot = 'Fetch'
def test_grasp(self, robot):
categories = ["floors", "ceilings", "walls", "coffee_table"]
env = setup_environment(categories, robot=robot)
objects = []
obj_1 = {
"object": DatasetObject(name="cologne", category="bottle_of_cologne", model="lyipur"),
"position": [-0.3, -0.8, 0.5],
"orientation": [0, 0, 0, 1],
}
objects.append(obj_1)
primitives = [StarterSemanticActionPrimitiveSet.GRASP]
primitives_args = [(obj_1["object"],)]
> primitive_tester(env, objects, primitives, primitives_args)
tests/test_primitives.py:122:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_primitives.py:82: in primitive_tester
execute_controller(controller.apply_ref(primitive, *args, attempts=1), env)
tests/test_primitives.py:69: in execute_controller
for action in ctrl_gen:
omnigibson/action_primitives/starter_semantic_action_primitives.py:518: in apply_ref
yield from ctrl(*args)
omnigibson/action_primitives/starter_semantic_action_primitives.py:743: in _grasp
yield from self._navigate_if_needed(obj, pose_on_obj=grasp_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1663: in _navigate_if_needed
if self._target_in_reach_of_robot(pose_on_obj):
omnigibson/action_primitives/starter_semantic_action_primitives.py:913: in _target_in_reach_of_robot
return self._target_in_reach_of_robot_relative(relative_target_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:925: in _target_in_reach_of_robot_relative
return self._ik_solver_cartesian_to_joint_space(relative_target_pose) is not None
omnigibson/action_primitives/starter_semantic_action_primitives.py:965: in _ik_solver_cartesian_to_joint_space
robot_description_path=self._manipulation_descriptor_path,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <omnigibson.action_primitives.starter_semantic_action_primitives.StarterSemanticActionPrimitives object at 0x7f0e42b39210>
@property
def _manipulation_descriptor_path(self):
"""The appropriate manipulation descriptor for the current settings."""
if isinstance(self.robot, Tiago) and m.TIAGO_TORSO_FIXED:
assert self.arm == "left", "Fixed torso mode only supports left arm!"
return self.robot.robot_arm_descriptor_yamls["left_fixed"]
# Otherwise just return the default arm control idx
> return self.robot.robot_arm_descriptor_yamls[self.arm]
E AttributeError: 'Fetch' object has no attribute 'robot_arm_descriptor_yamls'
omnigibson/action_primitives/starter_semantic_action_primitives.py:950: AttributeError
Check failure on line 0 in 12302141302-tests-test_primitives/test_primitives.xml
github-actions / Test Results
pytest ► tests.test_primitives.TestPrimitives ► test_place[Tiago]
Failed test found in:
12302141302-tests-test_primitives/test_primitives.xml
Error:
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a5600>
Raw output
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a5600>
robot = 'Tiago'
def test_place(self, robot):
categories = ["floors", "ceilings", "walls", "coffee_table"]
env = setup_environment(categories, robot=robot)
objects = []
obj_1 = {
"object": DatasetObject(name="table", category="breakfast_table", model="rjgmmy", scale=[0.3, 0.3, 0.3]),
"position": [-0.7, 0.5, 0.2],
"orientation": [0, 0, 0, 1],
}
obj_2 = {
"object": DatasetObject(name="cologne", category="bottle_of_cologne", model="lyipur"),
"position": [-0.3, -0.8, 0.5],
"orientation": [0, 0, 0, 1],
}
objects.append(obj_1)
objects.append(obj_2)
primitives = [StarterSemanticActionPrimitiveSet.GRASP, StarterSemanticActionPrimitiveSet.PLACE_ON_TOP]
primitives_args = [(obj_2["object"],), (obj_1["object"],)]
> primitive_tester(env, objects, primitives, primitives_args)
tests/test_primitives.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_primitives.py:82: in primitive_tester
execute_controller(controller.apply_ref(primitive, *args, attempts=1), env)
tests/test_primitives.py:69: in execute_controller
for action in ctrl_gen:
omnigibson/action_primitives/starter_semantic_action_primitives.py:518: in apply_ref
yield from ctrl(*args)
omnigibson/action_primitives/starter_semantic_action_primitives.py:743: in _grasp
yield from self._navigate_if_needed(obj, pose_on_obj=grasp_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1663: in _navigate_if_needed
if self._target_in_reach_of_robot(pose_on_obj):
omnigibson/action_primitives/starter_semantic_action_primitives.py:913: in _target_in_reach_of_robot
return self._target_in_reach_of_robot_relative(relative_target_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:925: in _target_in_reach_of_robot_relative
return self._ik_solver_cartesian_to_joint_space(relative_target_pose) is not None
omnigibson/action_primitives/starter_semantic_action_primitives.py:965: in _ik_solver_cartesian_to_joint_space
robot_description_path=self._manipulation_descriptor_path,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <omnigibson.action_primitives.starter_semantic_action_primitives.StarterSemanticActionPrimitives object at 0x7f0e32124130>
@property
def _manipulation_descriptor_path(self):
"""The appropriate manipulation descriptor for the current settings."""
if isinstance(self.robot, Tiago) and m.TIAGO_TORSO_FIXED:
assert self.arm == "left", "Fixed torso mode only supports left arm!"
return self.robot.robot_arm_descriptor_yamls["left_fixed"]
# Otherwise just return the default arm control idx
> return self.robot.robot_arm_descriptor_yamls[self.arm]
E AttributeError: 'Tiago' object has no attribute 'robot_arm_descriptor_yamls'
omnigibson/action_primitives/starter_semantic_action_primitives.py:950: AttributeError
Check failure on line 0 in 12302141302-tests-test_primitives/test_primitives.xml
github-actions / Test Results
pytest ► tests.test_primitives.TestPrimitives ► test_place[Fetch]
Failed test found in:
12302141302-tests-test_primitives/test_primitives.xml
Error:
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a52d0>
Raw output
self = <test_primitives.TestPrimitives object at 0x7f0e4f9a52d0>
robot = 'Fetch'
def test_place(self, robot):
categories = ["floors", "ceilings", "walls", "coffee_table"]
env = setup_environment(categories, robot=robot)
objects = []
obj_1 = {
"object": DatasetObject(name="table", category="breakfast_table", model="rjgmmy", scale=[0.3, 0.3, 0.3]),
"position": [-0.7, 0.5, 0.2],
"orientation": [0, 0, 0, 1],
}
obj_2 = {
"object": DatasetObject(name="cologne", category="bottle_of_cologne", model="lyipur"),
"position": [-0.3, -0.8, 0.5],
"orientation": [0, 0, 0, 1],
}
objects.append(obj_1)
objects.append(obj_2)
primitives = [StarterSemanticActionPrimitiveSet.GRASP, StarterSemanticActionPrimitiveSet.PLACE_ON_TOP]
primitives_args = [(obj_2["object"],), (obj_1["object"],)]
> primitive_tester(env, objects, primitives, primitives_args)
tests/test_primitives.py:145:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_primitives.py:82: in primitive_tester
execute_controller(controller.apply_ref(primitive, *args, attempts=1), env)
tests/test_primitives.py:69: in execute_controller
for action in ctrl_gen:
omnigibson/action_primitives/starter_semantic_action_primitives.py:518: in apply_ref
yield from ctrl(*args)
omnigibson/action_primitives/starter_semantic_action_primitives.py:743: in _grasp
yield from self._navigate_if_needed(obj, pose_on_obj=grasp_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:1663: in _navigate_if_needed
if self._target_in_reach_of_robot(pose_on_obj):
omnigibson/action_primitives/starter_semantic_action_primitives.py:913: in _target_in_reach_of_robot
return self._target_in_reach_of_robot_relative(relative_target_pose)
omnigibson/action_primitives/starter_semantic_action_primitives.py:925: in _target_in_reach_of_robot_relative
return self._ik_solver_cartesian_to_joint_space(relative_target_pose) is not None
omnigibson/action_primitives/starter_semantic_action_primitives.py:965: in _ik_solver_cartesian_to_joint_space
robot_description_path=self._manipulation_descriptor_path,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <omnigibson.action_primitives.starter_semantic_action_primitives.StarterSemanticActionPrimitives object at 0x7f0e06504ac0>
@property
def _manipulation_descriptor_path(self):
"""The appropriate manipulation descriptor for the current settings."""
if isinstance(self.robot, Tiago) and m.TIAGO_TORSO_FIXED:
assert self.arm == "left", "Fixed torso mode only supports left arm!"
return self.robot.robot_arm_descriptor_yamls["left_fixed"]
# Otherwise just return the default arm control idx
> return self.robot.robot_arm_descriptor_yamls[self.arm]
E AttributeError: 'Fetch' object has no attribute 'robot_arm_descriptor_yamls'
omnigibson/action_primitives/starter_semantic_action_primitives.py:950: AttributeError
Check failure on line 0 in 12302141302-tests-test_scene_graph/test_scene_graph.xml
github-actions / Test Results
pytest ► tests.test_scene_graph ► test_scene_graph
Failed test found in:
12302141302-tests-test_scene_graph/test_scene_graph.xml
Error:
def test_scene_graph():
Raw output
def test_scene_graph():
if og.sim is None:
# Set global flags
gm.ENABLE_OBJECT_STATES = True
else:
# Make sure sim is stopped
og.sim.stop()
def create_robot_config(name, position):
return {
"name": name,
"type": "Fetch",
"obs_modalities": "all",
"position": position,
"orientation": T.euler2quat(th.tensor([0, 0, -math.pi / 2], dtype=th.float32)),
"controller_config": {
"arm_0": {
"name": "NullJointController",
"motor_type": "position",
},
},
}
robot_names = ["fetch_1", "fetch_2", "fetch_3"]
robot_positions = [[0, 0.8, 0], [1, 0.8, 0], [2, 0.8, 0]]
config = {
"scene": {
"type": "Scene",
},
"robots": [create_robot_config(name, position) for name, position in zip(robot_names, robot_positions)],
"objects": [
{
"type": "DatasetObject",
"fit_avg_dim_volume": True,
"name": "breakfast_table",
"category": "breakfast_table",
"model": "skczfi",
"prim_type": PrimType.RIGID,
"position": [150, 150, 150],
"scale": None,
"bounding_box": None,
"abilities": None,
"visual_only": False,
},
{
"type": "DatasetObject",
"fit_avg_dim_volume": True,
"name": "bowl",
"category": "bowl",
"model": "ajzltc",
"prim_type": PrimType.RIGID,
"position": [150, 150, 150],
"scale": None,
"bounding_box": None,
"abilities": None,
"visual_only": False,
},
],
}
env = og.Environment(configs=config)
scene = og.sim.scenes[0]
breakfast_table = scene.object_registry("name", "breakfast_table")
bowl = scene.object_registry("name", "bowl")
place_obj_on_floor_plane(breakfast_table)
bowl.set_position_orientation(position=[0.0, -0.8, 0.1], orientation=[0, 0, 0, 1])
# Test single robot scene graph
scene_graph_builder_single = SceneGraphBuilder(
robot_names=robot_names[:1], egocentric=False, full_obs=True, only_true=True, merge_parallel_edges=True
)
scene_graph_builder_single.start(scene)
for _ in range(3):
og.sim.step()
scene_graph_builder_single.step(scene)
assert isinstance(
> visualize_scene_graph(
scene, scene_graph_builder_single.get_scene_graph(), show_window=False, cartesian_positioning=True
),
th.Tensor,
)
tests/test_scene_graph.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
scene = <omnigibson.scenes.scene_base.Scene object at 0x7fbbe11ea920>
G = <networkx.classes.digraph.DiGraph object at 0x7fbb893de8f0>
show_window = False, cartesian_positioning = True
def visualize_scene_graph(scene, G, show_window=True, cartesian_positioning=False):
"""
Converts the graph into an image and shows it in a cv2 window if preferred.
Note: Currently, this function only works when we merge parallel edges, i.e. the graph is a DiGraph.
Args:
show_window (bool): Whether a cv2 GUI window containing the visualization should be shown.
realistic_positioning (bool): Whether nodes should be positioned based on their position in the scene (if True)
or placed using a graphviz layout (neato) that makes it easier to read edges & find clusters.
"""
nodes = list(G.nodes)
all_robots = [robot for robot in nodes if isinstance(robot, BaseRobot)]
def _draw_graph():
node_labels = {obj: obj.category for obj in nodes}
# get all objects in fov of robots
objects_in_fov = set()
for robot in all_robots:
objects_in_fov.update(robot.states[object_states.ObjectsInFOVOfRobot].get_value())
colors = [
("yellow" if obj.category == "agent" else ("green" if obj in objects_in_fov else "red")) for obj in nodes
]
positions = (
{obj: (-pose[1][-1], pose[0][-1]) for obj, pose in G.nodes.data("pose")}
if cartesian_positioning
else nx.nx_pydot.pydot_layout(G, prog="neato")
)
nx.drawing.draw_networkx(
G,
pos=positions,
labels=node_labels,
nodelist=nodes,
node_color=colors,
font_size=5,
arrowsize=5,
node_size=200,
)
edge_labels = {}
for edge in G.edges:
state_value_pairs = []
if len(edge) == 3:
# When we don't merge parallel edges
raise ValueError("Visualization does not support parallel edges.")
else:
# When we merge parallel edges
assert len(edge) == 2, "Invalid graph format for scene graph visualization."
for state, value in G.edges[edge]["states"]:
state_value_pairs.append(state + "=" + str(value))
edge_labels[edge] = ", ".join(state_value_pairs)
nx.drawing.draw_networkx_edge_labels(G, pos=positions, edge_labels=edge_labels, font_size=4)
# Prepare pyplot figure that's sized to match the robot video.
robot = all_robots[0] # If there are multiple robots, we only include the first one
> (robot_camera_sensor,) = [
s for s in robot.sensors.values() if isinstance(s, VisionSensor) and "rgb" in s.modalities
]
E ValueError: too many values to unpack (expected 1)
omnigibson/scene_graphs/graph_builder.py:285: ValueError