Self-awareness for autonomous systems