Skip to content

Commit 9d52748

Browse files
committed
Refactor StrapdownState to use Default and new() properly
Fixes #65
1 parent 983b3ac commit 9d52748

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

core/src/strapdown.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,6 @@ impl Debug for StrapdownState {
256256

257257
impl Default for StrapdownState {
258258
fn default() -> Self {
259-
Self::new()
260-
}
261-
}
262-
263-
impl StrapdownState {
264-
/// Create a new StrapdownState with all zeros
265-
pub fn new() -> StrapdownState {
266259
StrapdownState {
267260
latitude: 0.0,
268261
longitude: 0.0,
@@ -274,6 +267,9 @@ impl StrapdownState {
274267
coordinate_convention: true, // NED by default
275268
}
276269
}
270+
}
271+
272+
impl StrapdownState {
277273
/// Create a new StrapdownState from explicit position and velocity components, and attitude
278274
///
279275
/// # Arguments
@@ -286,7 +282,7 @@ impl StrapdownState {
286282
/// * `attitude` - Rotation3<f64> attitude matrix.
287283
/// * `in_degrees` - If true, angles are provided in degrees and will be converted to radians.
288284
/// * `ned` - If true, the coordinate convention is NED (North, East, Down), otherwise ENU (East, North, Up).
289-
pub fn new_from_components(
285+
pub fn new(
290286
latitude: f64,
291287
longitude: f64,
292288
altitude: f64,

0 commit comments

Comments
 (0)