In tutorial:WritingServiceClient(python) code using beginner_tutorials.srv not AddTwoInts.srv,Why?
The code is using "beginnertutorials.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 beginnertutorials.srv, not AddTwoInts.srv, where the beginnertutorials.srv is? 2.The tutorial code is work fine, if I change beginnertutorials.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
Asked by lujun723 on 2017-04-04 08:41:56 UTC
Answers
The AddTwoInts.srv
file 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/CMakeLists#Message_.2BAC8_service_macros)
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/CreatingMsgAndSrv#Using_srv)
Asked by ct2034 on 2019-08-07 01:25:46 UTC
Comments
can you please check that and accept the answer if it worked, thanks
Asked by ct2034 on 2019-08-09 10:44:16 UTC
Comments