[ROS Q&A] – Service global name error

Written by Marco Arruda

14/11/2017


Q: I’m having a lot of troubles doing the following in ROS: I would like to subscribe to a fakeARpublisher and resend a pose information through a service. In short, I did a script that it is subscribed to a topic and at the same time acts like a server for a service called LocalizePart. The code is given below:

A: Hello,

I had formatted your code got something like this:

Finally, I’ve reproduced your problem and concluded that to solve it you only have to import the server response library.

ROS creates 3 classes for each service message: Service definition, Request message and Response message. You should take a look here: http://wiki.ros.org/rospy/Overview/Services

Following the code I’ve posted, I had just to replace this:

from myworkcell.srv import LocalizePart

with this:

from myworkcell.srv import LocalizePart, LocalizePartResponse

I hope it can help you!

Topics:
Masterclass 2023 batch2 blog banner

Check Out These Related Posts

129. ros2ai

129. ros2ai

I would like to dedicate this episode to all the ROS Developers who believe that ChatGPT or...

read more

0 Comments

Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This