ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.02k stars 17.57k forks source link

AP_Proximity: Device checksum value is not wrong. #19427

Closed muramura closed 1 year ago

muramura commented 2 years ago

Bug report

Issue details

https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Proximity/AP_Proximity_Cygbot_D1.cpp#L116 The size value is missing 1 byte in this process.

Please describe the problem

https://github.com/CygLiDAR-ROS/cyglidar_d1/blob/v0.1.3/src/CygbotParser.c#L57

The original calculates the checksum from Length1. The ArduPilot process makes it calculate the checksum from Length1, Length2 and the payload only. One byte of the payload header is missing. The comment describes that the checksum does not match. This is because of a mistake in the process.

Version What version was the issue encountered with

ArduCopter V4.2.0-dev

Platform [X] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type What type of airframe (flying wing, glider, hex, Y6, octa etc)

quad

Hardware type What autopilot hardware was used? (Pixhawk, Cube, Pixracer, Navio2, etc)

SITL

Logs Please provide a link to any relevant logs that show the issue

rmackay9 commented 2 years ago

This one is for @rishabsingh3003

rishabsingh3003 commented 2 years ago

Thanks, @muramura. I'll check this out and push a fix!

Ryanf55 commented 1 year ago

@muramura Does this solve your issue?

rishabsingh3003 commented 1 year ago

I believe I fixed this issue.