Skip to content

Commit 265aafd

Browse files
committed
Allow for non-diagonal quadrotor inertia matrix
1 parent 6cb943f commit 265aafd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RobotZoo"
22
uuid = "74be38bb-dcc2-4b9e-baf3-d6373cd95f10"
33
authors = ["Brian Jackson <bjack205@gmail.com>"]
4-
version = "0.2.2"
4+
version = "0.2.3"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/quadrotor.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ where `R <: Rotation{3}` and defaults to `UnitQuaternion{Float64}` if omitted. T
2020
"""
2121
struct Quadrotor{R} <: RigidBody{R}
2222
mass::Float64
23-
J::Diagonal{Float64,SVector{3,Float64}}
24-
Jinv::Diagonal{Float64,SVector{3,Float64}}
23+
J::SMatrix{3,3,Float64,9}
24+
Jinv::SMatrix{3,3,Float64,9}
2525
gravity::SVector{3,Float64}
2626
motor_dist::Float64
2727
kf::Float64
@@ -41,6 +41,7 @@ function Quadrotor{R}(;
4141
bodyframe=false,
4242
ned=false,
4343
) where R
44+
@assert issymmetric(J)
4445
Quadrotor{R}(mass,J,inv(J),gravity,motor_dist,kf,km,bodyframe,ned)
4546
end
4647

0 commit comments

Comments
 (0)