I am writing a service and this is the message :
std_msgs/String pose
---
sensor_msgs/JointState finalpos
This is the client :
#!/usr/bin/env python
import rospy
from interbotix_moveit.srv import pickitstr,pickitstringResponse
from std_msgs.msg import String
rospy.init_node('service_arm_client')
word=String()
rospy.wait_for_service('/widowxl/arm_service')
pose = rospy.ServiceProxy('/widowxl/arm_service',pickitstr)
word = pickitstringResponse()
word= 'Upright'
finalpose = pose(word)
print(finalpose.finalpose)
And I get this error :
Traceback (most recent call last):
File "/home/michael/catkin_ws/src/interbotix_ros/interbotix_moveit/src/service_client_test.py", line 13, in finalpose = pose(word) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in call return self.call(*args, **kwds) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 512, in call transport.send_message(request, self.seq) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_base.py", line 665, in send_message serialize_message(self.write_buff, seq, msg) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/msg.py", line 152, in serialize_message msg.serialize(b) File "/home/michael/catkin_ws/devel/lib/python2.7/dist-packages/interbotix_moveit/srv/_pickitstr.py", line 58, in serialize _x = self.pose.data AttributeError: 'str' object has no attribute 'data'
What Is the problem ?
Originally posted by MichaelDUEE on ROS Answers with karma: 15 on 2020-02-25
Post score: 0