Skip to content

Commit

Permalink
Fix typos in tutorials and examples. (#2285)
Browse files Browse the repository at this point in the history
  • Loading branch information
0mdc committed Dec 15, 2023
1 parent 11cf389 commit 278ec21
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion examples/colab_utils/colab_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ python -c 'import google.colab' 2>/dev/null || exit
trap 'catch $? $LINENO' EXIT # Installs trap now
catch() {
if [ "$1" != "0" ]; then
echo "An error occured during the installation of Habitat-sim or Habitat-Lab." >&2
echo "An error occurred during the installation of Habitat-sim or Habitat-Lab." >&2
fi
}
#Don't change the colab versions for these libraries
Expand Down
8 changes: 4 additions & 4 deletions examples/fairmotion_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def setup_default_metadata(self) -> None:
if not os.path.isdir(METADATA_DIR):
os.makedirs(METADATA_DIR)

# if default file isnt in metadata directory, create it from hardcoded metadata
# if default file isn't in metadata directory, create it from hardcoded metadata
if not os.path.exists(METADATA_DIR + "default.json"):
self.user_metadata = METADATA_DEFAULT_WHEN_MISSING_FILE
self.save_metadata("default")
Expand Down Expand Up @@ -717,7 +717,7 @@ def process_action_order(self) -> None:

################# CODE FOR TRANSITIVE MOTION #################
if action_order.motion_data.type == MType.TRANSITIVE:
# track whether action is finised being processed
# track whether action is finished being processed
finished_processing = False

while Timer.check() < (THRESHOLD / self.draw_fps):
Expand Down Expand Up @@ -1010,7 +1010,7 @@ def update_pathfollower_sequential(
mocap_time_curr = math.fmod(path_.time, motion_.time_length)
mocap_frame = int(mocap_time_curr * motion_.fps)

# handle wrapping or edgecase for dath displacement passing goal
# handle wrapping or edgecase for path displacement passing goal
# find distance progressed along shortest path
path_displacement = (
mocap_cycles_past * motion_.map_of_total_displacement[LAST]
Expand Down Expand Up @@ -1083,7 +1083,7 @@ def global_correction_quat(
self, up_v: mn.Vector3, forward_v: mn.Vector3
) -> mn.Quaternion:
"""
Given the upward direction and the forward direction of a local space frame, this methd produces
Given the upward direction and the forward direction of a local space frame, this method produces
the correction quaternion to convert the frame to global space (+Y up, -Z forward).
"""
if up_v.normalized() != mn.Vector3.y_axis():
Expand Down
4 changes: 2 additions & 2 deletions examples/fairmotion_interface_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class MType(Enum):
"""
This emun class represents the two ways that motion data can be setup and used.
This enum class represents the two ways that motion data can be setup and used.
Transitive motion data is used to configure and make available cyclical motion data
that is needed for the character to traverse paths and displace the character between
Scenic actions. Scenic motion data is more performative in nature and is used to
Expand Down Expand Up @@ -311,7 +311,7 @@ class Preview(Enum):
ALL = 3


# keeps track of the activity that intances model is participating in currently
# keeps track of the activity that instances model is participating in currently
class Activity(Enum):
NONE = 0
MOTION_STAGE = 1
Expand Down
8 changes: 4 additions & 4 deletions examples/motion_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(
# perpetual motion generator
self.perpetual = False

# FPOV for farimotion character
# FPOV for fairmotion character
self.first_person = False

self.navmesh_config_and_recompute()
Expand Down Expand Up @@ -442,7 +442,7 @@ def mouse_scroll_event(self, event: Application.MouseScrollEvent) -> None:

def cycle_mouse_mode(self):
"""
Cycles through mouse modes that belong to the MouseMode emun.
Cycles through mouse modes that belong to the MouseMode enum.
"""
self.mouse_interaction = MouseMode(
(self.mouse_interaction.value + 1) % len(MouseMode)
Expand Down Expand Up @@ -659,7 +659,7 @@ def print_help_text(self) -> None:
In MOTION mode (with 'enable-physics'):
LEFT:
Click a Fairmotion character to set it as selected or clcik anywhere else to deselect.
Click a Fairmotion character to set it as selected or click anywhere else to deselect.
RIGHT (With selected Fairmotion character):
Click anywhere on the scene to translate a selected Fairmotion character to the clicked location.
WHEEL (with selected Fairmotion character):
Expand Down Expand Up @@ -707,7 +707,7 @@ def print_help_text(self) -> None:
(+ ALT) Move to random place in path with character.
Action Sequencing:
'i': Load model to playout action orders pendng in order queue.
'i': Load model to playout action orders pending in order queue.
'u': Push random action orders from Action Order Library to order queue.
=========================================================
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
" )\n",
" res_dict[\"house_filename\"] = (scene_template.house_filename, True, \"string\")\n",
" # res_dict[\"light_setup\"] = (scene_template.light_setup, True, \"string\")\n",
" # res_dict[\"frustrum_culling\"] = (scene_template.frustrum_culling, True, \"boolean\")\n",
" # res_dict[\"frustum_culling\"] = (scene_template.frustum_culling, True, \"boolean\")\n",
" return res_dict\n",
"\n",
"\n",
Expand Down
14 changes: 7 additions & 7 deletions examples/tutorials/colabs/ECCV_2020_Interactivity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
"source": [
"# @title Initialize Simulator and Load Scene { display-mode: \"form\" }\n",
"\n",
"# convienience functions defined in Utility cell manage global variables\n",
"# convenience functions defined in Utility cell manage global variables\n",
"sim_settings = make_default_settings()\n",
"# set globals: sim,\n",
"make_simulator_from_settings(sim_settings)"
Expand Down Expand Up @@ -622,7 +622,7 @@
"\n",
"# @markdown Choose either the primitive or file-based template recently selected in the dropdown:\n",
"obj_template_handle = sel_file_obj_handle\n",
"asset_tempalte_handle = sel_asset_handle\n",
"asset_template_handle = sel_asset_handle\n",
"object_type = \"File-based\" # @param [\"File-based\",\"Primitive-based\"]\n",
"if \"File\" in object_type:\n",
" # Handle File-based object handle\n",
Expand Down Expand Up @@ -825,7 +825,7 @@
"outputs": [],
"source": [
"# @title Physical Plausibility Classification { display-mode: \"form\" }\n",
"# @markdown This example demonstrates a physical plausibility expirement. A sphere\n",
"# @markdown This example demonstrates a physical plausibility experiment. A sphere\n",
"# @markdown is dropped onto the back of a couch to roll onto the floor. Optionally,\n",
"# @markdown an invisible plane is introduced for the sphere to roll onto producing\n",
"# @markdown non-physical motion.\n",
Expand Down Expand Up @@ -974,7 +974,7 @@
"source": [
"## Generating Scene Clutter on the NavMesh\n",
"\n",
"The NavMesh can be used to place objects on surfaces in the scene. Once objects are placed they can be set to MotionType::STATIC, indiciating that they are not moveable (kinematics and dynamics are disabled for STATIC objects). The NavMesh can then be recomputed including STATIC object meshes in the voxelization.\n",
"The NavMesh can be used to place objects on surfaces in the scene. Once objects are placed they can be set to MotionType::STATIC, indicating that they are not moveable (kinematics and dynamics are disabled for STATIC objects). The NavMesh can then be recomputed including STATIC object meshes in the voxelization.\n",
"\n",
"This example demonstrates using the NavMesh to generate a cluttered scene for navigation. In this script we will:\n",
"\n",
Expand Down Expand Up @@ -1093,7 +1093,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The following example demonstrates setup and excecution of an embodied navigation and interaction scenario. An object and an agent embodied by a rigid locobot mesh are placed randomly on the NavMesh. A path is computed for the agent to reach the object which is executed by a continuous path-following controller. The object is then kinematically gripped by the agent and a second path is computed for the agent to reach a goal location, also executed by a continuous controller. The gripped object is then released and thrown in front of the agent.\n",
"The following example demonstrates setup and execution of an embodied navigation and interaction scenario. An object and an agent embodied by a rigid locobot mesh are placed randomly on the NavMesh. A path is computed for the agent to reach the object which is executed by a continuous path-following controller. The object is then kinematically gripped by the agent and a second path is computed for the agent to reach a goal location, also executed by a continuous controller. The gripped object is then released and thrown in front of the agent.\n",
"\n",
"Note: for a more detailed explanation of the NavMesh see Habitat-sim Basics tutorial."
]
Expand Down Expand Up @@ -1263,7 +1263,7 @@
" )\n",
"\n",
"\n",
"# grip/release and sync gripped object state kineamtically\n",
"# grip/release and sync gripped object state kinematically\n",
"class ObjectGripper:\n",
" def __init__(\n",
" self,\n",
Expand Down Expand Up @@ -1461,7 +1461,7 @@
" locobot_obj.translation = end_pos\n",
" locobot_obj.rotation = target_rigid_state.rotation\n",
"\n",
" # Check if a collision occured\n",
" # Check if a collision occurred\n",
" dist_moved_before_filter = (\n",
" target_rigid_state.translation - previous_rigid_state.translation\n",
" ).dot()\n",
Expand Down
20 changes: 10 additions & 10 deletions examples/tutorials/colabs/ECCV_2020_Navigation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"source": [
"### Basic settings\n",
"\n",
"To begin with, we specify a scene we are going to load, designate a default agent, and describe a couple of basic sensor parameters, such as the type, position, resolution of the obeservation (width and height)."
"To begin with, we specify a scene we are going to load, designate a default agent, and describe a couple of basic sensor parameters, such as the type, position, resolution of the observation (width and height)."
]
},
{
Expand Down Expand Up @@ -575,7 +575,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"A navigation mesh (NavMesh) is a collection of two-dimensional convex polygons (i.e., a polygon mesh) that define which areas of an environment are traversable by an agent with a particular embodiement. In other words, an agent could freely navigate around within these areas unobstructed by objects, walls, gaps, overhangs, or other barriers that are part of the environment. Adjacent polygons are connected to each other in a graph enabling efficient pathfinding algorithms to chart routes between points on the NavMesh as visualized below.\n",
"A navigation mesh (NavMesh) is a collection of two-dimensional convex polygons (i.e., a polygon mesh) that define which areas of an environment are traversable by an agent with a particular embodiment. In other words, an agent could freely navigate around within these areas unobstructed by objects, walls, gaps, overhangs, or other barriers that are part of the environment. Adjacent polygons are connected to each other in a graph enabling efficient pathfinding algorithms to chart routes between points on the NavMesh as visualized below.\n",
"<div>\n",
"<img src=\"https://github.com/recastnavigation/recastnavigation/raw/main/Docs/Images/screenshot.png\" width=\"300\"/>\n",
"</div>\n",
Expand Down Expand Up @@ -648,7 +648,7 @@
"\n",
"print(\"The NavMesh bounds are: \" + str(sim.pathfinder.get_bounds()))\n",
"if not custom_height:\n",
" # get bounding box minumum elevation for automatic height\n",
" # get bounding box minimum elevation for automatic height\n",
" height = sim.pathfinder.get_bounds()[0][1]\n",
"\n",
"if not sim.pathfinder.is_loaded:\n",
Expand Down Expand Up @@ -736,7 +736,7 @@
"\n",
" # @markdown ---\n",
" # @markdown ### Visualization\n",
" # @markdown Running this cell generates a topdown visualization of the NavMesh with sampled points overlayed.\n",
" # @markdown Running this cell generates a topdown visualization of the NavMesh with sampled points overlaid.\n",
" meters_per_pixel = 0.1 # @param {type:\"slider\", min:0.01, max:1.0, step:0.01}\n",
"\n",
" if display:\n",
Expand Down Expand Up @@ -929,15 +929,15 @@
" - **agent_max_slope** - The maximum slope that is considered navigable. [Limits: 0 <= value < 85] [Units: Degrees]\n",
"\n",
"- **Navigable area filtering options** (default active):\n",
" - **filter_low_hanging_obstacles** - Marks navigable spans as non-navigable if the clearence above the span is less than the specified height.\n",
" - **filter_low_hanging_obstacles** - Marks navigable spans as non-navigable if the clearance above the span is less than the specified height.\n",
" - **filter_ledge_spans** - Marks spans that are ledges as non-navigable. This filter reduces the impact of the overestimation of conservative voxelization so the resulting mesh will not have regions hanging in the air over ledges.\n",
" - **filter_walkable_low_height_spans** - Marks navigable spans as non-navigable if the clearence above the span is less than the specified height. Allows the formation of navigable regions that will flow over low lying objects such as curbs, and up structures such as stairways.\n",
" - **filter_walkable_low_height_spans** - Marks navigable spans as non-navigable if the clearance above the span is less than the specified height. Allows the formation of navigable regions that will flow over low lying objects such as curbs, and up structures such as stairways.\n",
"\n",
"- **Detail mesh generation parameters**:\n",
" - **region_min_size** - Minimum number of cells allowed to form isolated island areas.\n",
" - **region_merge_size** - Any 2-D regions with a smaller span (cell count) will, if possible, be merged with larger regions. [Limit: >=0]\n",
" - **edge_max_len** - The maximum allowed length for contour edges along the border of the mesh. Extra vertices will be inserted as needed to keep contour edges below this length. A value of zero effectively disables this feature. [Limit: >=0] [ / cell_size]\n",
" - **edge_max_error** - The maximum distance a simplfied contour's border edges should deviate the original raw contour. [Limit: >=0]\n",
" - **edge_max_error** - The maximum distance a simplified contour's border edges should deviate the original raw contour. [Limit: >=0]\n",
" - **verts_per_poly** - The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.[Limit: >= 3]\n",
" - **detail_sample_dist** - Sets the sampling distance to use when generating the detail mesh. (For height detail only.) [Limits: 0 or >= 0.9] [x cell_size]\n",
" - **detail_sample_max_error** - The maximum distance the detail mesh surface should deviate from heightfield data. (For height detail only.) [Limit: >=0] [x cell_height]\n",
Expand Down Expand Up @@ -1123,7 +1123,7 @@
"The following example demonstrates taking random agent actions on the NavMesh. Both continuous and discrete action spaces are available. Sliding vs. non-sliding scenarios are compared.\n",
"\n",
"## What is sliding?\n",
"Most game engines allow agents to slide along obstacles when commanding actions which collide with the environment. While this is a reasonable behavior in games, it does not accuractely reflect the result of collisions between robotic agents and the environment.\n",
"Most game engines allow agents to slide along obstacles when commanding actions which collide with the environment. While this is a reasonable behavior in games, it does not accurately reflect the result of collisions between robotic agents and the environment.\n",
"\n",
"We note that **allowing sliding** makes training easier and results in higher simulation performance, but **hurts sim-2-real transfer** of trained policies.\n",
"\n",
Expand Down Expand Up @@ -1279,7 +1279,7 @@
" )\n",
" agent.set_state(agent_state)\n",
"\n",
" # Check if a collision occured\n",
" # Check if a collision occurred\n",
" dist_moved_before_filter = (\n",
" target_rigid_state.translation - previous_rigid_state.translation\n",
" ).dot()\n",
Expand All @@ -1303,7 +1303,7 @@
" print(\"frames = \" + str(len(observations)))\n",
" # video rendering with embedded 1st person view\n",
" if do_make_video:\n",
" # use the vieo utility to render the observations\n",
" # use the video utility to render the observations\n",
" vut.make_video(\n",
" observations=observations,\n",
" primary_obs=\"color_sensor\",\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/colabs/asset_viewer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@
" # set object to be static\n",
" obj.motion_type = habitat_sim.physics.MotionType.STATIC\n",
"\n",
" # initialize an agent and set its intial state\n",
" # initialize an agent and set its initial state\n",
" agent = sim.initialize_agent(sim_settings[\"default_agent\"])\n",
" agent_state = habitat_sim.AgentState()\n",
" agent_state.position = np.array([0.0, 0.0, 0.0]) # in world space\n",
Expand All @@ -854,7 +854,7 @@
" # Create observations array\n",
" observations = []\n",
"\n",
" # @markdown Set how long the resutlant video should be, in seconds. The object will make 1 full revolution during this time.\n",
" # @markdown Set how long the resultant video should be, in seconds. The object will make 1 full revolution during this time.\n",
" video_length = 4.8 # @param {type:\"slider\", min:1.0, max:20.0, step:0.1}\n",
" # Sim time step\n",
" time_step = 1.0 / 60.0\n",
Expand Down
6 changes: 3 additions & 3 deletions examples/tutorials/colabs/managed_rigid_object_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@
"source": [
" # [embodied_agent]\n",
"\n",
" # load the lobot_merged asset\n",
" # load the locobot_merged asset\n",
" locobot_template_id = obj_templates_mgr.load_configs(\n",
" str(os.path.join(data_path, \"objects/locobot_merged\"))\n",
" )[0]\n",
Expand Down Expand Up @@ -543,7 +543,7 @@
"source": [
" # [embodied_agent_navmesh]\n",
"\n",
" # load the lobot_merged asset\n",
" # load the locobot_merged asset\n",
" locobot_template_id = obj_templates_mgr.load_configs(\n",
" str(os.path.join(data_path, \"objects/locobot_merged\"))\n",
" )[0]\n",
Expand Down Expand Up @@ -599,7 +599,7 @@
" locobot.translation = end_pos\n",
" locobot.rotation = target_rigid_state.rotation\n",
"\n",
" # Check if a collision occured\n",
" # Check if a collision occurred\n",
" dist_moved_before_filter = (\n",
" target_rigid_state.translation - previous_rigid_state.translation\n",
" ).dot()\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def build_dict_of_Stage_attrs(scene_template):
)
res_dict["house_filename"] = (scene_template.house_filename, True, "string")
# res_dict["light_setup"] = (scene_template.light_setup, True, "string")
# res_dict["frustrum_culling"] = (scene_template.frustrum_culling, True, "boolean")
# res_dict["frustum_culling"] = (scene_template.frustum_culling, True, "boolean")
return res_dict


Expand Down
Loading

0 comments on commit 278ec21

Please sign in to comment.