Skip to content

Commit

Permalink
better method names and descriptions, to match the comments on PR san…
Browse files Browse the repository at this point in the history
  • Loading branch information
bbean23 committed May 24, 2024
1 parent 02c97e1 commit 4341257
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions opencsp/common/lib/cv/AbstractFiducials.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,31 @@ def origin(self) -> p2.Pxy:

@property
@abstractmethod
def orientation(self) -> scipy.spatial.transform.Rotation:
def rotation(self) -> scipy.spatial.transform.Rotation:
"""
The orientation of the normal vector(s) of this instance.
This is relative to the orthorectified source image, where x is positive
The pointing of the normal vector(s) of this instance.
This is relative to the camera's reference frame, where x is positive
to the right, y is positive down, and z is positive in (away from the
camera).
This can be used to describe the forward transformation from the
camera's perspective. For example, an aruco marker whose origin is in
the center of the image and is facing towards the camera could have the
orientation::
rotation::
Rotation.from_euler('y', np.pi)
If that same aruco marker was also placed upside down, then it's
orientation could be::
rotation could be::
Rotation.from_euler(
'yz',
[ [np.pi, 0],
[0, np.pi] ]
)
Not that this just describes rotation, and not the translation. We call
the rotation and translation together the orientation.
"""

@property
Expand All @@ -83,7 +86,7 @@ def size(self) -> list[float]:
def scale(self) -> list[float]:
"""
The scale(s) of this fiducial, in meters, relative to its longest axis.
This can be used to determine the distance and orientation of the
This can be used to determine the distance and rotation of the
fiducial relative to the camera.
"""
ret = []
Expand Down
4 changes: 2 additions & 2 deletions opencsp/common/lib/cv/fiducials/BcsFiducial.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def origin(self) -> p2.Pxy:
return self.origin_px

@property
def orientation(self) -> scipy.spatial.transform.Rotation:
raise NotImplementedError("Orientation is not yet implemented for PointFiducials")
def rotation(self) -> scipy.spatial.transform.Rotation:
raise NotImplementedError("rotation is not yet implemented for PointFiducials")

@property
def size(self) -> list[float]:
Expand Down
2 changes: 1 addition & 1 deletion opencsp/common/lib/cv/fiducials/PointFiducials.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def origin(self) -> p2.Pxy:
return self.points

@property
def orientation(self) -> scipy.spatial.transform.Rotation:
def rotation(self) -> scipy.spatial.transform.Rotation:
raise NotImplementedError("Orientation is not yet implemented for PointFiducials")

@property
Expand Down

0 comments on commit 4341257

Please sign in to comment.