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

Distance Sensor : Driver for Lanbao CM8JL65 #11136

Merged
merged 16 commits into from
Jan 15, 2019
Merged

Distance Sensor : Driver for Lanbao CM8JL65 #11136

merged 16 commits into from
Jan 15, 2019

Conversation

cmic0
Copy link
Contributor

@cmic0 cmic0 commented Jan 3, 2019

Driver for a new distance sensor (Lanbao PSK-CM8JL65-CC5).

Additional context
If using TELEM1 port, disable MAVLINK messages there (MAV_0_CONFIG PARAMETER).
Data is published on distance_sensor topic at 10Hz rate.

Test data / coverage
image

@cmic0
Copy link
Contributor Author

cmic0 commented Jan 3, 2019

@DanielePettenuzzo @RomanBapst FYI

@LorenzMeier
Copy link
Member

Build failure in CI. Please also change from TELEM1 - that is not a great default because it is commonly used.

@cmic0
Copy link
Contributor Author

cmic0 commented Jan 4, 2019

@dagar I get build failures on things not related to this driver. Could you check please?

@mhkabir
Copy link
Member

mhkabir commented Jan 4, 2019

This should be using the new serial port allocation interface.

@dagar
Copy link
Member

dagar commented Jan 4, 2019

@dagar I get build failures on things not related to this driver. Could you check please?

The fixedwing mission test has somewhat recently started failing intermittently. I'll restart it for now.
Issue created #11144

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cmic0, I reviewed and provided some feedback.
Most importantly we need to change to non-blocking reads since it's running on the work queue.

@cmic0
Copy link
Contributor Author

cmic0 commented Jan 8, 2019

@bkueng thanks for the review! Applied your suggestions, now should be ok.. let me know :-)!

bkueng
bkueng previously approved these changes Jan 8, 2019
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now.
I restared CI, let's see if it passes.

@dagar
Copy link
Member

dagar commented Jan 8, 2019

You'd need to rebase to get the Jenkins hardware test to pass, but it isn't relevant for this PR.

dagar
dagar previously approved these changes Jan 8, 2019
@dagar
Copy link
Member

dagar commented Jan 8, 2019

Is this a standard CRC? I can't seem to find the datasheet for this device.
Consider the existing CRCs in systemlib, leddar_one, rc sumd, micrortps, or even NuttX itself.

cmic0 added 16 commits January 9, 2019 16:47
TODO: Parsing the data

Signed-off-by: Claudio Micheli <claudio@auterion.com>
TODO:
- Clean up the code
- Add uORB publishing messages

Signed-off-by: Claudio Micheli <claudio@auterion.com>
TODO: Need to fix driver cycling.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Serial is now cycled with work_queue rescheduling if some bytes are missing.

TODO: - Fix occasional sensor spikes (can be identified with crc)
      - Clean up the code
      - disable debug printf


Signed-off-by: Claudio Micheli <claudio@auterion.com>
TODO : Adjust work_queue rescheduling (to always have a 10Hz cycle)

Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
First "stable" version of the driver.

TODO: - Cleanup the code
      - Bench test (compare data with IMU)
      - Flight Test

Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Disabled by default.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
Device port can be set via SENS_EN_CM8JL65 parameter:
SENS_EN_CM8JL65 = 0 -> Disabled
SENS_EN_CM8JL65 = 1 -> Enabled on TELEM2
SENS_EN_CM8JL65 = 2 -> Enabled on TELEM1

Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
Signed-off-by: Claudio Micheli <claudio@auterion.com>
- Removed blocking serial.
- Added passing variables by reference to parser.
- Removed commented code.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
@cmic0 cmic0 dismissed stale reviews from dagar and bkueng via 50917f6 January 9, 2019 16:00
@cmic0
Copy link
Contributor Author

cmic0 commented Jan 9, 2019

@dagar rebased on upstream, CI passed!
About the CRC: I got the infos from the manufacturer. It is a CRC16 IBM 8005. The two lookup tables defined in the code are standard 8005 ones, just splitted into MSB and LSB bytes. CRC calculation via lookup tables should be faster at the expense of some more memory occupation (not a CRC16 guru.. google helped me :-) ).

@bkueng bkueng merged commit 8a313ff into PX4:master Jan 15, 2019
@bkueng bkueng deleted the pr-distance_isl2950 branch January 15, 2019 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants