Robert Charles Manning, Royal Engineers