Robot Not a Dev? Buy Now
Not a Dev?

Misty Community Forum

While running wander - Time of Flight error message TOFs not registered

When I run the skill “Wander” I get error messages wrt Time of Flights, especially LeftTOF not registered ("‘LeftTOF’ is not registered in this skill, so cannot unregister it." “2019-12-02T23:15:43.5359753Z”). Occasionally other skills cannot be unregistered either.

But when I go to the Command Center I can register and unregistered all of Misty’s skills.
Any thoughts about why my Misty is experiencing this inconsistency and how I might resolve it?

Hi @BoulderAl,

Is it correct to assume you’re running this Wander skill?

I know this skill unregisters all events each time a ToF is triggered to avoid repeating the callback until Misty backs up, and then re-registers all ToF and bump events after waiting for about 4 seconds. It’s likely that the skill sometimes sends a call to unregister event listeners that have already been unregistered, which would result in the log message you’ve described.

Yes, this is the Wander skill I’m running.
Is there a way to modify the code to change or eliminate these error messages? I may mess with the code and see what happens.
Thanks.

Please do! Our intention is for the code in that repository to be modified by the Misty Community. It’s really just the skeleton of a Wander skill, and we expect it to be iterated & improved upon. If you do modify it, feel free to submit a PR, or to share your skill here on the forums.

As for getting rid of those particular messages, I would have to spend a bit more time with the skill to understand what you might need to move around. One option could be to write a bit of code to perform a check to see which events are registered, and then call on misty.UnregisterEvent() to unregister only specific event listeners, instead of sending a blanket command that unregisters all event listeners.