You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uint8_t MSB = (Duration & 0xFF) >> 8;
Results in MSB = 0 at all times. So the higher part of the duration is lost.
bit adjustment for different modes is on wrong bits with wrong values
Suggested fixes
`
// Reset the highest two bits of Duration and mask out the lower byte,
// then shift right.
uint8_t MSB = (Duration & 0x3F00) >> 8;
uint8_t LSB = Duration & 0xFF;
// 1st bit, set 3D or Dual
if(mode == eRunMode::ModeDual) MSB |= (1 << 7);
// 2nd bit, set Auto or Fixed
if(setAutoDuration == false) MSB |= (1 << 6);
`
Using your method I get the correct values for duration. However, I think the param for auto is wrong (you're implementation is fine, just the documentation is wrong). They said that 0 is auto and 1 is manual when you examine the launch file, but if you set it to 0, then setAutDuration is false (conversion from 0 dec to binary is false) and therefore the bit gets set to 1.. which means fixed. Once you figured the above out and I figured out the fixed/auto, I could set the duration to a lower number (3500) and it got rid of all my floor reflections. Thank you! I didn't want to give up on this like cygbot seems to have :)
Code
Consider this code fragment in your version v0.2.2:
cyglidar_d1/src/cyglidar_pcl.cpp
Lines 69 to 75 in b30e990
Problems
uint8_t MSB = (Duration & 0xFF) >> 8;
Results in MSB = 0 at all times. So the higher part of the duration is lost.
bit adjustment for different modes is on wrong bits with wrong values
Suggested fixes
`
// Reset the highest two bits of Duration and mask out the lower byte,
// then shift right.
uint8_t MSB = (Duration & 0x3F00) >> 8;
uint8_t LSB = Duration & 0xFF;
// 1st bit, set 3D or Dual
if(mode == eRunMode::ModeDual) MSB |= (1 << 7);
// 2nd bit, set Auto or Fixed
if(setAutoDuration == false) MSB |= (1 << 6);
`
Referenced manual
![Set_3D_Pulse_Duration](https://user-images.githubusercontent.com/85310490/185742456-0e977765-c435-4944-8151-f25dc560d70c.png)
Screenshot from this manual:
The text was updated successfully, but these errors were encountered: