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

Pandar40PUnit.distance of type uint8_t is being compared with a number over 8-bits #3

Open
rdelfin opened this issue Oct 7, 2020 · 1 comment

Comments

@rdelfin
Copy link

rdelfin commented Oct 7, 2020

This line in pandarGeneral_internal.cc seems to be written to do the wrong thing. There's two separate issues:

  1. unit.intensity is of type uint8_t and is being compared against 0x0101 (257 in decimal), a number that takes up more than 8 bits. As such, the entire clause in this line is always being rendered as false. Was this supposed to be 0b0101, a.k.a 0x0005?
  2. unit.distance, a double, is being compared against 0x010101, (65793 in decimal). While this is valid, I get the impression from the comments that this is supposed to be comparing the binary representation stored in unit.distance with either 0x010101 or 0b010101. However, instead it's casting the float to an int and comparing the value (not the representation). Is this intended?

I attempted fixing it, but unfortunately I'm don't have enough context to know what the intent was supposed to be here. Could I get some help getting this fixed? Thanks!

@yangfanFred
Copy link
Contributor

Hi rdelfin,

We will look into this and get back to you.

Thanks,
Fred

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

No branches or pull requests

2 participants