Ask Your Question

# Revision history [back]

### Wrench not applying torque back to robot body

I'm building a Reaction Wheel Pendulum (https://www.youtube.com/watch?v=Ih-izQyXJCI) in ROS + Gazebo.

I have a URDF model of the robot in gazebo. However, when I apply a torque to the flywheel from a motor on the pendulum, I would expect an opposite torque to be applied to the pendulum. However, it doesn't appear that any opposite torque (reactive torque) is applied to the inverted pendulum in gazebo. I'm applying a Wrench to the pendulum like this:

duration = rospy.Duration(0.1)
wrench = Wrench(torque=Vector3(0, 10, 0))
apply_body_wrench_srv = rospy.ServiceProxy("/gazebo/apply_body_wrench", ApplyBodyWrench)
apply_body_wrench_srv(body_name='m2wr::flywheel', reference_frame='m2wr::pendulum', wrench=wrench, duration=duration)


When I run this code, the flywheel starts spinning, but the pendulum doesn't move in the opposite direction. How can I get this working in Gazebo? Should I manually apply an opposite torque to the pendulum if Gazebo doesn't do this automatically?