Replies: 1 comment 3 replies
-
You might want to look at halsim_xrp, which is much more efficient then the web sockets, and was created since the XRP couldn't keep up. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all
I am trying to work on some hardware via the websocket protocol. What I noticed is that halsim_ws_client seems sending a lot of requests even for devices that's not defined in the FRC code. For example, there are only 2 motors in the java code, but the WS messages is sending message like "{
"data": {
"<init": false
},
"device": "15",
"type": "PWM"
}"
There is really no device 15. Is that expected behavior? How can we tell the simulator only send data/request for defined devices?
For a fast laptop or newer device (e.g. Romi), that did not create a problem. However for lower-end CPU device (e.g. Lego Ev3), the web socket server can not keep it up - even for optimized micropython code - the data is just too much, causing a significant delay on robot movement.
I did find the undocumented "HALSIMWS_FILTERS" environment variable that limit message type, that dramatically cutdown the volume and allow the robot to function well, but no messages should be sent for non-exist device to flood the web socket server though even just for allowed message type (e.g. PWM).
Any insight is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions