is the ll40ls compatible with the posix platform (rpi3) because when I compile I get error about (nuttx/clock.h and nuttx/wqueue.h).
You'll need to go through and fix those issues. Remove the nuttx headers first, then readd generic headers as needed.
Or in other words: It is reasonably easy and a pull request would be appreciated.
So I just have to remove the headers ? because after that several problems concerning the variable or function 'work' appear .
@belaidH yes remove those headers, and in that case add #include <px4_workqueue.h>.
Okey thank you. I will try it
I think now it's okay for the workqueue. but I get an other error
about the irqstate_t on the LidarLiteI2C.cpp file (I would use the I2C of the rpi).

@belaidH you can replace the critical sections with ATOMIC_ENTER/ATOMIC_LEAVE.
On NuttX it's the same thing - https://github.com/PX4/Firmware/blob/master/src/drivers/device/nuttx/cdev_platform.hpp#L10
On other platforms it's a lock - https://github.com/PX4/Firmware/blob/master/src/drivers/device/posix/cdev_platform.hpp#L6
@dagar thank you. after some tries it's compiled. Is there manip to start the ll40ls after launching the ./px4 because I don't see his topic when I use the "uorb top" command.
Does it work if you start it manually ll40ls start?
Once you're sure it's working you could add it to the raspberry pi configs here. https://github.com/PX4/Firmware/tree/master/posix-configs/rpi
@dagar when I try this there is an error "Error opening fd".
but I have doing changed before on LidarLiteI2C.cpp, otherwise generate errors "no matchingfunction" at compile time.
case SENSORIOCGQUEUEDEPTH:
return _reports->size();
default: {
int result = LidarLite::ioctl(filp, cmd, arg); // to int result=LidarLiteI2C::ioctl(flip,cmd,arg);
if (result == -EINVAL) {
result = I2C::ioctl(filp, cmd, arg); // to result= LidarLiteI2C::ioctl(flip,cmd,arg;
}
return result;
}
}
}
If you open a pull request I can review and cross test. The I2C might be wrong for the raspberrypi as well.
On Linux the i2c buses map to /dev/i2c-X.
@dagar okey, this is my pull requests https://github.com/belaidH/Firmware/pulls
Can you open as a pull request against the main PX4 Firmware repository? https://github.com/PX4/Firmware
@dagar yes, I did it. https://github.com/PX4/Firmware/pull/8579
Done!