A judge granted a request from the defense to have a competency hearing.