Gazebo | Ignition | Community
Ask Your Question

Wrench not applying torque back to robot body

asked 2021-02-17 09:43:51 -0500

pacman2 gravatar image

I'm building a Reaction Wheel Pendulum ( 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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-02-19 15:12:15 -0500

pacman2 gravatar image

Well, I think I figured it out:

I'm pretty convinced now that Gazebo wrenches only apply a torque to one object (and don't apply and inverse torque to a connected body). I applied that manually and everything works as expected.

In the inverted reaction wheel pendulum video above, An equal but opposite torque is applied to the pendulum when a torque is applied on the wheel. Reason behind this:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-02-17 09:43:51 -0500

Seen: 218 times

Last updated: Feb 19 '21