Home        Store        Learn        Blog

Record data from ping360 sonar

Hi, I wrote a python code to read data from the ping360 sonar and tried to record the data into a binary file.

device_data = p.transmitAngle(x)

I wrote "device_data " to a binary file, but when I load the binary data by using Ping-viewer, nothing showed up.

Then I read the data from the binary file with code, it showed that
start1 =72
start2 =145
payload_length =
message_id =
src_device_id ==
dst_device_id =

Could you please help me to solve this problem? Thanks.

Hi,

Please share a minimum code example that replicate your problem and also the log that you generated.
To understand how log files are created and read by ping-viewer, check our binary format documentation:
https://docs.bluerobotics.com/ping-viewer/binary-structure/

should I get data from
device_data = p.transmitAngle(x)
or
get_device_data()

I see. We need to get data from device_data

Could you please show an example about the how to write the data to the binary file, including the header? The pingviewer still cannot read from the binary file I made. Thank you.

Hi,

To create the file you just need to follow the same steps of the decode script that I provide, the only difference is that you’ll need to write and not read from the file.

Please share the script that you have created.

I follow the step of the decode script, and the decode script can read my binary file. But when I opened with pingviewer, the pingviewer crashed.

Hi @wang,

As I said, it’s not possible to help you if you don’t provide your script and neither the binary file that you created.
We can’t help you if you don’t share what is necessary for us, otherwise no further assistant is possible.