Inferring affordances using learning techniques