How to pass data from one module to other module for further processing?

You need a robotics application middleware to composite multiple modules.

The middleware provided in driveworks5 is CGF, the sample is in DriveWorks SDK Reference: Mini Pipeline Sample

You can use other compatible opensource robotics middleware such as ros2, which is not supported by official, see How to install ros2 foxy/humble on Nvidia DRIVE OS 6.0.5 - #3 by lizhensheng