Skip to content

Commit 8ba6395

Browse files
authored
Merge pull request #27 from bit-bots/migration/rotation_to_quaternion
DB Model: change Rotation from roll,pitch to quaternion
2 parents 5bcdd48 + fb6ebed commit 8ba6395

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ddlitlab2024/dataset/models.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,19 @@ class Rotation(Base):
9494
_id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
9595
stamp: Mapped[float] = mapped_column(Float, nullable=False)
9696
recording_id: Mapped[int] = mapped_column(Integer, ForeignKey("Recording._id"), nullable=False)
97-
roll: Mapped[float] = mapped_column(Float, nullable=False)
98-
pitch: Mapped[float] = mapped_column(Float, nullable=False)
97+
x: Mapped[float] = mapped_column(Float, nullable=False)
98+
y: Mapped[float] = mapped_column(Float, nullable=False)
99+
z: Mapped[float] = mapped_column(Float, nullable=False)
100+
w: Mapped[float] = mapped_column(Float, nullable=False)
99101

100102
recording: Mapped["Recording"] = relationship("Recording", back_populates="rotations")
101103

102104
__table_args__ = (
103105
CheckConstraint("stamp >= 0"),
104-
CheckConstraint("roll >= 0 AND roll < 2 * pi()"),
105-
CheckConstraint("pitch >= 0 AND pitch < 2 * pi()"),
106+
CheckConstraint("x >= -1 AND x <= 1"),
107+
CheckConstraint("y >= -1 AND y <= 1"),
108+
CheckConstraint("z >= -1 AND z <= 1"),
109+
CheckConstraint("w >= -1 AND w <= 1"),
106110
)
107111

108112

0 commit comments

Comments
 (0)