ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rospy.ServiceProxy( ) is not working

asked 2016-01-04 00:09:34 -0500

Hi there, I am incredibly new to ROS, and I am trying to learn by creating a program with turtlesim. I am currently writing a node that will call turtlesim's Spawn service, and I am getting an AttributeError: 'module' has not attribute 'ServiceProxy'.

Here is the code I have written:

#!/usr/bin/env python

from turtlesim.srv import Spawn
import rospy

def spawn():
    spawn_turtle = rospy.SerivceProxy('spawn_turtle', Spawn)
    spawn_turtle(50,50,10,"turt")
    rospy.spin()

if __name__ == "__main__":
    spawn()

Thank you so much for your help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-01-04 00:17:34 -0500

ahendrix gravatar image

I think you're misspelled ServiceProxy

edit flag offensive delete link more

Comments

You're right...thank you so much for pointing that out. I guess that's what happens when I am programming late at night.

alambert gravatar image alambert  ( 2016-01-04 18:32:28 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-01-04 00:09:34 -0500

Seen: 1,053 times

Last updated: Jan 04 '16