Servers by jDrones

Avoidance Experiments with the POC and Benewake TFMINI

(Vabe) #36

Yesterday I tried playing a bit with Mavlink messages but I couldn’t get it to work, so I decided to give the code on Github a try but also that I wasn’t able to run…
I’ve tried different baudrates and swapping RX and TX cables but nothing solved the problem.
I’ve used an arduino mega and since I don’t have the attiny etc. I just placed constant values for distance…

Any idea what I could be doing wrong?
Thanks in advance

(juarendra ramadhani) #37

Hello Mister Poirier,

I am very interested in your project about avoidance. I have tried to implement it on my pixhawk with the code that you specified about using arduino. But the results of the radar in the mission planner did not show any changes. I am very confused about anything from mavlink from Arduino to Pixhawk to nothing. Yet when I use raspberrie for communication with Pixhawk, it can happen well. I don’t know where is my fault, can you help me solve my problem?

(ppoirier) #38

This code runs on an Arduino only.
You have to validate that the systems is sending MavLink messages using the Mavlink inspector tool (CTRL-F on Mission Planner)

(juarendra ramadhani) #39

I’ve tried the mavlink inspector, and the results are still not there. I just copied pasted yout code on Github, nothing I changed. i use radiolink pixhawk 2.7 and it runs on arducopter 3.6. Does the type of pixhawk and software also affect?

(juarendra ramadhani) #40

Btw, my arduino is promini 5v, we know pixhawk have level power 3.3v,
does it matter?

(ppoirier) #41

You have to confirm the code is working ok on promini : you must have data going out at the serial port, you should see MavLink binary message output on Arduino monitor

(juarendra ramadhani) #42

I’ve tried to see the serial output from Promini in serial monitor. but I can’t read it because it only shows binner code in the form of boxes and occasional question marks

(ppoirier) #43

That is ok , then just make sure you set both serial speed correctly and get tx-rx connection. Then you should configure to read proximity message from MavLink
Proximity Type 2

(ppoirier) #44

Revisiting the POC with a Q330 and 5 TFMini covering full 180 Deg

Actually it is 6 TFMini there is one looking down acting as altimeter as well:


Avoidance set to 2 Meter

Here is the video of test (Sorry for poor quality and messy background…)

(RickyG) #45

very cool as always
Keep up the cool and interesting work

1 Like
(Siya Liu) #46

That’s very interesting ! Thank you for the update. :revolving_hearts:

I think TFmini Plus (12m, FOV 3.6°, 1-1000Hz, IP65) also works ?

(ppoirier) #47

Thank you
Yes this model would work better as we could speed up the sensor scanning to 1 khz

(Barış Ekici) #48

Great, is it possible to cover 360 with only 4?

(ppoirier) #49

YIf the sensor has large FoV, you certainly use it. But if you use TFMini that just covers 3-4 degs it makes the detection quite spotty.

(Donald Gibson) #50

We are currently working on POC using four TFmini Plus for the Ranger Q700. Still having some I2C issues with multiple sensors. The controller, sensor interface and MAVLINK interface are via Teensy 3.2. I’ll post the debugged system here when its tested properly.

(Siya Liu) #51

@Arbutus Hi, for I2C issues, may be you could check the Github info and see whether it helps a little ?

(Slyv06) #52

@Siya, @Arbutus , Benewake support has direclty provided a new firmware 02.00.03 for TFmini plus and I have tested it with 5 TFM+ in I2C with arduino nano (post here) and it works very well. Maybe they will publish this new firmware soon?

Now, I think that using an arduino or teensy is useless with I2C sensors, so I hope someone mastering C++ could help to continue the development of the driver directly in ardupilot firmware.
@lucasdemarchi has created the files here for a direct connection to an I2C port on the FC, but I don’t know if it’s a good implementation (the .c file seem to run in UART mode, and the good request is an “on-demand” request/response (I²C sensors can’t speak on the bus when they want!), and no need to parameter the frequency of measurements (UART mode only).
Then, we would need to “map” I²C sensor(s) address(es) to an avoidance direction/quaternion in mission planner.

(Donald Gibson) #53

The new Benewake firmware is a great improvement. Most polling issues are resolved when sampling multiple I2C TFmini Plus with the Teensy providing buffering. @Slyv06 agreed - much better if multiple sensor array timing and sensor mapping was internal to Ardupilot.

(Lucas De Marchi) #54

@Slyv06 @Arbutus the implementation you mentioned is already part of ardupilot for some months now. You don’t need any teensy: you can connect them directly to a I2C port on your flight controller if you are running an updated version of the software.

(Slyv06) #55

Thank you Lucas for your answer. From what I experimented with arduino , the measurement request for I2C is { 0x5A, 0x05, 0x00, 0x01, 0x60 }; (in centimeter) , which is different from what I read in the cpp CMD_READ_MEASUREMENT function ( { 0x5A, 0x05, 0x00, 0x07, 0x66 }; is the output activation in UART mode for a single sensor). I’ll give a try with the code you did, and try to assignate a direction for each sensor.