Software Update for new Lidar Lite v3

Hello,
I am trying to use new Lidar Lite v3 and I am using PX4 v1.9.2.
With this version of software Lidar probe() function fails because of incorrect reset_sensors() function.
I check the history of the source code and reset_sensors() function changed.
This part of code changed in in this commit: 5eefd94.

Here is the reset_sensors() function:
int
LidarLiteI2C::reset_sensor()
{
px4_usleep(15000);

	int ret = write_reg(LL40LS_SIG_COUNT_VAL_REG, LL40LS_SIG_COUNT_VAL_MAX);

	if (ret != PX4_OK) {
		return ret;
	}

	px4_usleep(15000);
	ret = write_reg(LL40LS_MEASURE_REG, LL40LS_MSRREG_RESET);


	if (ret != PX4_OK) {
		uint8_t sig_cnt;

		px4_usleep(15000);
		ret = read_reg(LL40LS_SIG_COUNT_VAL_REG, sig_cnt);

		if ((ret != PX4_OK) || (sig_cnt != LL40LS_SIG_COUNT_VAL_DEFAULT)) {
			PX4_INFO("Error: ll40ls reset failure. Exiting!\n");
			return ret;

		}
	}

	// wait for sensor reset to complete
	px4_usleep(50000);
	ret = write_reg(LL40LS_SIG_COUNT_VAL_REG, LL40LS_SIG_COUNT_VAL_MAX);

	if (ret != PX4_OK) {
		return ret;
	}

	// wait for register write to complete
	px4_usleep(1000);

	return OK;
}

My question is:
What is the logic behind these changes ? Where these sleeps come from ? How did developers understand that they needed sleep in reset function ? Is there any documentation about reset sequence of lidar lite v3 ?

This is the PR where the commit was introduced, it has good information behind the changes, perhaps it helps you understand whats going on.

1 Like

Hi rroche,
I saw this PR, but nothing explained about reset logic related changes. They just say new logic properly resets the device. No information provided in device datasheet about these changes.

Hey, guys, do you have any idea about the question above @cmic0 @TSC21?

What is the logic behind these changes ? Where these sleeps come from ? How did developers understand that they needed sleep in reset function ? Is there any documentation about reset sequence of lidar lite v3 ?