|
69 | 69 | " satellite.simulator.createNewEvent(\n", |
70 | 70 | " f\"add{self.name}Fault\",\n", |
71 | 71 | " satellite.dynamics.dyn_rate,\n", |
72 | | - " True,\n", |
73 | | - " [f\"self.TotalSim.CurrentNanos>={self.time}\"],\n", |
74 | | - " [\n", |
| 72 | + " eventActive=True,\n", |
| 73 | + " conditionTime=self.time,\n", |
| 74 | + " actionList=[\n", |
75 | 75 | " f\"self.faultList[{self.uniqueFaultIdx}].execute({satellite._satellite_command})\",\n", |
76 | 76 | " f\"self.faultList[{self.uniqueFaultIdx}].print({satellite._satellite_command})\",\n", |
77 | 77 | " ],\n", |
|
114 | 114 | "\n", |
115 | 115 | " def print(self, satellite):\n", |
116 | 116 | " if self.wheelIdx == \"all\":\n", |
117 | | - " self.message = f\"RW Power Fault: all RW's power limit reduced to {self.reducedLimit} Watts at {self.time*macros.NANO2MIN} minutes!\"\n", |
| 117 | + " self.message = f\"RW Power Fault: all RW's power limit reduced to {self.reducedLimit} Watts at {self.time * macros.NANO2MIN} minutes!\"\n", |
118 | 118 | " else:\n", |
119 | | - " self.message = f\"RW Power Fault: RW{self.wheelIdx}'s power limit reduced to {self.reducedLimit} Watts at {self.time*macros.NANO2MIN} minutes!\"\n", |
| 119 | + " self.message = f\"RW Power Fault: RW{self.wheelIdx}'s power limit reduced to {self.reducedLimit} Watts at {self.time * macros.NANO2MIN} minutes!\"\n", |
120 | 120 | " super().print_message(self.message, satellite)" |
121 | 121 | ] |
122 | 122 | }, |
|
135 | 135 | "outputs": [], |
136 | 136 | "source": [ |
137 | 137 | "class CustomDynModel(dyn.FullFeaturedDynModel):\n", |
138 | | - "\n", |
139 | 138 | " @property\n", |
140 | 139 | " def solar_angle_norm(self) -> float:\n", |
141 | 140 | " sun_vec_N = (\n", |
|
283 | 282 | " for i in range(4):\n", |
284 | 283 | " rwConfigElementMsg = messaging.RWConfigElementMsgPayload()\n", |
285 | 284 | " rwConfigElementMsg.gsHat_B = self.dynamics.Gs[:, i]\n", |
286 | | - " rwConfigElementMsg.Js = self.dynamics.rwFactory.rwList[f\"RW{i+1}\"].Js\n", |
287 | | - " rwConfigElementMsg.uMax = self.dynamics.rwFactory.rwList[f\"RW{i+1}\"].u_max\n", |
| 285 | + " rwConfigElementMsg.Js = self.dynamics.rwFactory.rwList[f\"RW{i + 1}\"].Js\n", |
| 286 | + " rwConfigElementMsg.uMax = self.dynamics.rwFactory.rwList[f\"RW{i + 1}\"].u_max\n", |
288 | 287 | " rwConfigElementList.append(rwConfigElementMsg)\n", |
289 | 288 | " rwConstellationConfig.reactionWheels = rwConfigElementList\n", |
290 | 289 | " self.rwConstellationConfigInMsg = messaging.RWConstellationMsg().write(\n", |
|
544 | 543 | "source": [ |
545 | 544 | "total_reward = 0.0\n", |
546 | 545 | "while True:\n", |
547 | | - "\n", |
548 | 546 | " observation, reward, terminated, truncated, info = env.step(\n", |
549 | 547 | " env.action_space.sample()\n", |
550 | 548 | " )\n", |
|
558 | 556 | } |
559 | 557 | ], |
560 | 558 | "metadata": { |
| 559 | + "kernelspec": { |
| 560 | + "display_name": ".venv", |
| 561 | + "language": "python", |
| 562 | + "name": "python3" |
| 563 | + }, |
561 | 564 | "language_info": { |
562 | 565 | "codemirror_mode": { |
563 | 566 | "name": "ipython", |
|
568 | 571 | "name": "python", |
569 | 572 | "nbconvert_exporter": "python", |
570 | 573 | "pygments_lexer": "ipython3", |
571 | | - "version": "3.11.12" |
| 574 | + "version": "3.12.10" |
572 | 575 | } |
573 | 576 | }, |
574 | 577 | "nbformat": 4, |
|
0 commit comments