-
Notifications
You must be signed in to change notification settings - Fork 1
Hot-fix working in vts #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,17 +276,22 @@ public void writeStep(Satellite satellite) { | |
| double torqueX = ang_accel.getX()/satellite.getAssembly().getBody().getInertiaMatrix()[0][0]; | ||
| double torqueY = ang_accel.getY()/satellite.getAssembly().getBody().getInertiaMatrix()[1][1]; | ||
| double torqueZ = ang_accel.getZ()/satellite.getAssembly().getBody().getInertiaMatrix()[2][2]; | ||
|
|
||
| Vector3D torque = new Vector3D(torqueX,torqueY,torqueZ); | ||
| if (torque.getNorm() != 0) { | ||
| torque = torque.normalize(); | ||
| } | ||
| buff | ||
| .append(days) | ||
| .append(" ") /* Column Separator */ | ||
| .append(seconds) | ||
| .append(" ") | ||
| .append(torqueX) | ||
| .append(torque.getX()) | ||
| .append(" ") | ||
| .append(torque.getY()) | ||
| .append(" ") | ||
| .append(torqueY) | ||
| .append(torque.getZ()) | ||
| .append(" ") | ||
| .append(torqueZ) | ||
| .append(0) | ||
| ; | ||
| this.writerAEM_torque.append(buff+LS); | ||
| this.writerAEM_torque.flush(); | ||
|
|
@@ -295,6 +300,10 @@ public void writeStep(Satellite satellite) { | |
|
|
||
| /** Writing to the angular velocity file */ | ||
| Vector3D vel = satellite.getStates().getCurrentState().getAttitude().getSpin(); | ||
| vel.normalize(); | ||
| if (vel.getNorm() != 0) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this check if it's equal to 1 instead?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No the purpose of this is to check for divide by zero errors, this is correct |
||
| vel = vel.normalize(); | ||
| } | ||
| buff | ||
| .append(days) | ||
| .append(" ") /* Column Separator */ | ||
|
|
@@ -305,6 +314,8 @@ public void writeStep(Satellite satellite) { | |
| .append(vel.getY()) | ||
| .append(" ") | ||
| .append(vel.getZ()) | ||
| .append(" ") | ||
| .append(0) | ||
| ; | ||
| this.writerAEM_angVel.append(buff+LS); | ||
| this.writerAEM_angVel.flush(); | ||
|
|
@@ -313,6 +324,9 @@ public void writeStep(Satellite satellite) { | |
|
|
||
| /** Writing to the angular momentum file */ | ||
| Vector3D mom = satellite.getAssembly().getAngularMomentum(); | ||
| if(mom.getNorm()!= 0) { | ||
| mom = mom.normalize(); | ||
| } | ||
| buff | ||
| .append(days) | ||
| .append(" ") /* Column Separator */ | ||
|
|
@@ -323,6 +337,8 @@ public void writeStep(Satellite satellite) { | |
| .append(mom.getY()) | ||
| .append(" ") | ||
| .append(mom.getZ()) | ||
| .append(" ") | ||
| .append(0) | ||
| ; | ||
| this.writerAEM_angMomentum.append(buff+LS); | ||
| this.writerAEM_angMomentum.flush(); | ||
|
|
@@ -331,6 +347,7 @@ public void writeStep(Satellite satellite) { | |
|
|
||
| /* Writing the current mag field to the log file. */ | ||
| Vector3D mag_field = satellite.getSensors().getMagnetometer().retrievePerfectField().getFieldVector(); | ||
| mag_field = mag_field.normalize(); | ||
| buff | ||
| .append(days) | ||
| .append(" ") /* Column Separator */ | ||
|
|
@@ -341,6 +358,8 @@ public void writeStep(Satellite satellite) { | |
| .append(mag_field.getY()) | ||
| .append(" ") | ||
| .append(mag_field.getZ()) | ||
| .append(" ") | ||
| .append(0) | ||
| ; | ||
| this.writerAEM_mag.append(buff.toString()+ LS); | ||
| this.writerAEM_mag.flush(); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the operation is used as if it works in-place, but all the other uses of it treat it as if it returns the computed value. Maybe remove this line as it's redundant with the check on the next couple of lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I forgot to delete that line