Model floating when JointController PID parameters set too high

asked 2018-07-24 08:20:01 -0600

pbelanger gravatar image

updated 2018-07-24 08:20:26 -0600

I have an armature set up in Gazebo. I'm using velocity control on hydraulic pistons to control this arm. I have the following code in my plugin for this arm:

class ModelPush: public gazebo::ModelPlugin
{
public:
    void Load(gazebo::physics::ModelPtr parent, sdf::ElementPtr /* _sdf */) override
    {
        _model = parent;
        _joint_controller = _model->GetJointController();
        _update_connection = gazebo::event::Events::ConnectWorldUpdateBegin(std::bind(&ModelPush::OnUpdate, this));
        printf("Model_push load()\n");
        for(size_t i = 0; i < 4; i++)
        {
            auto joint_name = std::string("rockbreaker::")+joints[i];
            gazebo::common::PID p;
            p.SetPGain(100000);
            p.SetIGain(1000);
            p.SetIMin(-100000);
            p.SetIMax(100000);
            //p.SetPGain(joint_p[i]);
            //p.SetIGain(joint_i[i]);
            //p.SetDGain(joint_d[i]);
            _joint_controller->SetVelocityPID(joint_name, p);
        }
    }
...
};

When the proportional gain for the arm is set lower, the arm does not have enough power to lift itself off of the ground. However, when the PID constants are increased, the arm spawns in the world and does not respond to the physics engine at all. I get no debug messages in the console regarding this.

Any idea what's going on?

edit retag flag offensive close merge delete