Skip to content

Commit

Permalink
Issue #170: Eliminate deprecated BSK messaging import
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark2000 committed Aug 9, 2024
1 parent b328ad5 commit 8d698f7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/bsk_rl/sim/fsw.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from typing import TYPE_CHECKING, Callable, Iterable, Optional
from weakref import proxy

import Basilisk.architecture.cMsgCInterfacePy as cMsgPy
import numpy as np
from Basilisk.architecture import messaging
from Basilisk.fswAlgorithms import (
Expand Down Expand Up @@ -284,8 +283,8 @@ def _set_rw_config_msg(self) -> None:

def _set_gateway_msgs(self) -> None:
"""Create C-wrapped gateway messages."""
self.attRefMsg = cMsgPy.AttRefMsg_C()
self.attGuidMsg = cMsgPy.AttGuidMsg_C()
self.attRefMsg = messaging.AttRefMsg_C()
self.attGuidMsg = messaging.AttGuidMsg_C()

self._zero_gateway_msgs()

Expand Down Expand Up @@ -344,7 +343,7 @@ def setup_sun_pointing(self, nHat_B: Iterable[float], **kwargs) -> None:
self.fsw.world.ephemConverter.ephemOutMsgs[self.fsw.world.sun_index]
)
self.sunPoint.useBoresightRateDamping = 1
cMsgPy.AttGuidMsg_C_addAuthor(
messaging.AttGuidMsg_C_addAuthor(
self.sunPoint.attGuidOutMsg, self.fsw.attGuidMsg
)

Expand Down Expand Up @@ -381,7 +380,7 @@ def _setup_fsw_objects(self, **kwargs) -> None:
self.hillPoint.celBodyInMsg.subscribeTo(
self.fsw.world.ephemConverter.ephemOutMsgs[self.fsw.world.body_index]
)
cMsgPy.AttRefMsg_C_addAuthor(
messaging.AttRefMsg_C_addAuthor(
self.hillPoint.attRefOutMsg, self.fsw.attRefMsg
)

Expand Down Expand Up @@ -543,7 +542,7 @@ def _setup_fsw_objects(self, **kwargs) -> None:
self.fsw.dynamics.simpleNavObject.attOutMsg
)
self.trackingError.attRefInMsg.subscribeTo(self.fsw.attRefMsg)
cMsgPy.AttGuidMsg_C_addAuthor(
messaging.AttGuidMsg_C_addAuthor(
self.trackingError.attGuidOutMsg, self.fsw.attGuidMsg
)

Expand Down Expand Up @@ -689,7 +688,7 @@ def setup_location_pointing(
self.fsw.dynamics.imagingTarget.currentGroundStateOutMsg
)
self.locPoint.useBoresightRateDamping = 1
cMsgPy.AttGuidMsg_C_addAuthor(
messaging.AttGuidMsg_C_addAuthor(
self.locPoint.attGuidOutMsg, self.fsw.attGuidMsg
)

Expand Down Expand Up @@ -832,7 +831,7 @@ def setup_instrument_controller(

def reset_for_action(self) -> None:
"""Reset scanning controller."""
self.instMsg = cMsgPy.DeviceCmdMsg_C()
self.instMsg = messaging.DeviceCmdMsg_C()
self.instMsg.write(messaging.DeviceCmdMsgPayload())
self.fsw.dynamics.instrument.nodeStatusInMsg.subscribeTo(self.instMsg)
return super().reset_for_action()
Expand Down

0 comments on commit 8d698f7

Please sign in to comment.