How to import service file (.srv) in a python node?
I want to import .srv file from another package into my python node. How can I do that? Thanks in advance.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I want to import .srv file from another package into my python node. How can I do that? Thanks in advance.
I Found the problem and each time I compiled the code, it couldn't found the .srv file. when I wanted to import a service file from another package into a python node, I should first write the package name and the folder name inside that. After that, I use the file name for importing. Like:
from dynamixel_controllers.srv import TorqueEnable
dynamixel_controller is the name of the package that I want to import file from that and inside the folder srv there is a file named TorqueEnable.
Asked: 2020-01-21 03:10:13 -0600
Seen: 1,788 times
Last updated: Jan 21 '20
Error importing android library into android project using rosjava.jar
Tutorial 15 - ExaminingServiceClient(python)
Why import complicated stl file will caused problem on gazebo?
Can't import STL file into gazebo
Import .dae Gazebo-1.0.0-RC2 [closed]
import a 'roshlet' from another roshlet
Fuerte : No module named rospkg
actionlib ImportError for python
Can you specify what you already tried, what is not working (and provide the resulting error messages) please ? There are already multiples topics about this on this site, have you tried searching on google with
site:answers.ros.org import service
?And is this a duplicate of #q342113 ?
@Delb Thanks for your answer. Yes, I wanted to call a predefined service as I explained in #q342113. I will write it down as an answer.