Skip to content

Commit

Permalink
More fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgokmen committed Oct 28, 2023
1 parent 1f582d6 commit 846aa9d
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 84 deletions.
152 changes: 83 additions & 69 deletions omnigibson/action_primitives/starter_semantic_action_primitives.py

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions omnigibson/configs/tiago_primitives.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ robots:
command_input_limits: [-1, 1]
command_output_limits: null
use_delta_commands: true
use_single_command: true
gripper_right:
name: JointController
motor_type: position
command_input_limits: [-1, 1]
command_output_limits: null
use_delta_commands: true
use_single_command: true
camera:
name: JointController
motor_type: "velocity"
Expand Down
7 changes: 1 addition & 6 deletions omnigibson/controllers/joint_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def __init__(
command_output_limits="default",
use_delta_commands=False,
compute_delta_in_quat_space=None,
use_single_command=False,
):
"""
Args:
Expand Down Expand Up @@ -57,17 +56,13 @@ def __init__(
joints that need to be processed in quaternion space to avoid gimbal lock issues normally faced by
3 DOF rotation joints. Each group needs to consist of three idxes corresponding to the indices in
the input space. This is only used in the delta_commands mode.
use_single_command (bool): whether all related joints should be controlled with one (scaled) input or
independent values individually. If True, then the inputted command should be a single value.
"""
# Store arguments
assert_valid_key(key=motor_type.lower(), valid_keys=ControlType.VALID_TYPES_STR, name="motor_type")
self._motor_type = motor_type.lower()
self._use_delta_commands = use_delta_commands
self._compute_delta_in_quat_space = [] if compute_delta_in_quat_space is None else compute_delta_in_quat_space

self._use_single_command = use_single_command

# When in delta mode, it doesn't make sense to infer output range using the joint limits (since that's an
# absolute range and our values are relative). So reject the default mode option in that case.
assert not (
Expand Down Expand Up @@ -151,4 +146,4 @@ def control_type(self):

@property
def command_dim(self):
return 1 if self._use_single_command else len(self.dof_idx)
return len(self.dof_idx)
4 changes: 0 additions & 4 deletions omnigibson/scene_graphs/graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
from omnigibson.object_states.object_state_base import AbsoluteObjectState, BooleanStateMixin, RelativeObjectState
from omnigibson.utils import transform_utils as T

m = create_module_macros(module_path=__file__)

m.DRAW_EVERY = 1


def _formatted_aabb(obj):
return T.pose2mat((obj.aabb_center, [0, 0, 0, 1])), obj.aabb_extent
Expand Down
2 changes: 0 additions & 2 deletions tests/test_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ def primitive_tester(load_object_categories, objects, primitives, primitives_arg
"command_input_limits": [-1, 1],
"command_output_limits": None,
"use_delta_commands": True,
"use_single_command": True
},
"gripper_right": {
"name": "JointController",
"motor_type": "position",
"command_input_limits": [-1, 1],
"command_output_limits": None,
"use_delta_commands": True,
"use_single_command": True
},
"camera": {
"name": "JointController",
Expand Down
1 change: 0 additions & 1 deletion tests/test_symbolic_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def start_env():
],
"command_output_limits": None,
"use_delta_commands": True,
"use_single_command": True
},
"camera": {
"name": "JointController",
Expand Down

0 comments on commit 846aa9d

Please sign in to comment.