From a shared trajectory to an RL task