0
$\begingroup$

Rosanswers logo

I used a command as below.

ros2 service call /set_message hello_world_msgs/srv/SetMessage \ '{message: "Hello service!"}'

I'd like to know how this program works.

But I couldn't find a program for "service call" in my computer and Internet.

So, I'd like to know where I can get the program.

Could someone tell me where can I get the program, please?

My environment is below.

Environment

OS: Ubuntu18.04.5 LTS

ROS2: Dashing Diademata


Originally posted by snow on ROS Answers with karma: 3 on 2020-12-17

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The service call part are just subcommands which are interpreted by the top-level ros2 command. In this case the ros2 command hands off execution to a python library defined by the ros2service package. You can see the source for this package here: https://github.com/ros2/ros2cli/tree/dashing/ros2service/ros2service Take a look inside verb/call.py to see what's running for the specific example in your question.


Originally posted by jdlangs with karma: 971 on 2020-12-17

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by snow on 2020-12-17:
Thank you for your reply. I had a look a program. Does the program made by c++ exists?

Comment by jdlangs on 2020-12-18:
Check out the ros2 examples and demos repositories for sample programs in both C++ and Python. For example, a service calling example can be found here.

Comment by snow on 2020-12-19:
Thank you very much. I appreciate your kindness.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.