Skip to content
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

Exposed all existing documentation in Articulated_agents, articulated_agent_controllers, core, and config modules #1736

Merged
merged 9 commits into from
Jan 17, 2024
39 changes: 38 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,53 @@

# Overrides the __all__ as that one pulls everything into the root module
# and doesn't expose any submodules
habitat.__all__ = ["config", "core", "Agent", "Benchmark", "gym"]
habitat.__all__ = [
"config",
"core",
"gym",
"articulated_agent_controllers",
"articulated_agents",
"datasets",
"sims",
"tasks",
"utils",
]

habitat.core.__all__ = [
"agent",
"benchmark",
"env",
"embodied_task",
"dataset",
"simulator",
"registry",
"vector_env",
"batch_rendering",
"challenge",
"environments",
"logging",
]

habitat.datasets.__all__ = [
"eqa",
"image_nav",
"object_nav",
"pointnav",
"rearrange",
"vln",
]

habitat.datasets.rearrange__all__ = [
"combine_datasets",
"generate_episode",
"navmesh_utils",
"rearrange_dataset",
"rearrange_generator",
"run_episode_generator",
"samplers",
]


PROJECT_TITLE = "Habitat"
PROJECT_SUBTITLE = "Lab Docs"
PROJECT_LOGO = "../../habitat-sim/docs/habitat.svg"
Expand Down
2 changes: 2 additions & 0 deletions habitat-lab/habitat/articulated_agent_controllers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
"HumanoidBaseController",
"HumanoidRearrangeController",
"HumanoidSeqPoseController",
"Pose",
"Motion",
]
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class Pose:
def __init__(self, joints_quat, root_transform):
"""
Contains a single humanoid pose

:param joints_quat: list or array of num_joints * 4 elements, with the rotation quaternions
:param root_transform: Matrix4 with the root transform.
:param root_transform: Matrix4 with the root trasnform.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param root_transform: Matrix4 with the root trasnform.
:param root_transform: Matrix4 with the root transform.

"""
self.joints = list(joints_quat)
self.root_transform = root_transform
Expand All @@ -26,9 +27,11 @@ def __init__(self, joints_quat, root_transform):
class Motion:
"""
Contains a sequential motion, corresponding to a sequence of poses

:param joints_quat_array: num_poses x num_joints x 4 array, containing the join orientations
:param transform_array: num_poses x 4 x 4 array, containing the root transform
:param displacement: on each pose, how much forward displacement was there?

Used to measure how many poses we should advance to move a certain amount
:param fps: the FPS at which the motion was recorded
"""
Expand All @@ -52,6 +55,7 @@ def __init__(self, joints_quat_array, transform_array, displacement, fps):
class HumanoidBaseController:
"""
Generic class to replay SMPL-X motions

:param motion_fps: the FPS at which we should be playing the motion.
:param base_offset: what is the offset between the root of the character and their feet.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
class HumanoidRearrangeController(HumanoidBaseController):
"""
Humanoid Controller, converts high level actions such as walk, or reach into joints positions

:param walk_pose_path: file containing the walking poses we care about.
:param motion_fps: the FPS at which we should be advancing the pose.
:base_offset: what is the offset between the root of the character and their feet.
Expand Down Expand Up @@ -535,6 +536,7 @@ def inter_data(x_i, y_i, z_i, dat, is_quat=False):
"""
General trilinear interpolation function. Performs trilinear interpolation,
normalizing the result if the values are represented as quaternions (is_quat)

:param x_i, y_i, z_i: For the x,y,z dimensions, specifies the lower, upper, and normalized value
so that we can perform interpolation in 3 dimensions
:param data: the values we want to interpolate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
class HumanoidSeqPoseController(HumanoidBaseController):
"""
Humanoid Seq Pose Controller, replays a sequence of humanoid poses.

:param motion_pose_path: file containing the motion poses we want to play.
:param motion_fps: the FPS at which we should be advancing the pose.
:param base_offset: what is the offset between the root of the character and their feet.
Expand Down Expand Up @@ -64,6 +65,7 @@ def reset(self, base_transformation: mn.Matrix4) -> None:
def next_pose(self, cycle=False) -> None:
"""
Move to the next pose in the motion sequence

:param cycle: boolean indicating whether we should stop or cycle when reaching the last pose
"""

Expand Down
2 changes: 2 additions & 0 deletions habitat-lab/habitat/articulated_agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@
"ArticulatedAgentCameraParams",
"StaticManipulator",
"StaticManipulatorParams",
"humanoids",
"robots",
]
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
**kwargs,
):
r"""Constructor

:param params: The parameter of the base articulated agent.
:param urdf_path: The path to the articulated agent's URDF file.
:param sim: The simulator.
Expand Down
43 changes: 16 additions & 27 deletions habitat-lab/habitat/articulated_agents/mobile_manipulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
@attr.s(auto_attribs=True, slots=True)
class ArticulatedAgentCameraParams:
"""Data to configure a camera placement on the articulated agent.
:property attached_link_id: Which link ID this camera is attached to, -1
for the base link.
:property cam_offset_pos: The 3D position of the camera relative to the
transformation of the attached link.
:property cam_look_at_pos: The 3D of where the camera should face relative
to the transformation of the attached link.

:property attached_link_id: Which link ID this camera is attached to, -1 for the base link.
:property cam_offset_pos: The 3D position of the camera relative to the transformation of the attached link.
:property cam_look_at_pos: The 3D of where the camera should face relative to the transformation of the attached link.
:property relative_transform: An added local transform for the camera.
"""

Expand All @@ -38,35 +36,25 @@ class ArticulatedAgentCameraParams:
@attr.s(auto_attribs=True, slots=True)
class MobileManipulatorParams:
"""Data to configure a mobile manipulator.

:property arm_joints: The joint ids of the arm joints.
:property gripper_joints: The habitat sim joint ids of any grippers.
:property wheel_joints: The joint ids of the wheels. If the wheels are not controlled, then this should be None
:property arm_init_params: The starting joint angles of the arm. If None,
resets to 0.
:property gripper_init_params: The starting joint positions of the gripper. If None,
resets to 0.
:property ee_offset: The 3D offset from the end-effector link to the true
end-effector position.
:property arm_init_params: The starting joint angles of the arm. If None, resets to 0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping the docstring like it was before shouldn't cause any problems for the doc generator. The successive lines just need to be indented respective to the first :property : line.

:property gripper_init_params: The starting joint positions of the gripper. If None, resets to 0.
:property ee_offset: The 3D offset from the end-effector link to the true end-effector position.
:property ee_links: A list with the Habitat Sim link ID of the end-effector.
:property ee_constraint: A (ee_count, 2, N) shaped array specifying the upper and
lower limits for each end-effector joint where N is the arm DOF.
:property cameras: The cameras and where they should go. The key is the
prefix to match in the sensor names. For example, a key of `"head"`
will match sensors `"head_rgb"` and `"head_depth"`
:property gripper_closed_state: All gripper joints must achieve this
state for the gripper to be considered closed.
:property gripper_open_state: All gripper joints must achieve this
state for the gripper to be considered open.
:property ee_constraint: A (ee_count, 2, N) shaped array specifying the upper and lower limits for each end-effector joint where N is the arm DOF.
:property cameras: The cameras and where they should go. The key is the prefix to match in the sensor names. For example, a key of `"head"`will match sensors `"head_rgb"` and `"head_depth"`
:property gripper_closed_state: All gripper joints must achieve this state for the gripper to be considered closed.
:property gripper_open_state: All gripper joints must achieve this state for the gripper to be considered open.
:property gripper_state_eps: Error margin for detecting whether gripper is closed.
:property arm_mtr_pos_gain: The position gain of the arm motor.
:property arm_mtr_vel_gain: The velocity gain of the arm motor.
:property arm_mtr_max_impulse: The maximum impulse of the arm motor.
:property wheel_mtr_pos_gain: The position gain of the wheeled motor (if
there are wheels).
:property wheel_mtr_vel_gain: The velocity gain of the wheel motor (if
there are wheels).
:property wheel_mtr_max_impulse: The maximum impulse of the wheel motor (if
there are wheels).
:property wheel_mtr_pos_gain: The position gain of the wheeled motor (if there are wheels).
:property wheel_mtr_vel_gain: The velocity gain of the wheel motor (if there are wheels).
:property wheel_mtr_max_impulse: The maximum impulse of the wheel motor (if there are wheels).
:property base_offset: The offset of the root transform from the center ground point for navmesh kinematic control.
:property ee_count: how many end effectors
"""
Expand Down Expand Up @@ -116,6 +104,7 @@ def __init__(
base_type="mobile",
):
r"""Constructor

:param params: The parameter of the manipulator articulated agent.
:param agent_cfg: Config to the agent. Contains urdf_path to URDF file.
:param sim: The simulator.
Expand Down
2 changes: 2 additions & 0 deletions habitat-lab/habitat/articulated_agents/robots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
"FrankaRobot",
"SpotRobot",
"StretchRobot",
"fetch_suction",
"spot_robot",
]
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@attr.s(auto_attribs=True, slots=True)
class SpotParams:
"""Data to configure a mobile manipulator.

:property arm_joints: The joint ids of the arm joints.
:property gripper_joints: The habitat sim joint ids of any grippers.
:property arm_init_params: The starting joint angles of the arm. If None,
Expand Down
22 changes: 9 additions & 13 deletions habitat-lab/habitat/articulated_agents/static_manipulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@

@attr.s(auto_attribs=True, slots=True)
class StaticManipulatorParams:
"""Data to configure a static manipulator.
"""
Data to configure a static manipulator.

:property arm_joints: The joint ids of the arm joints.
:property gripper_joints: The habitat sim joint ids of any grippers.
:property arm_init_params: The starting joint angles of the arm. If None,
resets to 0.
:property gripper_init_params: The starting joint positions of the gripper. If None,
resets to 0.
:property ee_offset: The 3D offset from the end-effector link to the true
end-effector position.
:property arm_init_params: The starting joint angles of the arm. If None, resets to 0.
:property gripper_init_params: The starting joint positions of the gripper. If None, resets to 0.
:property ee_offset: The 3D offset from the end-effector link to the true end-effector position.
:property ee_links: A list with the Habitat Sim link ID of the end-effector.
:property ee_constraint: A (ee_count, 2, N) shaped array specifying the upper and
lower limits for each end-effector joint where N is the arm DOF.
:property gripper_closed_state: All gripper joints must achieve this
state for the gripper to be considered closed.
:property gripper_open_state: All gripper joints must achieve this
state for the gripper to be considered open.
:property ee_constraint: A (ee_count, 2, N) shaped array specifying the upper and lower limits for each end-effector joint where N is the arm DOF.
:property gripper_closed_state: All gripper joints must achieve this state for the gripper to be considered closed.
:property gripper_open_state: All gripper joints must achieve this state for the gripper to be considered open.
:property gripper_state_eps: Error margin for detecting whether gripper is closed.
:property arm_mtr_pos_gain: The position gain of the arm motor.
:property arm_mtr_vel_gain: The velocity gain of the arm motor.
Expand Down
1 change: 1 addition & 0 deletions habitat-lab/habitat/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class BaseEpisode:
Base class for episode specification that includes only the episode_id
and scene id. This class allows passing the minimum required episode
information to identify the episode (unique key) to the habitat baseline process, thus saving evaluation time.

:property episode_id: id of episode in the dataset, usually episode number.
:property scene_id: id of scene in dataset.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def parse_receptacles_from_user_config(

:param user_subconfig: The Configuration object containing metadata parsed from the "user_defined" JSON field for rigid/articulated object and stage configs.
:param parent_object_handle: The instance handle of the rigid or articulated object to which constructed Receptacles are attached. None or globally defined stage Receptacles.
:param valid_link_names: An indexed list of link names for validating configured Receptacle attachments. Provided only for ArticulatedObjects.
:param parent_template_directory: The filesystem directory path containing the configuration file. Used to construct the absolute asset path from the relative asset path.
:param valid_link_names: An indexed list of link names for validating configured Receptacle attachments. Provided only for ArticulatedObjects.
:param ao_uniform_scaling: Uniform scaling applied to the parent AO is applied directly to the Receptacle.

Expand Down
8 changes: 7 additions & 1 deletion habitat-lab/habitat/gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@

from habitat.gym.gym_definitions import make_gym_from_config

__all__ = ["make_gym_from_config"]
__all__ = [
"make_gym_from_config",
"gym_env_episode_count_wrapper",
"gym_env_obs_dict_wrapper",
"gym_wrapper",
"gym_definitions",
]
9 changes: 8 additions & 1 deletion habitat-lab/habitat/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

__all__ = ["visualizations", "geometry_utils", "common"]
__all__ = [
"visualizations",
"geometry_utils",
"common",
"env_utils",
"pickle5_multiprocessing",
"profiling_wrapper",
]