Trone.cpp driver

Can the trone.cpp driver in the PX4 flight stack be used as an altimeter (pointing face down)? If that is the case, then are there any parameters to be set via QGC (e.g. min/max distance, etc.)?

I can’t see you picture.
What I see in the code of trone.cpp is that it has the min/max distance hard coded:
#define TRONE_MIN_DISTANCE (0.20f)
#define TRONE_MAX_DISTANCE (14.00f)

I’m not able to make it work.
nsh> trone start
trone: driver start failed

The Terraranger is connected with PX4Flow to I2CBus. This config work with Arducopter so my Terraranger is well flashed with I2C support.

The picture should show now.

BTW, Lorenz and Julian are going to try to test the sensor so they might post results in the former PX4 forum.

Yes, I see the picture now, thanks,
The former forum has been closed, so I’m coming here.
I have added error message to trone.cpp to see where it failed, and it is on I2C::init() :
286 if (I2C::init() != OK) {
I do not have a /dev/range_finder0 when the TROne is connected, only when the px4flow is connected but my px4flow does not have a sonar.
I’m new to PX4 so maybe I miss an obvious thing.


It looks like there is some issue in I2C code. What version of PX4 are you using?

I tried with 1.3 and 1.4. And my message is with master where I add error message to see where it failed. Here is my fork commit :

Has anyone successfully used/tested the TeraRanger One sensor with the v1.4.1 release?

Do you know which value I should visualize in QgroundControl Analyze widget in order to ensure that the Teraranger One is working?

Yes it is “distance_sensor.current_distance” (if you have a PX4Flow he may also publish on this topic, disconnect it before testing to be sure)

Will try that, thanks! BTW, is it still failing for you?

I’ve switched back to Arducopter where everything work. I will give another try to PX4 in september.


Actually TeraRanger One was not working out of the box with PX4. I submited a PR to add configuration parameter:

As a workaround, for now, you can edit


and add line

trone start

Then you’ll need to rebuild the flight stack and flash your device.