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

505852124@qq.com's profile - activity

2021-05-19 21:40:32 -0500 received badge  Famous Question (source)
2020-11-21 10:50:28 -0500 received badge  Famous Question (source)
2020-11-21 10:50:28 -0500 received badge  Notable Question (source)
2020-10-12 06:45:48 -0500 received badge  Notable Question (source)
2020-05-21 11:52:37 -0500 received badge  Popular Question (source)
2020-01-31 11:07:05 -0500 marked best answer 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]
2020-01-31 11:07:05 -0500 received badge  Scholar (source)
2020-01-31 02:26:40 -0500 asked a question In the gazebo environment, once dynamic parameters are added to the urdf model, the connecting rod will be fixed at the origin.

In the gazebo environment, once dynamic parameters are added to the urdf model, the connecting rod will be fixed at the

2020-01-31 01:42:18 -0500 commented question TypeError: expected [string] but got [gazebo_msgs/ApplyBodyWrenchResponse]

You are right.I have soved this problem.Thank you.

2020-01-31 00:43:39 -0500 received badge  Popular Question (source)
2020-01-30 10:06:00 -0500 asked a question TypeError: expected [string] but got [gazebo_msgs/ApplyBodyWrenchResponse]

TypeError: expected [string] but got [gazebo_msgs/ApplyBodyWrenchResponse] I use rosservice to drive the rrbot model, py

2020-01-30 10:06:00 -0500 asked a question TypeError: expected [string] but got [gazebo_msgs/ApplyBodyWrenchResponse]

TypeError: expected [string] but got [gazebo_msgs/ApplyBodyWrenchResponse] I use rosservice to drive the rrbot model, py