ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
from gazebo_msgs.srv import ApplyBodyWrench from geometry_msgs.msg import Wrench
def applyForce(): rospy.wait_for_service('/gazebo/apply_body_wrench') force = rospy.ServiceProxy('/gazebo/apply_body_wrench',ApplyBodyWrench)
wrench = Wrench()
wrench.force.x = 0
wrench.force.y = 0
wrench.force.z = 0
wrench.torque.x = 0
wrench.torque.y = 0
wrench.torque.z = 0
# You can also define the start time if necessary...
force(body_name = "base_link",wrench = wrench, duration = rospy.Duration(10))