The Barrel Cannon is an environmental feature in the Super Smash Bros. series as well as an item in Super Smash Bros. Melee. They hail from the Donkey Kong universe, appearing throughout the Donkey Kong Country series, as well as several Donkey Kong spin-offs.
Touching any Barrel Cannon will cause a character to be stuck inside while the barrel spins around. If A is pressed while inside, the cannon will shoot the occupant in the direction the arrow on the barrel is pointing. If nothing is pressed after a set time limit, the barrel will automatically fire the occupant in the direction it is pointing. It turns the character into a projectile while moving, damaging foes that are hit. Also, a tech is needed to recover, as landing will stun the character.
Barrel Cannons debuted in Donkey Kong Country as a means of travel across large gaps, and as a means of accessing bonus games. Present both singly and in "chains", jumping into one would leave a character sitting inside the barrel until they were fired. Many variations on the basic theme existed, including fixed cannons, autofiring cannons, cannons which rotated, cannons which moved back and forth in a line, and combinations thereof. Donkey Kong Country 2 introduced arrow barrels (image to the left) that indicated which direction they would fire, which became the basis for the Melee Barrel Cannon, which they function as they did in the Donkey Kong Country games. 
 Stage Feature
These are permanently placed on the bottom of SSB’s Congo (Kongo) Jungle (SSB) and Melee’s Kongo Jungle courses for recovery. They move back and forth and spin around. In the Melee stage, a Klaptrap will occasionally get stuck inside. While it is inside, the cannon cannot be used by anyone; those who touch it will be damaged by the Klaptrap. Eventually the Klaptrap will be fired, occasionally straight up through the stage. This will cause high damage, knockback, and even KO those with high damage.
 Subspace Emissary
Barrel Cannons appear in Super Smash Bros. Brawl only in The Subspace Emissary, notably the Donkey Kong Country-based The Jungle stage. Newly redesigned, they function exactly as they did in the DKC games, involving precise timing to use a chain of Cannons; shooting too low will often result in a KO if recovery isn't executed quickly.
In Melee only, Barrel Cannons appear as rare items, appearing infrequently even if the item drop frequency is set on very high prior to battle, which can be picked up and thrown. These items also tend to disappear very quickly, likely because of how far the barrel can send a character offstage, making recoveries impossible in certain scenarios. If a character is already inside it and another character runs into it, it will cause several small hits worth of damage (around 16%).
The Barrel Cannons were used in Donkey Kong games as a vital means of transportation, and their explosive nature is used similarly in Super Smash Bros. Melee. On the Kongo Jungle stage, one can catch characters as they fall from the main platform. Careful! The Barrel Cannon rotation may accidentally send you flying off the screen.