Robotics and artificial intelligence for sorting