Programming by Demonstration of Pick-and-Place Tasks for Industrial Manipulators using Task Primitives