Fix comments on PR

This commit is contained in:
Ylva Selling
2023-04-13 11:25:23 -04:00
parent 0ccd5d63bd
commit 3a5015e182
11 changed files with 72 additions and 83 deletions

View File

@@ -127,4 +127,5 @@ asset.onInitialize(function()
asset.onDeinitialize(function()
openspace.unloadMission(Mission.Name)
end)

View File

@@ -87,9 +87,6 @@ local aimAtBennu = {
Identifier = "os.missions.osirisrex.aimAtBennu",
Name = "Look at Bennu from OSIRIS-REx",
Command = [[
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAnchor", nil);
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", 'OsirisRex');
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", 'Earth');
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.RetargetAim", nil);
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Anchor", 'OsirisRex');
openspace.setPropertyValueSingle("NavigationHandler.OrbitalNavigator.Aim", 'BennuBarycenter');
@@ -170,3 +167,4 @@ asset.meta = {
URL = "http://openspaceproject.com",
License = "MIT license"
}

View File

@@ -221,9 +221,7 @@ local Mission = {
{
Name = "Orbital B",
Description = "At the end of Detailed Survey, the spacecraft entered a close orbit with a radius of 0.6 miles (1 km) around Bennu to begin Orbital B Phase. This phase broke the record OSIRIS-REx set in Orbital A for the closest that a spacecraft has ever orbited around a small body. The primary science activities for this phase were the global mapping of Bennu, the development of shape modeling based on OLA data, and the execution of a Radio Science experiment. These data were used to evaluate potential sample collection sites for three key elements: safety, sampleability and science value. Orbital B concluded with the team narrowing in on a primary and a back-up sample site.",
Media = {
Image = "https://www.asteroidmission.org/wp-content/uploads/2018/05/Orbital-B-for-Web.jpg"
},
Image = "https://www.asteroidmission.org/wp-content/uploads/2018/05/Orbital-B-for-Web.jpg",
Phases = {
{
Name = "Candidate Sample Site Phase 1",
@@ -304,7 +302,6 @@ local Mission = {
}
}
asset.onInitialize(function()
openspace.loadMission(Mission)
end)

View File

@@ -1,32 +1,30 @@
-- @TODO (Images should be moved to the data server)
local Mission = {
Name = "Mars 2020 Perseverance Events on Mars",
Phases = {
{
Name = "First Color Photo",
TimeRange = { Start = "2021 FEB 18" },
Media = { Image = "https://upload.wikimedia.org/wikipedia/commons/d/d6/Perseverance%27s_First_Full-Color_Look_at_Mars.png" }
Image = "http://data.openspaceproject.com/missions/perseverance/Perseverance's_First_Full-Color_Look_at_Mars.png"
},
{
Name = "First Study Target",
TimeRange = { Start = "2021 FEB 22" },
Media = { Image = "https://upload.wikimedia.org/wikipedia/commons/6/69/PIA24484-MarsPerseveranceRover-FirstStudyTarget-20210222.jpg" }
Image = "http://data.openspaceproject.com/missions/perseverance/PIA24484-MarsPerseveranceRover-FirstStudyTarget-20210222.jpg"
},
{
Name = "Drive Test",
TimeRange = { Start = "2021 MAR 07" },
Media = { Image = "https://upload.wikimedia.org/wikipedia/commons/2/21/PIA23729-MarsPerseveranceRover-DriveTest-20210307.jpg" }
TimeRange = { Start = "2021 MAR 07" }
Image = "http://data.openspaceproject.com/missions/perseverance/PIA23729-MarsPerseveranceRover-DriveTest-20210307.jpg"
},
{
Name = "Ingenuity Helicopter launch",
TimeRange = { Start = "2021 APR 04" },
Media = { Image = "https://upload.wikimedia.org/wikipedia/commons/e/e1/Ingenuity_helicopter_first_colour_image.jpg" }
Image = "http://data.openspaceproject.com/missions/perseverance/Ingenuity_helicopter_first_colour_image.jpg"
},
{
Name = "Ingenuity Helicopter First Flight",
TimeRange = { Start = "2021 APR 19" },
Media = { Image = "https://upload.wikimedia.org/wikipedia/commons/b/b7/Ingenuity_Helicopter%27s_Shadow_On_1st_flight.jpg" }
},
TimeRange = { Start = "2021 APR 19" }
}
}
}
@@ -37,4 +35,4 @@ local Mission = {
asset.onDeinitialize(function()
openspace.unloadMission(Mission.Name)
end)

View File

@@ -3,79 +3,78 @@
local Mission = {
Name = "Rosetta",
TimeRange = { Start = "2004 MAR 02 00:00:00", End = "2016 SEP 30 00:00:00" },
Description = "ESA's Rosetta mission was the first to rendezvous with a comet, the first to follow a comet on its orbit around the Sun, and the first to deploy a lander to a comet's surface. Comets are time capsules containing primitive material left over from the epoch when the Sun and its planets formed. By studying the gas, dust and structure of the nucleus and organic materials associated with the comet, via both remote and in situ observations, the Rosetta mission is unlocking the history and evolution of our Solar System.",
Media = { Image = "https://www.cosmos.esa.int/documents/522118/522182/Rosetta_logo.png/cd85878d-2fac-e086-e32a-df0eaee5e505?t=1614026031720" },
Description = "ESAs Rosetta mission was the first to rendezvous with a comet, the first to follow a comet on its orbit around the Sun, and the first to deploy a lander to a comets surface. Comets are time capsules containing primitive material left over from the epoch when the Sun and its planets formed. By studying the gas, dust and structure of the nucleus and organic materials associated with the comet, via both remote and in situ observations, the Rosetta mission is unlocking the history and evolution of our Solar System.",
Image = "https://www.cosmos.esa.int/documents/522118/522182/Rosetta_logo.png/cd85878d-2fac-e086-e32a-df0eaee5e505?t=1614026031720",
Milestones = {
{
Name = "Launch",
Date = "2004 MAR 02 09:00:00"
Date = "2004 MAR 02 09:00:00"
},
{
Name = "First Earth gravity assist",
Date = "2005 MAR 04 00:00:00",
Date = "2005 MAR 04 00:00:00",
Image = "https://www.esa.int/var/esa/storage/images/esa_multimedia/images/2005/03/moonrise_above_the_pacific_22_06_utc_4_march_2005/9520996-4-eng-GB/Moonrise_above_the_Pacific_22_06_UTC_4_March_2005_pillars.jpg",
Description = "The Moon rising above the Pacific at 22:06 UTC, 4 March 2005, just three minutes before the point of closest approach during Rosetta's first Earth fly-by.",
Description = "The Moon rising above the Pacific at 22:06 UTC, 4 March 2005, just three minutes before the point of closest approach during Rosettas first Earth fly-by.",
Link = "https://www.esa.int/var/esa/storage/images/esa_multimedia/images/2015/08/approaching_perihelion_animation/15556093-1-eng-GB/Approaching_perihelion_Animation_pillars.gif"
},
{
Name = "Mars gravity assist",
Date = "2007 FEB 25 00:00:00",
Date = "2007 FEB 25 00:00:00",
Description = "The Rosetta swing-by of Mars is the second of four gravity assist manoeuvres that are required to place Rosetta on course for its final destination: comet 67P/Churyumov-Gerasimenko. The closest approach of the swing-by will take place at 01:54 UT, 25 February 2007, when the spacecraft will pass 250 km above the surface of Mars.",
Image = "https://www.esa.int/var/esa/storage/images/esa_multimedia/images/2007/02/image_of_mars_seen_by_osiris/10287257-2-eng-GB/Image_of_Mars_seen_by_OSIRIS_pillars.jpg",
Link = "https://sci.esa.int/web/rosetta/-/40697-rosetta-mars-swing-by"
},
{
Name = "Second Earth gravity assist",
Date = "2007 NOV 13 00:00:00",
Date = "2007 NOV 13 00:00:00",
Description = "In the evening of 13 November, at 20:57 UTC, the Rosetta spacecraft returns to Earth for a second time after its launch in March 2004. The spacecraft will perform its second Earth swing-by which is part of a series of gravity assists required to put the spacecraft on an intercept course with comet 67P/Churyumov-Gerasimenko."
},
{
Name = "Asteroid Steins flyby",
Date = "2008 SEP 05 00:00:00",
Date = "2008 SEP 05 00:00:00",
Image = "https://cdn.sci.esa.int/documents/34878/35534/1567217294466-Steins-FlyBy-Mosaic_625.jpg",
Description = "Images of asteroid (2867) Steins taken by the OSIRIS Wide Angle Camera on Rosetta during the fly-by of 5 September 2008. The effective diameter of the asteroid is 5 km, approximately as predicted. At the top of the asteroid (as shown in these images), a large crater, approximately 2 km in size, can be seen."
},
{
Name = "Third Earth gravity assist",
Date = "2009 NOV 13 00:00:00"
Date = "2009 NOV 13 00:00:00"
},
{
Name = "Asteroid Lutetia flyby",
Date = "2010 NOV 10 00:00:00",
Date = "2010 NOV 10 00:00:00",
Image = "https://cdn.sci.esa.int/documents/34878/35534/1567216468815-4_closest_approach-0_625.jpg",
Description = "Together with 2867-Steins, 21-Lutetia is one of the two target asteroids that Rosetta will study during its long trek to comet 67P-Churyumov-Gersimenko."
},
{
Name = "Rendezvous manoeuvres begin",
Date = "2014 MAY 07 00:00:00"
Date = "2014 MAY 07 00:00:00"
},
{
Name = "Arrive at comet",
Date = "2014 AUG 06 00:00:00",
Date = "2014 AUG 06 00:00:00",
Image = "https://www.esa.int/var/esa/storage/images/esa_multimedia/images/2014/08/navcam_animation_6_august/14705553-1-eng-GB/NavCam_animation_6_August_pillars.gif",
Description = "After ten years, five months and four days travelling towards our destination, looping around the Sun five times and clocking up 6.4 billion kilometres, we are delighted to announce finally we are here,” says Jean-Jacques Dordain, ESAs Director General."
Description = "After ten years, five months and four days travelling towards our destination, looping around the Sun five times and clocking up 6.4 billion kilometres, we are delighted to announce finally we are here, says Jean-Jacques Dordain, ESAs Director General."
},
{
Name = "Start global mapping",
Date = "2014 SEP 10 00:00:00",
Date = "2014 SEP 10 00:00:00",
Description = "After rendezvous, Rosetta will start with two months of extensive mapping of the comets surface, and will also make important measurements of the comets gravity, mass and shape, and assess its gaseous, dust-laden atmosphere, or coma. The orbiter will also probe the plasma environment and analyse how it interacts with the Suns outer atmosphere, the solar wind."
},
{
Name = "Philae lander delivery",
Date = "2014 NOV 12 00:00:00",
Date = "2014 NOV 12 00:00:00",
Image = "https://cdn.sci.esa.int/documents/34878/35534/1567216603810-ESA_Rosetta_OSIRIS_NAC_Farewell_Philae_625.jpg",
Description = "Rosettas OSIRIS narrow-angle camera captured this parting shot of the Philae lander after separation. The lander separated from the orbiter at 09:03 GMT/10:03 CET and is expected to touch down on Comet 67P/ChuryumovGerasimenko seven hours later. Confirmation of a successful touchdown is expected in a one-hour window centred on 16:02 GMT / 17:02 CET. Rosetta and Philae had been riding through space together for more than 10 years. While Philae is set to become the first probe to land on a comet, Rosetta is the first to rendezvous with a comet and follow it around the Sun. The information collected by Philae at one location on the surface will complement that collected by the Rosetta orbiter for the entire comet."
},
{
Name = "Closest approach to Sun (Perihelion)",
Date = "2015 AUG 13 00:00:00",
Date = "2015 AUG 13 00:00:00",
Description = "Perihelion is the closest point a Solar System object gets to the Sun along its orbit (aphelion is the term given to the most distant point). The term derives from ancient Greek, where peri means near and helios means Sun. “Perihelion is an important milestone in any comets calendar, and even more so for the Rosetta mission because this will be the first time a spacecraft has been following a comet from close quarters as it moves through this phase of its journey around the Solar System,” notes Matt Taylor, ESAs Rosetta project scientist.",
Image = "https://www.esa.int/var/esa/storage/images/esa_multimedia/images/2015/03/comet_s_orbit/15317969-1-eng-GB/Comet_s_orbit_pillars.jpg"
},
{
Name = "Mission end",
Date = "2016 SEP 30 00:00:00"
Date = "2016 SEP 30 00:00:00"
}
},
Phases = {
@@ -89,7 +88,7 @@ local Mission = {
{
Name = "Commissioning of Instruments",
TimeRange = { Start = "2004 MAR 02 09:14:00", End = "2004 JUN 07 00:00:00" },
Description = "The spacecraft is now configured for its long cruise, with instruments switched off and the Standard Radiation Environment Monitor (SREM) activated for background radiation monitoring."
Description = "The spacecraft is now configured for its long cruise, with instruments switched off and the Standard Radiation Environment Monitor (SREM) activated for background radiation monitoring."
},
{
Name = "Deep Space Hibernation",
@@ -100,7 +99,7 @@ local Mission = {
},
{
Name = "Mission",
Description = "At 10:00 CET the spacecraft woke up and started post-hibernation procedures. Rosetta restored communications with ESA's Operations Centre through NASAs Goldstone ground station at 18:17 CET. Greets the Earth with a 'Hello World' message. The message was received on a very low bit level. Over the next months ESA's job will be to raise communication speed through a software update.",
Description = "At 10:00 CET the spacecraft woke up and started post-hibernation procedures. Rosetta restored communications with ESAs Operations Centre through NASAs Goldstone ground station at 18:17 CET. Greets the Earth with a Hello World message. The message was received on a very low bit level. Over the next months ESAs job will be to raise communication speed through a software update.",
Image = "https://www.esa.int/var/esa/storage/images/esa_multimedia/images/2015/08/approaching_perihelion_animation/15556093-1-eng-GB/Approaching_perihelion_Animation_pillars.gif",
Link = "https://www.esa.int/var/esa/storage/images/esa_multimedia/images/2015/08/approaching_perihelion_animation/15556093-1-eng-GB/Approaching_perihelion_Animation_pillars.gif",
TimeRange = { Start = "2014 JAN 20 10:00:00", End = "2016 SEP 30 00:00:00" }
@@ -115,4 +114,5 @@ asset.onInitialize(function()
asset.onDeinitialize(function()
openspace.unloadMission(Mission.Name)
end)

View File

@@ -33,7 +33,7 @@ local Mission = {
Name = "Voyager 2 Jupiter Encounter",
TimeRange = { Start = "1979 JUL 09 00:00:00", End = "1979 JUL 09 00:00:00" }
},
{
{
Name = "Voyager 1 Saturn Encounter",
TimeRange = { Start = "1980 NOV 09 00:00:00", End = "1980 NOV 09 00:00:00" }
},
@@ -60,4 +60,4 @@ asset.onInitialize(function()
asset.onDeinitialize(function()
openspace.unloadMission(Mission.Name)
end)
end)

View File

@@ -93,6 +93,7 @@ public:
/**
* Returns the associated image of this MissionPhase. If no image is associated, this
* string will be empty.
*
* \return The associated image of the MissionPhase or the empty string
*/
const std::string& image() const;
@@ -100,6 +101,7 @@ public:
/**
* Returns the associated link of this MissionPhase. If no link is associated, this
* string will be empty.
*
* \return The associated link of the MissionPhase or the empty string
*/
const std::string& link() const;
@@ -125,7 +127,7 @@ public:
*
* \return All actions
*/
const std::vector<std::string> &actions() const;
const std::vector<std::string>& actions() const;
using Trace = std::vector<std::reference_wrapper<const MissionPhase>>;

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2021 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -22,13 +22,13 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_MODULE_SERVER___MISSION_TOPIC___H__
#define __OPENSPACE_MODULE_SERVER___MISSION_TOPIC___H__
#include <openspace/mission/mission.h>
#ifndef __OPENSPACE_MODULE_SERVER___MISSIONTOPIC___H__
#define __OPENSPACE_MODULE_SERVER___MISSIONTOPIC___H__
#include <modules/server/include/topics/topic.h>
#include <openspace/mission/mission.h>
using nlohmann::json;
namespace openspace {
@@ -48,4 +48,4 @@ private:
} // namespace openspace
#endif // __OPENSPACE_MODULE_SERVER___MISSION_TOPIC___H__
#endif // __OPENSPACE_MODULE_SERVER___MISSIONTOPIC___H__

View File

@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2021 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -26,12 +26,12 @@
#include <modules/server/include/connection.h>
#include <modules/server/include/jsonconverters.h>
#include <modules/spacecraftinstruments/util/imagesequencer.h>
#include <openspace/engine/globals.h>
#include <openspace/mission/missionmanager.h>
#include <openspace/util/spicemanager.h>
#include <openspace/util/time.h>
#include <ghoul/logging/logmanager.h>
#include <modules/spacecraftinstruments/util/imagesequencer.h>
#include <openspace/util/spicemanager.h>
using nlohmann::json;
@@ -49,25 +49,23 @@ nlohmann::json MissionTopic::missionJson() const {
const std::vector<double>& captureTimes = sequencer.captureProgression();
std::vector<std::string> captureTimesString(captureTimes.size());
for (int i = 0; i < captureTimes.size(); i++) {
const std::string& str = SpiceManager::ref().dateFromEphemerisTime(
for (size_t i = 0; i < captureTimes.size(); i++) {
std::string str = SpiceManager::ref().dateFromEphemerisTime(
sequencer.nextCaptureTime(captureTimes[i]),
"YYYY-MM-DDTHR:MN:SC"
);
captureTimesString[i] = str;
captureTimesString[i] = std::move(str);
}
json json;
for (auto const& [name, mission] : missions) {
nlohmann::json missionJson = createPhaseJson(mission);
missionJson["capturetimes"] = captureTimesString;
json.push_back(missionJson);
json.push_back(std::move(missionJson));
}
return json;
}
nlohmann::json MissionTopic::createPhaseJson(const MissionPhase& phase) const {
json phases = json::array();
for (const MissionPhase& missionPhase : phase.phases()) {
json subphaseJson = createPhaseJson(missionPhase);
@@ -78,20 +76,20 @@ nlohmann::json MissionTopic::createPhaseJson(const MissionPhase& phase) const {
const std::vector<Milestone>& dates = phase.milestones();
for (const Milestone& date : dates) {
json jsonDate = {
{ "date", std::string(date.date.ISO8601())},
{ "date", std::string(date.date.ISO8601()) },
{ "name", date.name }
};
if (date.description.has_value()) {
jsonDate["description"] = date.description.value();
jsonDate["description"] = *date.description;;
}
if (date.image.has_value()) {
jsonDate["image"] = date.image.value();
jsonDate["image"] = *date.image;
}
if (date.link.has_value()) {
jsonDate["link"] = date.link.value();
jsonDate["link"] = *date.link;
}
milestones.push_back(jsonDate);
milestones.push_back(std::move(jsonDate));
}
std::string startTimeString = std::string(Time(phase.timeRange().start).ISO8601());
@@ -100,15 +98,15 @@ nlohmann::json MissionTopic::createPhaseJson(const MissionPhase& phase) const {
nlohmann::json phaseJson = {
{ "name", phase.name() },
{ "description", phase.description() },
{ "actions" , phase.actions() },
{ "actions", phase.actions() },
{ "timerange", {
{ "start" ,startTimeString },
{ "end" ,endTimeString }
{ "start", startTimeString },
{ "end", endTimeString }
}},
{ "phases", phases },
{ "image", phase.image() },
{ "link", phase.link() },
{ "milestones" , milestones }
{ "milestones", milestones }
};
return phaseJson;

View File

@@ -157,23 +157,21 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dictionary) {
_actions = p.actions.value_or(_actions);
}
if (p.milestones.has_value()) {
_milestones.reserve(p.milestones->size());
for (int i = 0; i < p.milestones->size(); i++) {
std::string name = p.milestones.value()[i].name;
Time newTime = Time(p.milestones.value()[i].date);
Milestone newDate = { name, newTime };
if (p.milestones.value()[i].description.has_value()) {
newDate.description = p.milestones.value()[i].description.value();
}
if (p.milestones.value()[i].image.has_value()) {
newDate.image = p.milestones.value()[i].image.value();
}
if (p.milestones.value()[i].link.has_value()) {
newDate.link = p.milestones.value()[i].link.value();
}
_milestones.emplace_back(newDate);
_milestones.reserve(p.milestones->size());
for (int i = 0; i < p.milestones->size(); i++) {
std::string name = p.milestones.value()[i].name;
Time newTime = Time(p.milestones.value()[i].date);
Milestone newDate = { name, newTime };
if (p.milestones.value()[i].description.has_value()) {
newDate.description = p.milestones.value()[i].description.value();
}
if (p.milestones.value()[i].image.has_value()) {
newDate.image = p.milestones.value()[i].image.value();
}
if (p.milestones.value()[i].link.has_value()) {
newDate.link = p.milestones.value()[i].link.value();
}
_milestones.emplace_back(newDate);
}
}

View File

@@ -101,7 +101,6 @@ const std::map<std::string, Mission>& MissionManager::missionMap() {
return _missionMap;
}
scripting::LuaLibrary MissionManager::luaLibrary() {
return {
"",
@@ -115,6 +114,4 @@ scripting::LuaLibrary MissionManager::luaLibrary() {
}
// Singleton
} // namespace openspace