ROS2 odom transform publisher C++ no class no compile
I'm struggling to get a ROS2 transform publisher coded in a way that will at least complie.
I'm porting an old C++ ROS node of mine to ROS2 and it includes an odometry transform publisher. The old ROS node was done without using classes and the ROS2 documentation for tf2_ros
shows only how to do it using a constructor: https://docs.ros.org/en/humble/Tutori.... I have found a few questions on this site and on interworld sites with similar issues but the only successful answers are shown with a class implementations. Example here: https://answers.ros.org/question/3605...
Does anyone know how to get a ROS2 odometry transform broadcaster running in C++ without a constructor/classes? Converting this node to class based would be a mountain of work. I'm clearly not a SW person.
Thanks in advance for any help.
To anyone else with this question: I found no answer after spending a few days trying. I ended up with a node that is partly class based and partly not.