Skip to content

Commit

Permalink
fixed data storage
Browse files Browse the repository at this point in the history
  • Loading branch information
cvhammond committed Aug 12, 2023
1 parent 5b81105 commit c5eba15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,9 @@ impl Data {
_ => Vector3::from_vec(vec![x, y, z]),
};
let temp_camera = SVector::from_vec(temp_cameras.into_iter().collect());
let index = (i * self.points_per_frame as usize) + j as usize;
residual[index] = temp_residual;
point_data[index] = temp_vec3;
cameras[index] = temp_camera;
residual[(i, j as usize)] = temp_residual;
point_data[(i, j as usize)] = temp_vec3;
cameras[(i, j as usize)] = temp_camera;
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use c3dio::C3d;
fn main() {
let sample19 = C3d::load("tests/c3d.org-sample-files/Sample07/16bitanalog.c3d").unwrap();
let sample19 = C3d::load("tests/c3d.org-sample-files/Sample00/Vicon Motion Systems/TableTennis.c3d").unwrap();

dbg!(sample19.data.points[(0, 0)]);
dbg!(sample19.data.points[(1, 0)]);
dbg!(sample19.data.points[(0, 1)]);

dbg!(sample19.data.num_frames);
dbg!(sample19.data.analog_channels);
dbg!(sample19.data.analog_samples_per_frame);
dbg!(sample19.data.analog_samples_per_frame as usize * sample19.data.num_frames);
}
1 change: 0 additions & 1 deletion src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ impl Parameters {
let event_context = EventContextParameters::from_raw(&raw_parameters);
let manufacturer = ManufacturerParameters::from_raw(&raw_parameters);
let seg = SegParameters::from_raw(&raw_parameters);
dbg!(&raw_parameters);
Ok(Parameters {
group_descriptions,
raw_parameters,
Expand Down

0 comments on commit c5eba15

Please sign in to comment.