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

关于RPLIDAR A Series的通讯协议高速传统模式的夹角补偿量的符号位问题 #87

Open
shq2333 opened this issue Oct 25, 2022 · 0 comments

Comments

@shq2333
Copy link

shq2333 commented Oct 25, 2022

RPLIDAR A Series的通讯协议21页表明高速传统模式的夹角补偿量是带符号位的,意思是最高位第6位是符号位吗?
我看sdk的代码并没有处理这个符号位的问题,直接当作6位的数来减去了,想问这个夹角补偿量到底要怎么处理?

int angle_offset1_q3 = ((_cached_previous_capsuledata.cabins[pos].offset_angles_q3 & 0xF) | ((_cached_previous_capsuledata.cabins[pos].distance_angle_1 & 0x3) << 4));
int angle_offset2_q3 = ((_cached_previous_capsuledata.cabins[pos].offset_angles_q3 >> 4) | ((_cached_previous_capsuledata.cabins[pos].distance_angle_2 & 0x3) << 4));
angle_q6[0] = ((currentAngle_raw_q16 - (angle_offset1_q3 << 13)) >> 10);
syncBit[0] = (((currentAngle_raw_q16 + angleInc_q16) % (360 << 16)) < angleInc_q16) ? 1 : 0;
currentAngle_raw_q16 += angleInc_q16;
angle_q6[1] = ((currentAngle_raw_q16 - (angle_offset2_q3 << 13)) >> 10);
syncBit[1] = (((currentAngle_raw_q16 + angleInc_q16) % (360 << 16)) < angleInc_q16) ? 1 : 0;
currentAngle_raw_q16 += angleInc_q16;

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

1 participant