How to adjust yaw angle towards a setpoint in offboard mode

I am using ROS2 foxy/FastRTPS to control PX4 in offboard mode. Currently, I can navigate through desired setpoints that are sent via PositionSetpointTriplet uORB message from ROS2 to PX4.
I can specify the yaw angle manually. However, I would like the yaw angle to point to the next setpoint similar to the behaviour in mission mode when MPC_YAW_MODE = towards_waypoint.

Is this even possible to achieve or do I have to calculate the angle manually in ROS2?