Making C++ module support variable number of input C messages #55
Replies: 3 comments
-
In a C module the message is a structure that contains the payload message structure, the message header structure, and pointers to the payload and header. These are defined as In your case, your module is a C++ module and you are making a standard message of C++ msg objects. There should be nothing special to connect to. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the information. I still didn't manage to solve the issue:
How to get a pointer to a |
Beta Was this translation helpful? Give feedback.
-
Mm, I think I'm seeing the issue. If you followed the guidance at http://hanspeterschaub.info/basilisk/Learn/makingModules/cppModules/cppModules-3.html your command Basilisk doesn't do any magic conversion here between the message types. You would have to rewrite your |
Beta Was this translation helpful? Give feedback.
-
Hi folks,
I am having trouble writing a new module whose input is a variable number of
IMUSensorBodyMsgPayload
messages. I've read the documentation on how to do that, and I've read the eclipse example, but still I am getting an error message about the module getting aIMUSensorBodyMsg_C
pointer instead of aIMUSensorBodyMsgPayload
pointer.The C++ module is in the attached ZIP file: VectorVoter_bsk.zip
The Python code calling the external module is the following:
gives
where
print(imu_defs['imuCommConfig'].imuSensorOutMsg)
gives
I suspect that it's because
ImuComm
is a C module. If I understood correctly (I am still a Basilisk beginner), when calling subscribeTo, it does not matter if it's a C or C++ module, it's hidden inmessaging.h
. However, this seems not to be the case when subscribing manually to the multiple input messages in my module's cpp file (methodaddSensorToVoter
).Cheers
Clément
Beta Was this translation helpful? Give feedback.
All reactions