def METHOD_NAME(self, jr: JumpingRobot, k: int) -> NonlinearFactorGraph:
    """ Create a factor graph of dynamcis constraints for robot frame. """
    graph = self.graph_builder.dynamicsFactorGraph(jr.robot, k, None, None)
    joint_names = [joint.name() for joint in jr.robot.joints()]
    for name in ["foot_l", "foot_r"]:
        if name in joint_names:
            j = jr.robot.joint(name).id()
            torque_key = gtd.TorqueKey(j, k)
            graph.add(
                gtd.PriorFactorDouble(
                    torque_key, 0.0,
                    self.graph_builder.opt().t_cost_model))
    return graph