Closed CarsonF closed 2 years ago
I like the addition of
orientation
andranging
as well as the move of the config to the zone. However, reading this structure i feel like it might make sense to add asensor
object which holds all sensor specific settings? I know i previously denied that, but at the current state it makes sense to build aSensor
inRoode
instead ofzone
,orientation
andranging
. What do you think? Of course we can skip that to another PR anytime soon.
Yeah I totally agree. Was it was coming together I thought that as well. I can do it here if you want or we can wait. Up to you.
- Cause you are very energetic to ditch getter/setter -> lets do so
I don't want to bully you into it lol. I do feel strongly about it and I tried to post some reasoning. I definitely want to look into immutability or blocking writes where not expected. But also given the nature of how the codebase is consumed it might not be too important...
- Your C++ auto-formatter is configured different as mine, which sucks because there is a lot of formatting in this PR. Ill add a auto-formatter config to the project to prevent that.
I see you've added a clang formatter config. I was missing that as well. The formatting was inconsistent but I didn't want to do a blanket reformat of code I wasn't touching. Also I wasn't sure which preferences you had. I'll rebase and reformat π
Rebased & got new formatting in. More tomorrow.
There's still lots of clean up that can happen. But since this is blocking you, I'll stop here π
There's still lots of clean up that can happen. But since this is blocking you, I'll stop here π
This is a great PR! I'll need to test it in detail before merging it, but it looks good to me. Feel always free to open another PR π
This new structure breaks things up by subject instead of the manual/automatic parameter values. I believe this is much easier to understand and allows parameters to be more granularly defined with automatic or manual values.
New minimal config with defaults
vl53l1x
section can be omitted if using defaultsi2c
section can be omitted if on default pins SDA/SCLAll options spelled out
I tried to not touch too much, but it was hard. One of my main goals was to get stuff out of
Roode
class. So having separateZone
,Threshold
,ROI
objects helps with that. But still configuring everything throughRoode
defeats that purpose.There's a lot of data points here. I avoided a lot of getters & some setters because it's just so much boilerplate that doesn't add any value. Usually it's said to be "cleaner" because "encapsulation", but it's really not. Data set via property or setter is the same thing, the setter doesn't restrict anything. I have them in a few places where it's easier to code gen in python. As we continue to refactor we can reduce the tightness of the coupling between these objects. Just trying not to do too much at once here.