Those sand bags will save you from small-arms fire. Mostly. They don't do much about cannonballs, and they don't do anything to melee infantry, since it isn't like they block them from reaching your soft, fleshy, cannon crew.