diff --git a/docs/conf.py b/docs/conf.py index d491177329..261d90f8da 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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" diff --git a/habitat-lab/habitat/articulated_agent_controllers/__init__.py b/habitat-lab/habitat/articulated_agent_controllers/__init__.py index 207bc2088a..707cf45e56 100644 --- a/habitat-lab/habitat/articulated_agent_controllers/__init__.py +++ b/habitat-lab/habitat/articulated_agent_controllers/__init__.py @@ -20,4 +20,6 @@ "HumanoidBaseController", "HumanoidRearrangeController", "HumanoidSeqPoseController", + "Pose", + "Motion", ] diff --git a/habitat-lab/habitat/articulated_agent_controllers/humanoid_base_controller.py b/habitat-lab/habitat/articulated_agent_controllers/humanoid_base_controller.py index 8aaa138bae..c54149365f 100644 --- a/habitat-lab/habitat/articulated_agent_controllers/humanoid_base_controller.py +++ b/habitat-lab/habitat/articulated_agent_controllers/humanoid_base_controller.py @@ -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. """ self.joints = list(joints_quat) self.root_transform = root_transform @@ -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 """ @@ -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. """ diff --git a/habitat-lab/habitat/articulated_agent_controllers/humanoid_rearrange_controller.py b/habitat-lab/habitat/articulated_agent_controllers/humanoid_rearrange_controller.py index a95dd7c813..f57fb3c969 100644 --- a/habitat-lab/habitat/articulated_agent_controllers/humanoid_rearrange_controller.py +++ b/habitat-lab/habitat/articulated_agent_controllers/humanoid_rearrange_controller.py @@ -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. @@ -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. diff --git a/habitat-lab/habitat/articulated_agent_controllers/humanoid_seq_pose_controller.py b/habitat-lab/habitat/articulated_agent_controllers/humanoid_seq_pose_controller.py index 0bcaceea80..cf00b9b112 100644 --- a/habitat-lab/habitat/articulated_agent_controllers/humanoid_seq_pose_controller.py +++ b/habitat-lab/habitat/articulated_agent_controllers/humanoid_seq_pose_controller.py @@ -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. @@ -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 """ diff --git a/habitat-lab/habitat/articulated_agents/__init__.py b/habitat-lab/habitat/articulated_agents/__init__.py index 199d14d741..12934a2c95 100644 --- a/habitat-lab/habitat/articulated_agents/__init__.py +++ b/habitat-lab/habitat/articulated_agents/__init__.py @@ -30,4 +30,6 @@ "ArticulatedAgentCameraParams", "StaticManipulator", "StaticManipulatorParams", + "humanoids", + "robots", ] diff --git a/habitat-lab/habitat/articulated_agents/articulated_agent_base.py b/habitat-lab/habitat/articulated_agents/articulated_agent_base.py index 57307b6ebc..1a03cb975a 100644 --- a/habitat-lab/habitat/articulated_agents/articulated_agent_base.py +++ b/habitat-lab/habitat/articulated_agents/articulated_agent_base.py @@ -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. diff --git a/habitat-lab/habitat/articulated_agents/mobile_manipulator.py b/habitat-lab/habitat/articulated_agents/mobile_manipulator.py index 437dde23e0..d5c9f1d1ab 100644 --- a/habitat-lab/habitat/articulated_agents/mobile_manipulator.py +++ b/habitat-lab/habitat/articulated_agents/mobile_manipulator.py @@ -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. """ @@ -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. + :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 """ @@ -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. diff --git a/habitat-lab/habitat/articulated_agents/robots/__init__.py b/habitat-lab/habitat/articulated_agents/robots/__init__.py index fb33d4d473..325765b666 100644 --- a/habitat-lab/habitat/articulated_agents/robots/__init__.py +++ b/habitat-lab/habitat/articulated_agents/robots/__init__.py @@ -18,4 +18,6 @@ "FrankaRobot", "SpotRobot", "StretchRobot", + "fetch_suction", + "spot_robot", ] diff --git a/habitat-lab/habitat/articulated_agents/robots/spot_robot.py b/habitat-lab/habitat/articulated_agents/robots/spot_robot.py index a3fc1b4537..52a8c5942d 100644 --- a/habitat-lab/habitat/articulated_agents/robots/spot_robot.py +++ b/habitat-lab/habitat/articulated_agents/robots/spot_robot.py @@ -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, diff --git a/habitat-lab/habitat/articulated_agents/static_manipulator.py b/habitat-lab/habitat/articulated_agents/static_manipulator.py index 8b620ba28c..e1c2b5d42a 100644 --- a/habitat-lab/habitat/articulated_agents/static_manipulator.py +++ b/habitat-lab/habitat/articulated_agents/static_manipulator.py @@ -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. diff --git a/habitat-lab/habitat/core/dataset.py b/habitat-lab/habitat/core/dataset.py index 00b823b74b..ba62f44cf4 100644 --- a/habitat-lab/habitat/core/dataset.py +++ b/habitat-lab/habitat/core/dataset.py @@ -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. """ diff --git a/habitat-lab/habitat/datasets/rearrange/samplers/receptacle.py b/habitat-lab/habitat/datasets/rearrange/samplers/receptacle.py index eabcd67f1a..91205b0a33 100644 --- a/habitat-lab/habitat/datasets/rearrange/samplers/receptacle.py +++ b/habitat-lab/habitat/datasets/rearrange/samplers/receptacle.py @@ -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. diff --git a/habitat-lab/habitat/gym/__init__.py b/habitat-lab/habitat/gym/__init__.py index e0a6636228..aa01ac8db2 100644 --- a/habitat-lab/habitat/gym/__init__.py +++ b/habitat-lab/habitat/gym/__init__.py @@ -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", +] diff --git a/habitat-lab/habitat/utils/__init__.py b/habitat-lab/habitat/utils/__init__.py index 073f350b23..b41a8cde92 100644 --- a/habitat-lab/habitat/utils/__init__.py +++ b/habitat-lab/habitat/utils/__init__.py @@ -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", +]