Code implementation for ATRV-Jr for opportunistic science experiments