-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inmoov2 heart 2 #1418
base: develop
Are you sure you want to change the base?
Inmoov2 heart 2 #1418
Conversation
… into inmoov2-heart
… into inmoov2-heart
…robotlab into inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…to inmoov2-heart
…/myrobotlab into inmoov2-heart
…to inmoov2-heart-2
…to inmoov2-heart-2
…to inmoov2-heart-2
…to inmoov2-heart-2
…to inmoov2-heart-2
@@ -538,8 +538,7 @@ public Plan getDefault(Plan plan, String name) { | |||
listeners.add(new Listener("publishStopAnimation", getPeerName("neoPixel"))); | |||
// listeners.add(new Listener("publishProcessMessage", | |||
// getPeerName("python"), "onPythonMessage")); | |||
listeners.add(new Listener("publishProcessMessage", getPeerName("python"), "onPythonMessage")); | |||
|
|||
listeners.add(new Listener("publishProcessMessage", getPeerName("python"), "onPythonMessage")); |
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.
should the callback method be onProcessMessage ? to follow our normal convention ? we can refactor this to make it consistent at a later time.
* Checks battery, flashes leds and processes all the configured checks in | ||
* onHeartbeat at a regular interval | ||
*/ | ||
public Heartbeat publishHeartbeat() { |
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 does break with convention a bit.. normally we'd have a publishHeartbeat(Heartbeat beat) ... that simply returns the Heartbeat passed... the code below here, could be handled in the heart thread itself instead.. and just invoking publishHeartbeat with the beat that it created in that cycle... just curious why the departure from that convention?
@@ -562,17 +667,32 @@ public void enableRandomHead() { | |||
} | |||
} | |||
|
|||
public void enable() { |
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.
could this list be more dynamic, perhaps from the default inmoov plan instead of this enumerated list here?
@@ -2018,105 +2229,6 @@ public void speakBlocking(String format, Object... args) { | |||
} | |||
} | |||
|
|||
@Deprecated /* use startPeers */ | |||
public void startAll() throws Exception { | |||
startAll(null, null); |
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.
can we leave this in and have it call startPeers ?
} | ||
|
||
@Deprecated /* use startPeers */ | ||
public void startAll(String leftPort, String rightPort) throws Exception { |
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.
similar to above, can we just have this call startPeers? leave this method in for convenience sake?
@@ -2132,48 +2244,7 @@ public void startedGesture(String nameOfGesture) { | |||
} | |||
|
|||
public void startHeartbeat() { | |||
addTask(1000, "publishHeartbeat"); |
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 time should be configurable or pulled out as a constant for the interval here..
In general this is the beginning of a much more structured approach of processing in python.
No longer fragile with name dependencies. No global vars at all except runtime.