dennisss / tansa

Dancing Robotics Platform
MIT License
39 stars 16 forks source link

Throttle Lighting Commands #93

Closed dennisss closed 7 years ago

dennisss commented 7 years ago

I presume that currently lighting commands are sent at the same 100Hz frequency that is used by the motion. This may cause the network throughput to look like we're flying double the drones.

Discuss an appropriate milestone for this depending on people's availability.

tessmichi commented 7 years ago

So far I have been able to limit the amount of commands - the controller keeps track of each light's current intensity and only sends a new command if the intensity has changed by >0.01 Waiting to close this, as I'm not sure what else should be done

abramowitzK commented 7 years ago

You can have a counter in the player class that only updates lighting if it's even. Increment it everytime you call step

tessmichi commented 7 years ago

Will do this right now

tessmichi commented 7 years ago

I would actually like to evaluate this a little bit more before choosing to implement it. When I implemented the suggestion to only update on even hundredths of a second, it looks like the lights aren't getting updated frequently enough. With the already implemented solution so far - the first bullet point from Dennis's original comment - such that the intensity is only updated when it has changed by >0.01, the lights already only get updated 1,2,or3 times per tenth of a second depending how fast a jocs file says to update the lights. And if those two updates happen to fall on an odd hundredth of a second, that tenth of a second could be skipped all together. I assume this won't be acceptable but will ask Mike about it.

tessmichi commented 7 years ago

Another concern for throttling based on time is that for strobe actions, we might need 100th of a second accuracy. A workaround would be to separate the code for regular light actions versus strobe actions even more, but we should discuss on Saturday.