In Rayman Revolution, I think.They are referred as the Generator Guardians of the two generators of the Pirate Factory and have unlimited heath. They fire the same bullets as the Green Robo-Pirates, but they are more accurate and faster. These pirates wear a red bandanna, have a black torso, have a cylinder for a head, a white eye and an eye patch. Source :RayWiki
I'm really sorry guys, I've just replayed Rayman 2 and discovered that the Barrel Pirate behaves very differently to the one in Rayman Revolution. Seeing as this was the last game I played, I forgot about the differences between the versions. I offer my apologies
A topical question: how can Rayman destroy a Barrel Pirate in one swift move?