Use custom class objects as ros2 msg type
I'm working with ros2 humble in python, trying to implement two nodes say Node1 & Node2. Node2 is subscribed to Node1. My requirement is for Node1 to publish a box object (containing a nested dictionary structure) to Node2. Since box is not a supported format I'm currently converting the box object to string and publishing, which beats the purpose of box. I would like to create a custom message type/interface to send the box object as such. How can I achieve this? Thanks in advance