Px4-autopilot: ll40ls for rpi3

Created on 30 Dec 2017  路  15Comments  路  Source: PX4/PX4-Autopilot

is the ll40ls compatible with the posix platform (rpi3) because when I compile I get error about (nuttx/clock.h and nuttx/wqueue.h).

All 15 comments

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).

capture du 2018-01-01 11-59-19

@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

Done!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgh5054 picture lgh5054  路  4Comments

felix-west picture felix-west  路  4Comments

bthnekn picture bthnekn  路  4Comments

kainism picture kainism  路  4Comments

robin-shaun picture robin-shaun  路  4Comments