How to set attributes of complex messages
Hi all,
I'm trying to publish in a topic a complex message. For example, i have a message of type "Energy" that have the fields of another custom messages, as show bellow. I try using setattr but when i want to set, for example, the "power" attribute it gives me an error. Anyone has any idea?
Thanks for your help!
Message structure:
Energy:
Header:
stamp:
sec (int32)
nanosec (uint32)
frame_id (string)
Consumption:
power (int32)
Duration:
min (int32)
sec (int32)