Conversation
loukylor
left a comment
There was a problem hiding this comment.
Services would probably work better here (rather than a pub and sub) since you can send back a response after receiving a request. You can look at #72 or the arm code to see an example of services. Here's the relevant ROS docs
@loukylor I'll take a look at it tomorrow. Ideally, this is just a temporary solution for making mission control able to reconnect to the websocket automatically. What I really want to do is use websocket ping/pong control frames, since they'll end up using significantly less data. So, I'll probably modify all this code anyway - I just have to figure out how to listen to pings/pongs through rosbridge_server (which may require modifying it). |
|
Ideally we don't have to modify |
|
Personally, I think sub/pub right now is fine, and can always overhaul it as this is a nice feature. I am also not too worried about bandwidth for this one as it is just sending the time. Right now though, it doesn't work for me for some reason though. |
|
Nevermind, I've learned that for some reason browsers don't expose ping/pong control frames, so we won't be able to use them. I'll look into services - one issue with pub/sub is that ping/pong isn't directed towards a single client, which potentially breaks things if we ever want to support multiple clients. |
@loukylor ROSLib services don't appear to support CBOR, and ends up sending more data anyway. I agree that a service model makes more sense, but I'm not sure what real benefits it brings. Switching to a service will just make the message length longer, and I'm not sure whether that's a good idea for something that's sent as frequently as a heartbeat. |
|
While I still disagree that services may affect bandwidth, since a single service call per second would not even be on the order of 100bytes per second, since this is already implemented I am okay with merging this. I will ensure formatting is right and review functionality then approve. |
|
Has this been tested? |
# Conflicts: # src/heartbeat/heartbeat/heartbeat.py
@loukylor Yes, Adam and I tested it yesterday. |
This sends heartbeat responses so that mission control can detect disconnection and reconnect automatically.