If the person is indigent, the court shall, upon the person's request, appoint a qualified and available licensed physician, licensed psychologist, or other mental health professional to perform an examination of the person's mental condition and participate on the person's behalf in a trial or other proceeding under this chapter at which testimony is authorized.