Those generic dimensions GENERALLY provide adequately "straight-line" flow needed to measure effectively, although SOME conditions would require even longer runs for optimum effect (seriously turbulent incoming flow OR rapid volumetric change or significant obstruction (including a grille or diffuser) down stream (that might trigger an erratic or non-standard pressure rise).
If your installation is "challenged", the best effective solution is to install two sets of 1/2" mesh thin-wall grids, spaced about 1xD apart, at least 1xD upstream of the pitot tube inlet. Such an arrangement would also help with the downstream "upsets" noted earlier as a way to give maximum downstream spacing.
Like just about any measurement system, you have to analyze the conditions.
__________________
NO MATTER HOW WELL YOU HAVE DONE SO FAR, ALWAYS TRY TO BE BETTER TOMORROW.
Yes, though it is also possible to do a traverse across the pipe to establish the actual velocity profile, which is important in airflow-in-duct measurements.
__________________
"Did you get my e-mail?" - "The biggest problem in communication is the illusion that it has taken place" - George Bernard Shaw, 1856
IMO, yes.......those distances should be adhered to and free of any obstructions whatsoever. In most flow meter installations, especially when water flow is being measured, you want to be in a laminar flow regime. Also, you had better do a calculation check of the Reynolds and the Froude numbers during the design phase and before installation of any flow meter.
__________________
"Veni, Vidi, Vici"; hendiatris attributed to Gaius Julius Caesar, 47 B.C.
You don't fully describe what you are doing. If you are checking a municipal water supply for adequacy, use 10D. Also, your data will likely include not only flow rate but also static and dynamic pressure readings.
__________________
An obstacle is something you see when you take your eyes off the goal.