This repository has been archived by the owner on Dec 1, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature/pm 524 Generalize motor controller #284
base: develop
Are you sure you want to change the base?
Feature/pm 524 Generalize motor controller #284
Changes from 1 commit
6abd775
c8f3af5
f07ebf8
1db4b01
7cf1336
9d320e5
fffab68
ae33d44
00e9bad
2e1b2f4
ef553b9
a60801f
087227e
9d8bc65
81423e5
5e73645
f0c296f
ea89e8e
03c994a
df36bbf
5edecb5
58fbd2f
855e436
e68a574
0a1c16a
c49c6b3
0fbe358
4f66858
b48674d
81f0db4
41257c8
79a93a3
1e55adb
ea171c0
9b5cc5c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will end horribly, if the
controller_
is anullptr
, always check you pointers before using them. I now see you do this a lot more, so be warnedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I build a check in hardware builder to ensure that every joint has a controller at startup, removing the need to check this every time during runtime.
PS previously, the check at startup was not there, while not everyone of the methods in joint did the nullptr check (e.g. Joint.getIMotionCubeState), so this should actually be an improvement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the hardware is not initialized by the hardware builder, what if it contains a bug that results in creating a
nullptr
? You can't assume that a check somewhere else will protect this class. I know not every method contained the check, but that is not an argument for completely removing it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm do you think a check in the constructor suffice? That will also immediately cover for all the plebs that appearantly like to make methods without these checks. Also, it will make the code less bloated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor would only check this once. Adding a check here would ensure that it is always a valid pointer.