Hi Romain,
You are right, I didn’t explain myself very well, I’m sorry.
I am currently using ConstantThrustManeuver only because I’m still working on the non date-based triggers. But for those triggers, I’ll use the generic Maneuver class.
Here is a snippet of my code showing that.
for thrust_event in self.mission.thrust_sequence:
if thrust_event["type"] == "date":
# Get start date and duration
startDate_obj = datetime.fromisoformat(thrust_event["triggerStart"])
startDate = AbsoluteDate(startDate_obj.year, startDate_obj.month, startDate_obj.day, startDate_obj.hour, startDate_obj.minute, 0.0, TimeScalesFactory.getUTC())
event_duration = int(thrust_event["triggerEnd"])
# Get the direction
V = thrust_event["v"]
N = thrust_event["n"]
B = thrust_event["b"]
# Define thrust direction provider (thrust along velocity axis to increase sma)
# LOFType.VNC : X axis aligned with velocity, Y is normal, Z is Co-normal (or bi-normal)
direction = Vector3D(V, N, B)
# Create the propulsion model
propulsion_model = BasicConstantThrustPropulsionModel(self.spacecraft.thrust, self.spacecraft.isp, direction, "Propulsion_Model")
# Create the triggers
maneuver_triggers = DateBasedManeuverTriggers(startDate, event_duration)
# Create the maneuver
maneuver = ConstantThrustManeuver(attitude_provider, maneuver_triggers, propulsion_model)
# Add the maneuver to the force model
self.propagator.addForceModel(maneuver)
maneuvers_list.append(maneuver)
print(f"Thrust event added : Starting at {startDate}, thrust along [{V},{N},{B}] vector (VNB) at {self.spacecraft.thrust}N, for {event_duration} seconds")
elif thrust_event["type"] == "threshold":
# Get the thresholds
if thrust_event["isTriggerStartDate"]:
print("Date start trigger not yet implemented")
continue
else:
# Get the thresholds
triggerStart = float(thrust_event["triggerStart"]) * 1000.0 # convert to meters
if thrust_event["isTriggerEndDuration"]:
triggerStop = float(thrust_event["triggerEnd"]) # duration in seconds
print("Duration end trigger not yet implemented")
continue
else:
triggerStop = float(thrust_event["triggerEnd"]) * 1000.0 # convert to meters
# Get the direction
V = thrust_event["v"]
N = thrust_event["n"]
B = thrust_event["b"]
# Define thrust direction provider
# LOFType.VNC : X axis aligned with velocity, Y is normal, Z is Co-normal (or bi-normal)
direction = Vector3D(V, N, B)
# Create the propulsion model
propulsion_model = BasicConstantThrustPropulsionModel(self.spacecraft.thrust, self.spacecraft.isp, direction, "Propulsion_Model")
# Get the triggers
if thrust_event["parameter"] == "semimajor_axis":
maneuver_triggers = getSMAThresholdTrigger(triggerStart, triggerStop, socketio)
else:
print("Thrust event parameter not yet handled: ", thrust_event["parameter"])
continue
# Create the maneuver
maneuver = Maneuver(attitude_provider, maneuver_triggers, propulsion_model)
# Add the maneuver to the force model
self.propagator.addForceModel(maneuver)
maneuvers_list.append(maneuver)
For all the date-based event, I have a verification function to ensure that there are no overlapping events. But for non date-based event, I can’t know before the propagation if two events will be triggered at the same time. So I don’t know how I can handle these cases.