Get around 'this is an ugly SWIG Failure' error message when setting nested listed of payloads

27 views
Skip to first unread message

benjamin....@u-space.fr

unread,
Oct 21, 2022, 2:48:28 PM10/21/22
to Basilisk Forum
Hello everyone,

I'm having a hard time understanding the 'TypeError: Could not convert that TypeAMsgPayload into a pointer for some reason.  This is an ugly SWIG failur Good luck'  error message, where 'TypeAMsgPayload' is a custom message payload defined outside of the original basilisk folder.

Assume that TypeBMsgPayload is defined as a custom msg payload enclosing an array of msg payloads:

typedef struct {

TypeAMsgPayload nestedPayloadList[10]

}

In python, creating an instance of TypeBMsgPayload and trying to set its nestedPayloadList member in the most natural way (e.g)  'instanceOfPayloadB.nestedPayloadList = listOfInstancesOfPayloadA ' sometimes fails with the above 'this is an ugly SWIG failure'.

Here, I'm saying 'sometimes' because I am honestly not sure I understand the array_functions() , ARRAYASLIST and STRUCTASLIST and how the should (or should not be) leveraged with custom nested payloads, and because I have encountered situations where this seemed to work just fine. But I can't honestly say that I have a deterministic understanding of what's going on.

Could the Basilisk developers shed some light on this and how to proceed with custom nested payloads ? A minimal working example would be immensely helpful.

Also, it is possible to work with custom nested payloads without changing any of the files in basilisk/src/architecture ?

Thanks, 
Ben

benjamin....@u-space.fr

unread,
Oct 24, 2022, 10:33:17 AM10/24/22
to Basilisk Forum
Apologies to the BSK team, the issue was sitting between the chair and the keyboard.

Hanspeter Schaub

unread,
Oct 25, 2022, 10:17:19 AM10/25/22
to Basilisk Forum
Haha, thanks for sharing Ben.  Glad it worked out!
Reply all
Reply to author
Forward
0 new messages