feat: Add Promise-based callServiceAsync wrapper for async/await support#1169
Conversation
|
added a unit test (or integration test... whatever you'd like to call it) based on the https://docs.ros.org/en/hydro/api/rosapi/html/srv/GetTime.html Which I think is nice considering we'll probably always be using the rosbridge, right? |
|
Shit! Seems that ros1 does not support the |
EzraBrooks
left a comment
There was a problem hiding this comment.
This is a great contribution! I had done this as a wrapper of callService in my previous project, having it in the core library will be very useful.
For the test, what about creating a service server in the test code itself and then calling that?
Sure! I'll take a gander at how it's done with the other unit tests and push ASAP. |
…noetic to be able to do unit test.
|
Hooray |

Public API Changes
Added
callServiceAsyncwith a promise return. Which allows for cleaner usage.for example: (response based on default srv implementation from: (https://github.com/ros2/common_interfaces/tree/rolling/std_srvs/srv)
In my opinion this is a lot more readable and a bit more normalized in the "typescript / javascript" world.