providing goal-based autonomy for commanding a spacecraftA computer program for use aboard a scientific-exploration spacecraft autonomously selects among goals specified in high-level requests and generates corresponding sequences of low-level commands, understandable by spacecraft systems. (As used here, 'goals' signifies specific scientific observations.) From a dynamic, onboard set of goals that could oversubscribe spacecraft resources, the program selects a non-oversubscribing subset that maximizes a quality metric. In an early version of the program, the requested goals are assumed to have fixed starting times and durations. Goals can conflict by exceeding a limit on either the number of separate goals or the number of overlapping goals making demands on the same resource. The quality metric used in this version is chosen to ensure that a goal will never be replaced by another having lower priority. At any time, goals can be added or removed, or their priorities can be changed, and the 'best' goal will be selected. Once a goal has been selected, the program implements a robust, flexible approach to generation of low-level commands: Rather than generate rigid sequences with fixed starting times, the program specifies flexible sequences that can be altered to accommodate run time variations.