Added global variables curr_ori, target_ori.