Ping 1D Profile Data Understanding

Hi!
I have a problem with understanding which values from profile data are distances and confidences of measurements. I obtain following data :

b'\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xbb5\x02\x11H\x8b\xbf\xba\x8drk^Ze\x9c\xd3\xfd\xfb\xd0\xb4\xb4\xc0\xc8\xda\xe3\xdd\xb6w3\x0b\x02\n\x17(6GLH:$\x0f\x03\x10+IN8\x1c\r\x12\x1e&"\x16\x0b\x03\x01\x07\x10\x12\x0e\x05\x01\x02\x06\x08\x08\x05\x03\x03\x03\x06\x0b\x0e\x11\x12\x0f\t\x04\x03\x03\x04\x03\x01\x00\x00\x01\x02\x02\x01\x00\x01\x03\x04\x05\x03\x01\x00\x00\x01\x02\x02\x00\x00\x00\x01\x03\x03\x03\x03\x03\x02\x03\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

and using code in Python I convert it to decimal data:

98 39 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 102 100 92 120 98 98 53 92 120 48 50 92 120 49 49 72 92 120 56 98 92 120 98 102 92 120 98 97 92 120 56 100 114 107 94 90 101 92 120 57 99 92 120 100 51 92 120 102 100 92 120 102 98 92 120 100 48 92 120 98 52 92 120 98 52 92 120 99 48 92 120 99 56 92 120 100 97 92 120 101 51 92 120 100 100 92 120 98 54 119 51 92 120 48 98 92 120 48 50 92 110 92 120 49 55 40 54 71 76 72 58 36 92 120 48 102 92 120 48 51 92 120 49 48 43 73 78 56 92 120 49 99 92 114 92 120 49 50 92 120 49 101 38 34 92 120 49 54 92 120 48 98 92 120 48 51 92 120 48 49 92 120 48 55 92 120 49 48 92 120 49 50 92 120 48 101 92 120 48 53 92 120 48 49 92 120 48 50 92 120 48 54 92 120 48 56 92 120 48 56 92 120 48 53 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 54 92 120 48 98 92 120 48 101 92 120 49 49 92 120 49 50 92 120 48 102 92 116 92 120 48 52 92 120 48 51 92 120 48 51 92 120 48 52 92 120 48 51 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 50 92 120 48 50 92 120 48 49 92 120 48 48 92 120 48 49 92 120 48 51 92 120 48 52 92 120 48 53 92 120 48 51 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 50 92 120 48 50 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 51 92 120 48 50 92 120 48 51 92 120 48 51 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 49 92 120 48 49 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 92 120 48 48 39

My code in Python:

from brping import PingParser, PingMessage, Ping1D
import time

myPing = Ping1D()           # obiekt klasy Ping1D
myMessage = PingMessage()   # obiekt klasy PingMessage
myParser = PingParser()     # obiekt klasy PingParser

myPing.connect_serial("COM4",115200)    # połączenie echosondy z komputerem
#myPing.set_ping_interval(200)           # ustawienie przedziału czasowego pomiędzy pomiarami
myPing.initialize()                     # inicjacja pracy echosondy
myPing.set_ping_enable(1)
time.sleep(1)

predkosc = myPing.get_speed_of_sound()
print(predkosc)
myMessage = myPing.get_profile()            # odczyt profilu danych
#data = myMessage.unpack_msg_data()
#myMessage = myParser.parse_byte(myMessage)  # dekodowanie informacji z profilu
dystanse = str(myMessage['profile_data'])
print('\n',dystanse,'\n')
print(' '.join(str(ord(c)) for c in dystanse))

There is an option to handle this problem with brping library? If yes, please let me know by share code.

Hi @Bartosz, welcome to the forum :slight_smile:

I have edited your post to include some code blocks so it’s more readable. You can learn how to do that in the How to Use the Blue Robotics Forums post.

As per the ping protocol docs, the profile data is

There is no “confidence” for those values, because they are the samples from the transducer, measuring the sound intensities over time in response to a single ping. In Ping Viewer, one profile corresponds to one vertical line.

Each profile also has a distance estimate, which is calculated by the sensor firmware from the data in that profile and the measurements that came before it. It also includes a measure of confidence, which is how sure the sensor is that its “distance” estimate is correct. You can access those values with myMessage['distance'] and myMessage['confidence'].

If you only want the distance estimate and confidence (and don’t need the profile data), you can use the myPing.get_distance() function instead of myPing.get_profile(), as in our example. The profile data is only useful if you want to do your own processing of it, for example to try to calculate your own alternative distance estimates, or maybe to try to estimate material types or surface shapes or something.

Hi @EliotBR !

I am very interested about what you said at the end of the reply to this topic. You say that there is a way to estimate material types. How is it possible exactly ? Is it also possible to estimate the internal composition of these materials? For example, to detect a piece of metal enclosed in a plastic box?

Thank you for your reply !

Hi @Lulu,

Echosounders operate based on measuring acoustic reflection, and acoustic reflections occur as combination of density differences, material homogeneity, and the size, shape, and relative orientation of the target object/surface. If you can assume (or know) enough about some of those variables then you can try to make deductions about/from the remaining one(s).

As a simple example, an echosounder doesn’t tell you which direction/part of the beam an echo came from, just its distance, but with context of past echo profiles over time and space and/or knowing the size and shape of what’s in the environment (e.g. from a video stream, past exploration, or controlled environment) it’s possible to narrow down the potential causes of a given data profile or set of profiles, which can then be used to build up a model of the surface, or to try to detect some kind of specific object of interest.

Not directly, but potentially if you have a very limited set of possible options of both material and geometry, and detecting anything inside something else is dependent on how much the external material(s) reflect and absorb the transmitted sound waves.

If you have a thin plastic box and/or if it has similar density to the water around it then there may be sufficient signal that passes through it to then reflect off a dense metal object inside, although if the box is full of air (rather than water or oil) then the box wall to air boundary will likely have too great a density change for much of the sound pressure wave to get in or out.

Ultrasonic thickness gauges may be worth referring to when understanding what is common with respect to material / size identification of a single (controlled and tuned) echosounder, and it’s perhaps worth considering that a frequency sweep would likely provide more information than just pulses of a consistent frequency.

That said, if I’m remembering correctly the “material types” I was thinking about when I made the comment originally were likely those with obvious differences (e.g. vegetation will typically have quite a fuzzy response compared to metal/stone/concrete, so it may be possible to estimate things like vegetation thickness on a concrete wall from quite standard echosounder profiles).

1 Like