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

Creating a geometrical model #192

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
2ab6381
Created the initial geometric model, and added it to the actor_builde…
Moanalengkeek Dec 21, 2023
93aff63
Added test_set_geometric_model
Moanalengkeek Dec 21, 2023
9d8482d
added visualization code example (with added thermal model) to get fa…
Mr-Medina Dec 22, 2023
cb8b7bb
Merge remote-tracking branch 'origin/Attitude_project' into Attitude_…
Moanalengkeek Dec 22, 2023
302097d
Created second geometric model to import .obj files, and created a te…
Moanalengkeek Dec 22, 2023
d781cbd
Added the .obj files used as an example
Moanalengkeek Dec 22, 2023
53a868b
Finalising the tests, and formatting of all changed sections of the t…
Moanalengkeek Dec 22, 2023
1b17bc0
Finalising the tests, and formatting of all changed sections of the t…
Moanalengkeek Dec 22, 2023
30e388f
Removed the ../../ in the file name that is needed during testing
Moanalengkeek Dec 22, 2023
9fe50cb
Revert "added visualization code example (with added thermal model) t…
Moanalengkeek Dec 22, 2023
2ab6522
Update paseos/actors/actor_builder.py based on pull request review
Moanalengkeek Jan 3, 2024
7404ce2
Update paseos/attitude/geometric_model.py
Moanalengkeek Jan 3, 2024
8d1f8ce
Changed based on the feedback given in the pull request on 29/12/23.
Moanalengkeek Jan 3, 2024
11594f9
Merge remote-tracking branch 'origin/Attitude_project' into Attitude_…
Moanalengkeek Jan 3, 2024
851caaf
Updates comments describing the inputs to the geometric model.
Moanalengkeek Jan 10, 2024
d32ad15
Add geometric model to a seperate folder
Moanalengkeek Jan 12, 2024
15606d7
Added additional comments to describe the default cubeoid values
Moanalengkeek Jan 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added visualization code example (with added thermal model) to get fa…
…miliar. Also pushig to test the branch on the fork.
  • Loading branch information
Mr-Medina committed Dec 22, 2023
commit 9d8482d2764cfb68b93afefd3bc03df4e1cb2b7c
77 changes: 77 additions & 0 deletions test_attitude_code/visualize_sim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# We use pykep for orbit determination
import pykep as pk

import paseos
from paseos.actors.spacecraft_actor import SpacecraftActor
from paseos.actors.actor_builder import ActorBuilder
paseos.set_log_level("INFO")

# Define central body
earth = pk.planet.jpl_lp("earth")
sat1 = ActorBuilder.get_actor_scaffold(
"sat1", SpacecraftActor, pk.epoch(0)
)
sat2 = ActorBuilder.get_actor_scaffold(
"sat2", SpacecraftActor, pk.epoch(0)
)

# Define local actor
sat3 = ActorBuilder.get_actor_scaffold(
"sat3", SpacecraftActor, pk.epoch(0)
)
ActorBuilder.set_orbit(sat3, [-10000000, 0.1, 0.1], [0, 8000.0, 0], pk.epoch(0), earth)
ActorBuilder.set_power_devices(sat3, 500, 10000, 1)

sat4 = ActorBuilder.get_actor_scaffold(
"sat4", SpacecraftActor, pk.epoch(0)
)
ActorBuilder.set_orbit(sat4, [0, 10000000, 0], [0, 0, 8000.0], pk.epoch(0), earth)


ActorBuilder.set_orbit(
sat1,
position=[10000000, 1e-3, 1e-3],
velocity=[1e-3, 8000, 1e-3],
epoch=pk.epoch(0),
central_body=earth,
)
ActorBuilder.set_orbit(
sat2,
position=[10000000, 1e-3, 1e-3],
velocity=[1e-3, -8000, 1e-3],
epoch=pk.epoch(0),
central_body=earth,
)

ActorBuilder.set_thermal_model(
sat1,
actor_mass=100,
actor_initial_temperature_in_K=270,
actor_sun_absorptance=0.5,
actor_infrared_absorptance=0.5,
actor_sun_facing_area=1,
actor_central_body_facing_area=4,
actor_emissive_area=18,
actor_thermal_capacity=0.89,
)

# Add communication link
ActorBuilder.add_comm_device(sat1, device_name="link1", bandwidth_in_kbps=1)
ActorBuilder.add_comm_device(sat2, device_name="link1", bandwidth_in_kbps=2)
ActorBuilder.set_power_devices(sat1, 500, 10000, 1)
ActorBuilder.set_power_devices(sat2, 500, 10000, 1)
sim = paseos.init_sim(sat1)
sim.add_known_actor(sat2)
sim.add_known_actor(sat3)
sim.add_known_actor(sat4)

# Plot current status of PASEOS and get a plotter
plotter = paseos.plot(sim, paseos.PlotType.SpacePlot)
#%%
# Run some operations and inbetween update PASEOS
for i in range(100):
sim.advance_time(10,0)
plotter.update(sim)
#%%
# Write an animation of the next 50 steps a 100s to a file called test.mp4
plotter.animate(sim,dt=200,steps=100,save_to_file="test")