Task-based programming and sequence planning for human-robot collaborative assembly