Bridging the Gap between ROS~2 and Classical Real-Time Scheduling for Periodic Tasks