Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a bson_only_mode flag for the TCP version of rosbridge #257

Merged
merged 2 commits into from
Mar 9, 2017
Merged

Implemented a bson_only_mode flag for the TCP version of rosbridge #257

merged 2 commits into from
Mar 9, 2017

Conversation

Sanic
Copy link
Contributor

@Sanic Sanic commented Jan 28, 2017

Related to #253

This commit allows users to switch to a full-duplex transmission of BSON messages and therefore eliminates the need for a base64 encoding of binary data when running in this mode.
The new mode is fully optional and is not activated by default.
You can use the new mode by starting:

  • roslaunch rosbridge_server rosbridge_tcp.launch bson_only_mode:=True

or

  • rosbridge_tcp.py --bson_only_mode

Your rosbridge_server will now only expect and transmit data in BSON.

This PR can also provide an improvement for problems like in RobotWebTools/roslibjs#126,
because the TCP handler can make some assumptions on the length of the message when using BSON. This is due to the length field that is located in the first four bytes of every BSON message.

Sanic added 2 commits January 28, 2017 14:10
…his allows you to switch to a full-duplex transmission of BSON messages and therefore eliminates the need for a base64 encoding of binary data; Use the new mode by starting:'roslaunch rosbridge_server rosbridge_tcp.launch bson_only_mode:=True' or passing '--bson_only_mode' to the rosbridge_tcp.py script
@jihoonl
Copy link
Member

jihoonl commented Mar 3, 2017

hi @Sanic, it looks actually very nice. Do you have any test client example that we can test? Or it would be very nice if you can provide us test programs too.

Since I don't have any implementation of tcp client, I am not sure how to test this updates.

@Sanic
Copy link
Contributor Author

Sanic commented Mar 8, 2017

Hi @jihoonl
To keep things simple i've created a small test client for you.
Since rosbridge is written in python, i also implemented the client in python.
You can find the client over here: https://github.com/Sanic/ROSBridgeTestclient

The client advertises the topic /bson_test , publishes a message to it and calls a service afterwards.
The service response will be printed in the test client.

To get everything running, i put a description in the README.md of the repository. I would recommend to use TEST_MODE=JSON (default) first, to see if everything is fine with the normal JSON transmission in the first place.

Please let me know if there are any issues.

@jihoonl
Copy link
Member

jihoonl commented Mar 9, 2017

Nice thanks!
👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants