ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Where can I get a program for "service call"? [closed]

asked 2020-12-17 00:05:09 -0500

snow gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by snow
close date 2020-12-19 19:50:18.492101

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-17 15:17:25 -0500

jdlangs gravatar image

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 ros2servicepackage. You can see the source for this package here: https://github.com/ros2/ros2cli/tree/... Take a look inside verb/call.py to see what's running for the specific example in your question.

edit flag offensive delete link more

Comments

Thank you for your reply. I had a look a program. Does the program made by c++ exists?

snow gravatar image snow  ( 2020-12-17 20:50:51 -0500 )edit

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.

jdlangs gravatar image jdlangs  ( 2020-12-18 19:31:36 -0500 )edit

Thank you very much. I appreciate your kindness.

snow gravatar image snow  ( 2020-12-19 19:47:56 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-12-16 23:53:41 -0500

Seen: 96 times

Last updated: Dec 17 '20