New LiDAR sensor Benewake TF02-Pro TFmini-S TF-Luna for drones UAV

Thank you so much Ibrahim. Worked like a charm.

Hooked it up to a Pixhawk running Ardurover 4.0
RNGFND1_TYPE=25
RNGFND1_ADDR=16

But, i have two of these puppies and i need to know how to change de default i2c address. Tried Bud Ryerson library to change it to 35 which it successfully updates but after a restart it defaults back to 16.

Saw you edited his library and shared it via WeTransfer. Any change you can upload it once again ? :wink:

Hi, thats great it worked. Mr. Bud has two libraries one for reading the data and other for configuring the LiDAR. I am really sorry I have not modified the second yet, I need to find some free time to edit it.
But I can write a single instruction code for you that will solve your problem. Please tell me the desired address that you want to set and which arduino board are you using.
Thank you

I’d like to set one to (decimal) 30 and the other to (decimal) 35

30 decimal = 001E hex
35 decimal = 0023 hex

Using an Arduino Uno

Okay I will prepare a short code for you

Hi, Use this file for changing the address.
Link: https://we.tl/t-reUkePQnBk
First connect your LiDAR to Arduino, then burn the code to arduino. I hope this will solve your problem.

1 Like

Houston, we have lift off. Thank you very much sir, that worked beautifully.

I recon that other people would be interested in this as well so i shared it on Google Drive (since WeTransfer has an expiration date)

https://drive.google.com/file/d/1bTkoCZtkhuuVZAzKI62OmwqPqmXsMU8P/view?usp=sharing

1 Like

The TFluna_IIC_command Arduino sketch doesn’t detect any I2C (IIC) addresses, it only sets it.
So where is says:

  Wire.write(0x1E); // For 23 change this line

You should change 0x1E (which is 30 in decimal) to whatever address you need.
Use this site to convert decimal to hex

Did you use Bud Ryersons library to scan for the newly assigned address ?

I ran the TFluna_IIC_command sketch twice to make sure the address was set properly. Then check with Buds library if it did. (don’t set a new address, only check)

I’m using the ATMEGA328P Pro Mini 328 Mini ATMEGA328 5V/16Mhz , cant seem to use Buds Library ?.

Okay. Let’s say that your i2c_scanner.ino sketch successfully detected the address at 0X6F (which should be 0x10 = 16 decimal by default)

Then in the TFluna_IIC_command sketch you have to change line 10 and 19 from this:

Wire.beginTransmission(0x10);

to this:

Wire.beginTransmission(0x6F);

Don’t forget to change line 14 to the newly desired address

Sorry think we misunderstand each other maybe ?..
Steps i did.
1-original luna detected as 0x10 with i2c-scanner.
2-used TFluna-IIC to change address by changing (Wire.write(0x1E); // For 23 change this line) to 0x12
3-read out i2c-scanner , gives 0x6F.
4-tried another luna with steps above but 0023 in line (Wire.write(0x1E); // For 23 change this line) .
5- again read out i2c-scanner , gives 0x6F.

Thats why i’m confused now…

Yeah that’s confusing. Maybe invest in an Arduino Uno. That one worked for me flawlessly

So that i understand. If you power up the Luna and use i2c-scanner to probe. It replies with 0x6F or 0x10 ?

Let’s take this off this thread. Sent you a private message

So new problem arised.
I got all Luna’s working in I2C mode on my Pixhawk. ( Thanks to everybody here ! :ok_hand: :vulcan_salute: :call_me_hand: )

But:
When Pixhawk is connected through USB all distance data can be seen and easily adjusted.
But when the Luna’s are connected and i acces the drone by Sik Radio (915Mhz ) there is to much data going back and forth for the radio to handle.

I adjusted PC-USB -> SIK to 115200 Baud , PIX Serial 1 -> SIK to 115200 and Airspeed Air --> Ground to 128000 , so you would think this is enough…its not !.

As i already build myself a Mavlink controller and want to use it when collision detection is ready i’m a bit blocked by this air to ground data traffic yam.

Does anybody have a clue how to handle this ?.. !
-Lowering data stream Luna’s ?. How ?
-Not sending Luna data over 915 ? ( need the rest however ) How ?.

Yes, the avoidance messages can overload slow telemetry links.
As for latest experiments, I used WiFi based links based on esp-01 (as for the Pixracer) or a Companion Computer running mavlink router.

Thank You for making this clear,

So i still have a Walkera 2.4Ghz air & ground unit lying around .It worked with the Pixhawk i tested it a while ago.

This would be a better option for this you think ? .

Oh what…ill plug it in !..and see… :slight_smile:

EDIT-1 04-09-2020 …tested it on 2,4Ghz, Air to Ground Telemetry same result… :smirk:

(just to make it clear …The walkera Ground connects Through BT with PC or Android device and with 2.4Ghz to the air unit on the Pixhawk )

EDIT-2 05-09-2020 Non of the Air-> Ground units work. The Luna’s block all traffic when connected .???

Followup;

I can see the user manual and the test GUI on http://en.benewake.com. Where do I find the i2c firmware and the firmware update tool?

Hi,
I created google drive link, you can download it from here:
https://drive.google.com/file/d/1nBK6DKMCsqkglrK0LP9iEbl6VUPuMFkj/view?usp=sharing

Thank you, @ibrahimqazi. I was able to download the files.

Ari.

Correlation between barometric and lidar altitude: