From the Super Mario Wiki
Rocket Guys are Yellow Shy Guys who fly on rockets that only appear in Yoshi's Island DS. They first appear in outer space, where Yoshi is also in a rocket. Here, they are invincible and, if touched by Yoshi, cause his rocket to explode, forcing him to restart from the nearest check point. Rocket Guys can only be defeated, and thereby added to the Island Museum, during the boss battle with Moltz the Very Goonie, where they fall from above after every hit dealt to the boss. Yoshi Eggs turn the rockets around during the boss battle, and the Shy Guys riding them can be eaten (though the rockets continue flying even without a rider), which will add the Rocket Guys to the museum.