Skip to content

Commit

Permalink
correct typos
Browse files Browse the repository at this point in the history
  • Loading branch information
tkclam committed Jan 16, 2025
1 parent 96ffb41 commit 10b9340
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions flygym/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from abc import ABC, abstractmethod

# Would like it to always draw gravitiy in the upper right corner
# Would like it to always draw gravity in the upper right corner
# Check if contact need to be drawn (outside of the image)
# New gravity camera

Expand Down Expand Up @@ -54,7 +54,7 @@ def __init__(
output_path: Optional[Union[str, Path]] = None,
):
"""Initialize a Camera that can be attached to any attachable element and take any mujoco inbuilt parameters.
A set of preset congigurations are available in the config file:
A set of preset configurations are available in the config file:
- Simple cameras like: "camera_top" "camera_right", "camera_left",
"camera_front", "camera_back", "camera_bottom"
- Compound rotated cameras with different zoom levels: "camera_top_right", "camera_top_zoomout"
Expand All @@ -68,9 +68,9 @@ def __init__(
Parameters
----------
attachment_point: dm_control.mjcf.element._AttachableElement
Attachement point pf the camera
Attachment point pf the camera
attachment_name : str
Name of the attachement point
Name of the attachment point
targeted_flies_id: List(int)
Index of the flies the camera is looking at. The first index is the focused fly that is tracked if using a
complex camera. The rest of the indices are used to draw the contact forces.
Expand Down Expand Up @@ -136,7 +136,7 @@ def __init__(

camera_parameters["name"] = camera_name

# get a first value before spawning: usefull for the zstab cam
# get a first value before spawning: useful for the zstab cam
self.camera_base_offset = np.array(camera_parameters.get("pos", np.zeros(3)))

self._cam, self.camera_id = self._add_camera(
Expand Down Expand Up @@ -189,13 +189,13 @@ def __init__(
self._frames: list[np.ndarray] = []
self._timestamp_per_frame: list[float] = []

def _add_camera(self, attachement, camera_parameters, attachement_name):
def _add_camera(self, attachment, camera_parameters, attachment_name):
"""Add a camera to the model."""
camera = attachement.add("camera", **camera_parameters)
if attachement_name is None:
camera = attachment.add("camera", **camera_parameters)
if attachment_name is None:
camera_id = camera.name
else:
camera_id = attachement_name + "/" + camera.name
camera_id = attachment_name + "/" + camera.name

return camera, camera_id

Expand Down Expand Up @@ -495,7 +495,7 @@ class ZStabCamera(Camera):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Raise error if targetted flies are empty
# Raise error if targeted flies are empty
if len(self.targeted_flies_id) == 0:
raise ValueError(
"No flies are targeted by the camera. "
Expand Down

0 comments on commit 10b9340

Please sign in to comment.