The main thread calling getDataPackage should be scheduled to real-time priority by the application. See the ur_robot_driver as an example. Communication with the primary / secondary and RTDE ...
The driver is compatible across the entire line of UR robots -- from 3 kg payload to 30 kg payload and includes all robots from the CB3 series and newer. Check also presentations and videos about this ...