Using The Ping Sonar with Jetson TX2 Development Board

I am trying to connect the Sonar to an Nvidia Jetson TX2 Development Board but I can’t seem to be able to get it working.

I’ve tried connecting the jumpers to serial UART /dev/ttyTHS2 port on the Jetson and running simplePingExample.py from here GitHub - bluerobotics/ping-python: Python scripts and examples for the Ping sonar. but it just says “Failed to initialize Ping!”

I don’t have access to the BLUART USB to Serial adapter but I have a third-party USB to TTL converter that I tried using and plugging into the USB port of the Jetson but I’m still getting the same message. Any ideas what might be causing the problem? Anyone has experience using this product with the Jetson board?

I don’t have access to an arduino right now but I will try with an arduino as soon as I get my hands on one.

Worth noting: I have successfully performed UART communication in the past on the Jetson using the same /dev/ttyhTHS2 port

Also worth noting: I haven’t been able to get the Sonar working on any device since I got it yet since I don’t have the BLUART converter, and using my third-party converter hasn’t worked with my PC either.

Is there a chance my sonar is faulty?

HI Yousef

Just curious…what else have you got integrated with the Nvidia Jetson? Thrusters, Lights, Depth, IMU, GPS, Camera?

@yuzo-san, in order to make sure the sonar and the serial converter works, can you please try to connect to the sonar using our ping-viewer application? Try also another usb cable.

Hey! Thanks for the response. Actually I’ve managed to figure out what the problem was and got it working. I tried using a different 5V VCC pin on the Jetson other than the one in the UART port and it worked. Seems like the one in UART was working on 3.3V or something. As for the serial converter, I managed to get that working as well. It was a silly mistake on my side, I was connecting Pinger TX to the converter TX and the Pinger RX to the converter RX instead of the opposite.

We’re yet to get to the hardware assembly phase, but yeah the plan is to have all of that minus the GPS. However we’re also using a Pixhawk, so that’s where the Depth Sensor is gonna go, and the Pixhawk will be connected to the board itself. As for the IMU it will likely be connected to an external micro-controller that communicates with the board over UART. The thrusters will also be connected to the Pixhawk, and the cameras connected directly to the Jetson.

There are IMUs inside of the pixhawk.

yeah I’m aware. However, we’re hoping to use an external IMU as well and perform sensor fusion between both the internal Pixhawk IMUs and the external one.

1 Like

Keen to hear how you get on as I am actively going down the Nvidia Jetson Nano route…

Hi bro,
Can you please explained how you connect it? I trying to hookup the sonar with the jetson tx2 and i having the same problem. Im using the BLUART.

Hello @khangydt, as a starting point in troubleshooting, are you able to use the sonar with the ping-viewer application on a normal desktop?

What is your current situation?

Hi guys,
I been using the raspberry pi to connect to the sonar and it been working great.
Just thinking of updating my game to use the jetson TX2 from nvidia. so i bought 3 TX2 and 4 sonar.

I installed the library brping using gitclone and install using " sudo python setup.py install" as instruction
After that i run the simplePingExample.py as follow:
“sudo python simplePingExampke.py --device /dev/ttyUSB0”
and it show up failed initialize.

I have tried different usb cable no luck, BTW im using the BLUART.

Anyone can point me to any direction would be appreciated.

Thank first guys

Hi,

We recommend to install the libraries via pip, as the documentation points here since it install all necessary libraries, but installing with setup.py script should be no issue.

What is the error message ? Can you see the serial devices under /dev/ ?

Hi,
I use “ls /dev/ttyUSB*”
it show ups /dev/ttyUSB0, so i tried to unplug the sonar just to make sure that ttyUSB0 is the sonar. I can confirm that ttyUSB0 is the sonar.

Thats where I dont know whats wrong. I also test the same sonar with the same BLUART on a raspberry pi and it working just fine but not on the Jetson TX2.

Here is the error message:
"device /dev/ttyUSB0
Opening /dev/ttyUSB0 at 115200 bps
Traceback (most recent call last):
File “simplePingExample.py”, line 20, in
if myPing.initialize() is False:
File “build/bdist.linux-aarch64/egg/brping/ping1d.py”, line 96, in initialize
File “build/bdist.linux-aarch64/egg/brping/ping1d.py”, line 111, in request
File “build/bdist.linux-aarch64/egg/brping/pingmessage.py”, line 434, in init
KeyError: 0

@khangydt, please let us know the version of python and bluerobotics-ping library that you are using:

jack@jack-desktop:~$ python --version
Python 2.7.12
jack@jack-desktop:~$ pip freeze | grep bluerobotics-ping
bluerobotics-ping==0.0.6

Hi jack,

Thanks for your tips, i solved the problems by re-install the jet-pack ( 4.2 i recall) to the newest version

1 Like