Setting joint positions without using a PID Controller
I have created a four-wheeled vehicle in sdf format and want to simulate its motion by providing the desired angles to joints. I have been looking up ways to do this.
First thing I found was Joint::SetAngle but it has been deprecated. Next I tried, Joint::SetPosition and also, JointController::SetJointPosition. In both the cases, the wheels would rotate as desired but they wouldn't make the vehicle move. It seemed to be slipping on the ground, but I don't think the problem was with the friction parameters as I tried increasing mu and mu2 values to no avail, and also the model worked perfectly using Joint::SetVelocity.
I looked up this website and found that on many of the questions, a PID controller to apply force on the model was recommended, which indeed works. However, the problem is that my end-goal is to simulate a complex robot structure which will have many revolute joints (one for each motor). Therefore, PID tuning for each joint will be time-consuming and quite frankly, annoying. So is there a safe alternative to using a PID tuner?
TLDR: SetAngle is deprecated, SetJointPosition makes wheels rotate but model doesn't move. Looking for alternatives to PID Controller, as PID Tuning can be time-consuming and erroneous
Asked by sarvesh0303 on 2016-02-08 08:44:58 UTC
Answers
I might suggest you to use a P controller (set I and D parameters to zero) and increase the damping of your joints. You'll get almost what you want. The damping prevents the PID to oscillate or diverge, and using a PID controller is the most integrated solution I know for gazebo. I use this solution to avoid PID tuning for a robot arm.
<joint type="revolute" name="wheel_joint">
<pose>0 0 0 0 0 0</pose>
<parent>car</parent>
<child>wheel</child>
<axis>
<xyz>0 1 0</xyz>
<dynamics>
<damping>3</damping>
</dynamics>
</axis>
<physics>
<ode>
<cfm_damping>1</cfm_damping>
<implicit_spring_damper>1</implicit_spring_damper>
</ode>
</physics>
</joint>
Asked by debz on 2016-02-17 10:51:38 UTC
Comments