ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

In tutorial:WritingServiceClient(python) code using beginner_tutorials.srv not AddTwoInts.srv,Why?

asked 2017-04-04 08:44:27 -0600

lujun723 gravatar image

The code is using "beginner_tutorials.srv", but there are not this srv file in my pc. The older tutorial only roscp one srv called "AddTwoInts.srv" I just what to know two things: 1. why the code is using beginner_tutorials.srv, not AddTwoInts.srv, where the beginner_tutorials.srv is? 2.The tutorial code is work fine, if I change beginner_tutorials.srv into AddTwoInts.srv, Python is breakout at an Error: No module named AddTwoInts.srv, I don't know why...

sorry for my poor english, :P

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-08-07 01:25:46 -0600

ct2034 gravatar image

The AddTwoInts.srvfile is the contains the definition of the message. But this would not be readable in python. So catkin takes this files and generates python code ouf it. (see

You can then access the code under beginner_tutorials.srv. This is just where catkin generates it under <package_name>.srv


edit flag offensive delete link more


can you please check that and accept the answer if it worked, thanks

ct2034 gravatar image ct2034  ( 2019-08-09 10:44:16 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-04-04 08:41:56 -0600

Seen: 435 times

Last updated: Aug 07 '19