Wallenstein (a Bohemian general, lived 1583-1634) was Early Modern rather than Late Medieval, but the stick in question is a military baton. Its purpose was purely symbolic, like a royal sceptre or crown; the baton form was a self-conscious Renaissance revival of Imperial Roman custom. It appears in portraiture to indicate that the subject was a high-ranking military commander.
It sometimes crops up in later heraldry, but don't get it confused with another use of "baton" in that context, as a short diagonal strip thought to indicate illegitimacy somewhere in the family line.