Robotic object manipulation via hierarchical and affordance learning