-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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_RangeFinder: add support for RDS02UF radar driver on seria #23056
Conversation
e2ae54d
to
85dc15b
Compare
Why not use existing crc functions? |
Because the crc8_table used by this sensor is a fixed value defined by the manufacturer, it cannot be calculated by the formula |
85dc15b
to
f5db60a
Compare
f5db60a
to
14dea07
Compare
f5db60a
to
6b403e8
Compare
6b403e8
to
01cbad1
Compare
01cbad1
to
40ad4d7
Compare
Hi @zebulon-86, It looks like this is failing CI because of a problem with a definition. [ 469/1015] Compiling libraries/AP_RangeFinder/AP_RangeFinder_PulsedLightLRF.cpp |
b18d741
to
015fee3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has no metadata update to the rf type param
Hi @rmackay9 ,
Added |
@Hwurzburg
|
add metadata in
|
From Dev Call discussion - Redo the implementation with structure |
6bd9ba8
to
87218d5
Compare
@peterbarker will review parser and merge |
87218d5
to
94dd7d1
Compare
Added "memchr" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test this with a little bit of corruption, make sure it still generally works (AP_SIM_SERIALDEVICE_CORRUPTION_ENABLED). Run under valgrind when doing this.
parameter RNGFNDx_TYPE is 42 Apply suggestions from code review Co-authored-by: Peter Barker <[email protected]>
94dd7d1
to
bf17b5a
Compare
rebased, and fixed the pending comments |
Also tested with, AP_SIM_SERIALDEVICE_CORRUPTION_ENABLED and valgrind. Works well. |
// reset buffer | ||
body_length = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// reset buffer | |
body_length = 0; | |
// consume packet | |
move_header_in_buffer(sizeof(u.packet)); |
The current fixed size makes this NFC, but if we wanted to be able to read multiple packets at once this would be required....
move_header_in_buffer(0); | ||
|
||
// header byte 1 is correct. | ||
if (body_length < ARRAY_SIZE(u.parse_buffer)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (body_length < ARRAY_SIZE(u.parse_buffer)) { | |
if (body_length < sizeof(u.packet)) { |
... this is, after all, exactly what you're interested in.
The parse buffer can be larger than the packet, allowing for multiple packets to be read in at once (and different packets to be parsed out of the same buffer, of course)
|
||
union RDS02UF_Union { | ||
uint8_t parse_buffer[21]; | ||
struct RDS02UFPacket packet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically we really should mark this as PACKED
. Since all members are 8-byte quantities it doesn't really matter.
Merged, thanks all! |
@zebulon-86 I can find no vendor offering this device and Benewake does not list on its web page.....I cant see any reason to have a wiki entry for this device since its not available |
@Hwurzburg I believe Benewake plans to sell these. We have a chat with them where we could ask |
@rishabsingh3003 I see no chat in Skype or Discord for them.....if someone can give me a link as to where to obtain this device, I will create a wiki page and entry then |
Summary
Resubmit pull request,relevant : #22385
Adding new features
AP_RangeFinder:add support for RDS02UF radar driver on serial。
Documentation
Product URL:Microbrain Intelligent
Related Manuals:【Benewake(北醒)】毫米波雷达在无人机上避障资料汇总
Here are the dumped Manuals:RDS02U_Uart_Manual
For PDF:RDS02U
Change
Some tweaks to the code related to #22385
libraries/AP_RangeFinder/AP_RangeFinder_RDS02UF.h
The CRC table takes up too much flash space,so added the define of whether to enable CRC, which is not enabled by default, and only use the frame header and frame tail to judge the integrity of the frame. It is not a big problem not to do CRC when the serial communication is stable. Users can also choose to enable CRC according to the hardware situation.