michaeljenkin / unityros

a unity ros tool
35 stars 41 forks source link

Publishing custom message that requires BSON #4

Open kshitijgoel007 opened 8 years ago

kshitijgoel007 commented 8 years ago

Hi!

Thanks for creating this library, I've been using it a lot lately in my robust tele-operation work and it has been awesome. I am stuck at a small problem. I'm transferring a custom made message composed of Stochastic params (extremely compressed Dense Point Clouds). It is lower in size than sensor_msgs/PointCloud, but is significantly high to such extent that I am observing high network latency. Moreover, I am not reading data using roslibjs. I am using this repo in Unity C# to parse data. Currently, I have a nicely working JSON parser which parses my data with some latency.

Will this BSON enhancement work for such custom messages too? Other than writing a BSON parser, what other enhancements would my repo require?

Thanks for having a look. Awaiting your response.

Kshitij

kshitijgoel007 commented 8 years ago

Referencing this issue on ros_bridge repo. I want to create BSON enhancement here on Unity as well, because this seems to be a promising way to transfer custom messages which are large in size.

Kindly correct me if there are better ways to do this.

Kshitij

cc @rcodddow

kshitijgoel007 commented 8 years ago

Hello,

Just a gentle reminder. Kindly have a look.

cc @michaeljenkin @rcodddow

rcodddow commented 8 years ago

I can't find very much information on the BSON encoding feature in ROSBridge. I suspect that if turned on all message will be sent and received in BSON format. Without rummaging through the code too much here are some of the changes that would be to be made.

To support this you would have to add an option to ROSBridgeWebSocket connect to inform the class to switch to using a BSON parses. This would also require changes to the OnMessage method and subsequent ParseMessage methods perhaps a ParseMessageBSON unless you BSON parse is also JSON compatible.

All existing message classes would have to have a ToBSONString or you would have to parse .ToYAMLString and convert.

The helper functions in ROSBridgeMsg would need to be updated or would need a similar BSON helper function.

kshitijgoel007 commented 8 years ago

Hello @rcodddow , thanks for your response.

Can I use this : : https://github.com/kernys/Kernys.Bson ? I think I can modify it for this purpose