def set_planar2r_joint_state(robo, q, qdot, qddot):
    """
    Set the joint states for a 2R planar robot.

    Args:
        robo: An instance of Robot class.
        q: Joint positions. A list of size 2.
        qdot: Joint velocities. A list of size 2.
        qddot: Joint accelerations. A list of size 2.

    Returns:
        The modified instance of Robot class.
    """
    q1 = q[0]
    q2 = q[1]
    q1dot = qdot[0]
    q2dot = qdot[1]
    q1ddot = qddot[0]
    q2ddot = qddot[1]
    # update joint variables
    params = {1: {'theta': q1}, 2: {'theta': q2}}
    robo.update_params('geos', params)
    # update joint params
    params = {
        1: {'qdots': q1dot, 'qddots': q1ddot},
        2: {'qdots': q2dot, 'qddots': q2ddot}
    }
    robo.update_params('misc', params)
    return robo