AP_RangeFinder: add DTS6012M driver support#32188
AP_RangeFinder: add DTS6012M driver support#32188peterbarker merged 4 commits intoArduPilot:masterfrom
Conversation
|
do not use merge commits...rebase (not normally needed unless failing CI for something this PR changes)...must pass CI Has this been tested on a plane as a downward facing RF over grass?it would be interesting to check its range in that environment as a landing assist RF.... if you would like that tested, I would be happy to test |
64357df to
a0bb954
Compare
Understood and done thank you; first PR on this repo I have not yet tested it in flight; it was definitely going into some of my wings for autoland, but needed the driver support to start; thought I might as well PR it for the code review first in case I might have something horribly wrong in there 😄 |
a0bb954 to
018ea91
Compare
|
Looking at precedent RF PR I went ahead with the sim autotest already |
peterbarker
left a comment
There was a problem hiding this comment.
Needs adding to ./Tools/scripts/build_options.py so it appears at https://custom.ardupilot.org
Looking good.
3adfe3f to
507de09
Compare
|
Thanks @peterbarker all CR implemented, also here's a hardware demo |
9c88eaf to
54e72f7
Compare
|
@FractalEngineer Nice demo! I'll try to get this guy over here too, it seems like he'd be happy to check out your work :) https://github.com/PlaneStuffRC/DTS6012M_to_TFmini |
peterbarker
left a comment
There was a problem hiding this comment.
Just fix the return value checking and the bad zeroing-of-memory and we're good.
c6d7036 to
5da2367
Compare
5da2367 to
a090813
Compare
e7d35b9 to
5f306b2
Compare
|
Alright all changes implemented, autotest passed, still running fine on hardware. |
peterbarker
left a comment
There was a problem hiding this comment.
LGTM
Tested locally with valgrind, all good
| */ | ||
| void AP_RangeFinder_DTS6012M::send_start_command() | ||
| { | ||
| static const uint8_t cmd[] = { |
There was a problem hiding this comment.
| static const uint8_t cmd[] = { | |
| static const uint8_t cmd[] { |
|
Merged, thanks! |
|
This looks suspiciously similar to the Benewake TF20-L. I wonder if it uses the same protocol @FractalEngineer could you check this? We already have a lot of rangefinder drivers so we definitely don't need duplicates! |
man wouldn't I have wished it did that would have saved me the trouble lol But not in my understanding; other than the choice of going serial vs i2c (for which they seem to have mismatched addresses anyway, 0x51 vs 0x10) the register layout appears fundamentally incompatible
Also mismatched units; mm vs cm Bunch of tiny unfortunate discrepancies; could almost pass as intentional eh |
|
Hi @FractalEngineer, sorry, I pointed you at the wrong driver. Our serial driver for the TFS20-L is here. PeterB and I looked into after my comment above and we think that the protocol is actually different. From my point of view, it must be the same hardware, it can't be a coincidence but I guess the software is different for whatever reason. |
|
Ok I just looked up the TFS20 hardware and I'm very aggravated now. Seems like identical hardware indeed, all the way down to the PCB marking (DT011B v2). Most upsetting. But yea looks like a couple software discrepancies;
The mind boggles as to why did it have to be that way. Ohwell. |


This PR adds UART support for this cute 1.35g, 20m rangefinder.
Spec sheet (english)
Datasheet (chinese)
Configuration:
Software
SERIALn_PROTOCOL = 9 (rangefinder)
SERIALn_BAUD = 921 (set by driver)
RNGFND1_TYPE = 47 (current latest is 46)
RNGFND1_MIN = 0.2
RNGFND1_MAX = 20
Hardware
Pull Pin 5 down for UART mode
Tested on copter micoairH743v2, returns accurate distance in configurator.