Move computation of secondary tasks to JointStateGroup