Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Periph: improved probing of rangefinders #23104

Merged
merged 4 commits into from Mar 6, 2023

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Mar 5, 2023

This fixes a few issues with peripheral rangefinder init

  • cope with sensors that take a long time to startup (eg. LW20)
  • cope with sensors that are powered on separately to the periph CAN node
  • cope with boards without a uart and only i2c sensors

issue reported here: https://discuss.ardupilot.org/t/ap-periph-not-working-with-lightwarei2c/95913

needed for AP_Periph with slow startup sensors or sensors that power
on separately to the CAN node
these are used with sensors that may take a long time to startup and
the delay won't cause any issues as there are no other sensors
supported
if no uart then still check for non-uart sensors
@tridge tridge merged commit a4a52c3 into ArduPilot:master Mar 6, 2023
@patrickpoirier51
Copy link

---- NO READING ----
Testing by connecting LW20 to I2C of Matek with these parameters
BRD_SERIAL_NUM,0
CAN_BAUDRATE,1000000
CAN_NODE,0
DEBUG,0
FLASH_BOOTLOADER,0
FORMAT_VERSION,2
RNGFND_BAUDRATE,115200
RNGFND_MAX_RATE,50
RNGFND_PORT,0
RNGFND1_ADDR,102
RNGFND1_FUNCTION,0
RNGFND1_GNDCLEAR,10
RNGFND1_MAX_CM,700
RNGFND1_MIN_CM,20
RNGFND1_OFFSET,0
RNGFND1_ORIENT,0
RNGFND1_PIN,-1
RNGFND1_POS_X,0
RNGFND1_POS_Y,0
RNGFND1_POS_Z,0
RNGFND1_PWRRNG,0
RNGFND1_RMETRIC,1
RNGFND1_SCALING,3
RNGFND1_STOP_PIN,-1
RNGFND1_TYPE,7

And on Cube Orange (4.3.4)
RNGFND1_ADDR 0
RNGFND1_TYPE 24

When connecting the LW20 directly to Cube Orange I2C with these parameters
RNGFND1_ADDR 102
RNGFND1_TYPE 7
I have correct Distance Reading

@rishabsingh3003
Copy link
Contributor

I have had to send my LW20 back to LightWare because it isn't working at all. Can't test till it comes back repaired from them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants