NUbots / NUbots/NUcontroller

Unexplained byte LSL operation for CRC calculation in nusense's dynamixel packetiser.decode() method

Open
#19 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

https://github.com/NUbots/NUcontroller/blob/main/NUSense/Core/Src/dynamixel/Packetiser.hpp

line 117-118, the read byte is LSL'ed then is put in the packetiser's buffer member. I assumed / expected it to be at least put in the buffer first before being LSL'ed for the length calculation. I tried this with opencr and as expected we encountered a CRC mismatch but for some reason it works with nusense. I believe it must be investigated and explained to prevent ourselves from going insane down the line.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with NUSense/Core/Src/dynamixel/Packetiser.hpp, especially lines 117-118 in the decode() method. Trace how the read byte is shifted, stored in the buffer, and used for CRC length calculation, then compare the behavior with the OpenCR path mentioned in the issue. Done means the byte ordering and CRC behavior are explained and any mismatch is resolved or documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.