TypeError: expected [string] but got [gazebo_msgs/ApplyBodyWrenchResponse]
I use rosservice to drive the rrbot model, python code is as follows:
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Pose, Quaternion, Point, PoseStamped, PoseWithCovariance, TwistWithCovariance, Twist, Vector3, Wrench
from gazebo_msgs.srv import ApplyBodyWrench
wrench = Wrench()
wrench.torque.x = 0
wrench.torque.y = 5
wrench.torque.z = 0
rospy.wait_for_service ('/gazebo/apply_body_wrench')
apply_body_wrench = rospy.ServiceProxy('/gazebo/apply_body_wrench', ApplyBodyWrench)
resp = apply_body_wrench(apply_body_wrench(body_name = "rrbot::link3",reference_frame = "rrbot::link3", wrench = wrench,start_time = rospy.Time(0), duration = rospy.Duration(5)))
Although successfully driven the robot, however, the results does not receive srv information(such as success) and some errors as follows:
Traceback (most recent call last):
File "test.py", line 38, in <module>
torque_node(point , wrench, start_time, duration)
File "test.py", line 15, in torque_node
resp = apply_body_wrench(apply_body_wrench(body_name = "rrbot::link3"))
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 439, in __call__
return self.call(*args, **kwds)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 495, in call
request = rospy.msg.args_kwds_to_message(self.request_class, args, kwds)
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/msg.py", line 121, in args_kwds_to_message
raise TypeError("expected [%s] but got [%s]"%(data_class._slot_types[0], arg._type))
TypeError: expected [string] but got [gazebo_msgs/ApplyBodyWrenchResponse]