A spotting gun for mortar/artillery crews to adjust their fire?
That would explain the front hook that would allow it to be lined up exactly with the barrel of the cannon.