Skip to content
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

Allow custom meshes & rotations #182

Merged
merged 35 commits into from
Aug 11, 2023
Merged

Allow custom meshes & rotations #182

merged 35 commits into from
Aug 11, 2023

Conversation

gomezzz
Copy link
Collaborator

@gomezzz gomezzz commented Jul 18, 2023

Description

Summary of changes

  • Added docs how to use custom central bodies
  • Added ReferenceFrame enum for convenience
  • Added new CentralBody class to wrap either pykep Earth, custom meshes etc.
  • Added ActorBuilder function set the central body
  • Provided access to central body via actor to user
  • Add utility code for rotations and intersection checks with meshes and spheres
  • Refactor old eclipse and line of sight code
  • Refactored get_communication_window.py for readability
  • Removed some redundant code. The ISL checks as described in Inter-satellite link model #149 can now be done via setting a custom central body (basically an Earth with a larger radius)
  • Adapted visualization for meshes
  • Minor refactoring

Resolved Issues

How Has This Been Tested?

  • New test for loading mesh
  • New test for rotation
  • New test for line of sight
  • New test for eclipse computation
  • CI / CD

Related Pull Requests

N/A

Visualization with mesh looks like this
mesh_test

@schuhmaj @rasmusmarak Your comments would also be appreciated 🙏

ToDos

  • Doublecheck interaction with thermal model
  • Create a Mars example in the README
  • Formulate an issue for central bodies around Earth like the Moon etc.
  • Search code for appearances of Earth to doublecheck we caught all hard-coded assumptions
  • Check ground stations are correctly denied for non-Earth
  • Remove magic number from mesh readme

@gomezzz gomezzz added the enhancement New feature or request label Jul 18, 2023
@gomezzz gomezzz added tests Anything related to the tests visualization Code used to visualize the simulation feature implementing a new feature user-facing Anything that users can interact with physical-model All things involving some physical models labels Jul 18, 2023
@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Overall Coverage

Coverage Report
FileStmtsMissCoverMissing
paseos
   __init__.py33197%49
   paseos.py1441292%67–68, 145–146, 203, 218, 236, 245, 263, 294, 302–305
paseos/activities
   activity_manager.py43393%46, 74, 157
   activity_processor.py58198%121
   activity_runner.py621084%80–84, 104–113, 122–125
paseos/actors
   actor_builder.py1772785%22–28, 31, 221–223, 250–252, 297–306, 445, 502, 530, 542–546, 553–554, 561–562
   base_actor.py1281886%82, 104, 120, 167, 207–209, 230, 239, 256, 277, 283–286, 292, 307, 362
   ground_station_actor.py15380%47–53
   spacecraft_actor.py61198%123
paseos/central_body
   central_body.py65592%68, 177–178, 186–187
   is_in_line_of_sight.py581279%106–123, 167, 187
   mesh_between_points.py35294%64, 72
   sphere_between_points.py26869%35–38, 48–51, 63–64
paseos/communication
   get_communication_window.py23291%38, 64
paseos/power
   charge_model.py16194%49
   discharge_model.py7271%22, 34
paseos/tests
   activity_test.py57395%90, 93–94
   communication_window_test.py49198%176
   eclipse_test.py10190%20
   import_test.py6183%13
   init_test.py8188%16
   line_of_sight_test.py62494%143–146
   mesh_test.py119397%118, 136, 144
   thermal_model_test.py30197%61
   visualization_test.py18194%28
paseos/utils
   check_cfg.py611870%31, 40, 46, 60–62, 67, 70–72, 75–77, 80–82, 98, 103
   operations_monitor.py71396%127–130
paseos/visualization
   animation.py18667%27–30, 35, 44
   plot.py9367%29–32
   space_animation.py2152389%108–109, 124, 147–148, 182, 206–213, 219, 329, 352–354, 359, 368–369, 373, 409, 415–416, 447, 461–472
TOTAL215117792% 

Tests Skipped Failures Errors Time
36 0 💤 0 ❌ 0 🔥 1m 5s ⏱️

README.md Outdated Show resolved Hide resolved
Copy link

@schuhmaj schuhmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I like that some of the previous free functions moved inside the actor class - which facilities the usage for the user. The CentralBody class and associated functions look fine as well.

Otherwise some minor comments for the wine 🍷algorithm. (and to the already pointed out magic number, but now in the test cases)

paseos/central_body/mesh_between_points.py Show resolved Hide resolved
paseos/central_body/mesh_between_points.py Outdated Show resolved Hide resolved
# Load the 67P mesh with pickle
with open(mesh_path, "rb") as f:
mesh_points, mesh_triangles = pickle.load(f)
mesh_points = np.array(mesh_points) * 3126.6064453124995 # Scale to m
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic Scaling number as a constant to the top of the file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a comment ✌️

Copy link
Collaborator

@rasmusmarak rasmusmarak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, well done!✌️

@gomezzz gomezzz merged commit 61d0610 into main Aug 11, 2023
3 checks passed
@gomezzz gomezzz deleted the allow-custom-meshes branch August 11, 2023 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature implementing a new feature physical-model All things involving some physical models tests Anything related to the tests user-facing Anything that users can interact with visualization Code used to visualize the simulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow other central bodies
4 participants