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?
Asked by pacman2 on 2021-02-17 10:43:51 UTC
Answers
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: https://physics.stackexchange.com/questions/147932/is-torque-independent-of-choice-of-the-point-of-rotation
Asked by pacman2 on 2021-02-19 16:12:15 UTC
Comments