Formation Flying Module Questions

70 views
Skip to first unread message

Raj Patel

unread,
Sep 21, 2022, 12:48:03 PM9/21/22
to Basilisk Forum
Hi all,

I am using BSK to model a formation with 4 satellites. I've successfully modeled the formation:

Picture1.png

The primary goal of the formation is to have the followers form a chain of links by pointing cameras at each other:
F1 → F4       F4 →  F3        F3  →   F2        F2 → F1

So far, I've been able to satisfy two links using the 'spacecraftPointing()' module. I haven't been able to find the module(s) that will perform the two other links. I've solved this problem on MATLAB using a specific reference frame for attitude control, but I have not found a module that can input a reference frame for attitude control in BSK. Also, the multi-target pointing module I've found, celestialTwoBodyPoint(), is limited to pointing at celestial objects and not spacecraft. 

Also, I know I will need a non-body fixed sensor (like a gimbal) to maintain links throughout the orbit. However, I have not found a module that can do this. The closest module I've found is the nHingedRigidBodyStateEffector module, but this module seems limited to solar panels. 

Any pointers on which modules to use to solve these two problems would be much appreciated. 

-------------------
I have another question regarded visualization. I'd like to show the links in Vizard like this (note that the lines in the image below are drawn in and not actually displayed in Vizard):

Screenshot 2022-09-21 103438.png

I've gotten this to work to an extent. The 'createPointLine' tool does exactly what I'm looking for. However, the line created by this tool is small and does not span from one spacecraft to the other. It is only visible when I zoom in on one spacecraft:

Picture2.png               Picture4.png

The documentation states that the only three args for this tool are 'fromBodyName', 'toBodyName', and 'lineColor'. Therefore, I don't know how to extend these lines. 

Also, I don't know how to make any line in Vizard thicker (orbit trajectory, coordinate frame, relative orbit, etc)

I am new to BSK, so apologies if the implementation of these tools is trivial.

Thanks,
Raj


Hanspeter Schaub

unread,
Sep 22, 2022, 3:26:43 AM9/22/22
to Basilisk Forum
The formation flying related modules you are looking for don't exist yet.  You will have to write your own modules for this.  

Regarding a gimbal sensor, again, you can write your own module for the particular purpose you have.  Or, you can use something like `hingedRigidBody` effector to simulate a 1-D rotating component.  It outputs a spacecraft state message that can be connected to a sensor module, and thus have a time varying sensor orientation.  See this example: http://hanspeterschaub.info/basilisk/examples/scenarioRotatingPanel.html

Regarding Vizard, the lines you are using are for displaying local headings towards other bodies.  They don't draw full connections.  The capability you are looking for doesn't exist currently in Vizard.

Raj Patel

unread,
Sep 22, 2022, 4:54:16 PM9/22/22
to Basilisk Forum
Understood. Thank you for your response.

Raj Patel

unread,
Nov 10, 2022, 8:27:34 AM11/10/22
to Basilisk Forum

I have been working on creating a Python BSK module that inputs three spacecraft positions messages and outputs an attitude reference. This module, called PythonMTP, should operate similarly to the spacecraftPointing module. Thus far, I have used the python module PythonMRPPD in the 'scenarioAttitudePointingPy.py' script to guide the development of PythonMTP. I am running into an issue with inputting the spacecraft position messages into PythonMTP. When I print the inertial spacecraft position of any spacecraft when PythonMTP is called, I always get [0.0,0.0,0.0]. However, when I print the MRP values inside the PythonMRPPD module, I get the expected [0.1, 0.2, -0.3] initial MRP values. Here are the message chains for the two modules: 

PythonMRPPD

In simulation:

pyMRPPD.guidInMsg.subscribeTo(attErrorConfig.attGuidOutMsg)

where attErrorConfig.attGuidOutMsg is  <Basilisk.architecture.cMsgCInterfacePy.AttGuidMsg_C; proxy of <Swig Object of type 'AttGuidMsg_C *' at 0x7fc00b5be3f0> >

In module:

self.guidInMsg = messaging.AttGuidMsgReader()

guidMsgBuffer = self.guidInMsg()

print(guidMsgBuffer.sigma_BR)

output:
--> [0.1, 0.2, -0.3]

PythonMTP

In simulation:

pyMTP.deputy1PositionInMsg.subscribeTo(sNavObject2.transOutMsg)

where sNavObject2.transOutMsgis  <Basilisk.architecture.messaging.NavTransMsg; proxy of <Swig Object of type 'Message< NavTransMsgPayload > *' at 0x7f9b6bf96b10> >

In module:

self.deputy1PositionInMsg = messaging.NavTransMsgReader()

deputy1MsgBuffer = self.deputy1PositionInMsg

print(deputy1MsgBuffer.r_BN_N)

output:
--> [0.0, 0.0, 0.0]


I am pretty certain that the sNavObject2.transOutMsg message has the right data because I use it in the spacecraftPointing module in the same script. I tried to replicate the structure of the input messages in PythonMRPPD with the appropriate changes as much as I could, but I am still getting this issue. All data types for the NavTransMsgPayload message type (timetag, r_BN_N, v_BN_N, vehAccumDV) are zeros when printed in the PythonMTP moldule. I am guessing that the issue is somewhere in the message type, but I can't pinpoint what it is.

Thanks,
Raj Patel

Reply all
Reply to author
Forward
0 new messages