This is how it should be done. Check out this Wired article about how Elon Musk, CEO of Tesla, announced that he won't initiate patent lawsuits against anyone who wants to use their technology. Musk definitely has a larger vision than most of our modern day for-profit CEOs.
In order to build and improve upon something, it is better to collaborate with your competitors as they may have a different approach than you do. If we constantly live in our own little bubble thinking we know everything that there is to know and hoard our knowledge, we end up stunting growth instead of moving forward to something much greater.