Ask Your Question
0

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

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

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
0

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

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 https://wiki.ros.org/rosbuild/CMakeLi...)

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

(see https://wiki.ros.org/ROS/Tutorials/Cr...)

edit flag offensive delete link more

Comments

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

ct2034 gravatar imagect2034 ( 2019-08-09 10:44:16 -0500 )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

Stats

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

Seen: 59 times

Last updated: Aug 07