Measure distance using an ultrasonic sensor in a pipe
I assume the pipe is only to protect the sensor from environment noise.
If the pipe is not filled with anything, then just line the inside of the pipe with sheets of sponge or foam to eliminate or reduce internal reflections.
Searching the net yields results for sound proofing foam sheet


Images from amazon.com and efoam.co.uk (no affiliation, just top google results for me)
The principle is similar to the black paint used inside telescopes and camera lenses.