Action.sendGoal(): Why is resultCallback required? #1129
-
|
Hi! Right now I'm working on implementing a Charge I'm just wondering why |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
In callback-oriented programming, it's pretty normal to have a required callback to make it clear via the function signature that a particular function is callback-oriented, even if it's a callback some people might exclude. It's perfectly valid to just pass However, I might advise you to change your design of your Action! It sounds like you might be setting yourself up for some synchronization pain later. Personally, if I was setting up an Action that "tells the robot to go charge", I would have the Action's feedback indicate how far into the charging process it is, and the result type return that the charging completed successfully or unsuccessfully. |
Beta Was this translation helpful? Give feedback.
In callback-oriented programming, it's pretty normal to have a required callback to make it clear via the function signature that a particular function is callback-oriented, even if it's a callback some people might exclude. It's perfectly valid to just pass
() => {}if you deliberately want to do nothing.However, I might advise you to change your design of your Action! It sounds like you might be setting yourself up for some synchronization pain later. Personally, if I was setting up an Action that "tells the robot to go charge", I would have the Action's feedback indicate how far into the charging process it is, and the result type return that the charging completed successfully or uns…