Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to obtain dynamic quantities for feedforward control or inverse dynamics controller? #615

Open
GuanHY opened this issue Sep 29, 2024 · 0 comments

Comments

@GuanHY
Copy link

GuanHY commented Sep 29, 2024

I am currently working with your raisim simulation platform (using raisimGymTorch) and I've noticed that the final control input of the platform is force or torque, whether it's applying a feedforward force through the function setGeneralizedForce() or setting the target with a PD controller (not sure if my understanding is correct?).

I would like to ask if it is possible for users to customize other control schemes, such as implementing an inverse dynamics controller using the dynamics calculated by the simulation platform?

Recently, I have been trying to set the system state and then use the simulation platform to calculate dynamics. I referred to the official documentation for function calls, but my code always has errors. I would like to ask how to specifically obtain relevant dynamic characteristics such as the mass matrix, nonlinear terms, etc. Here is part of my code:

        raisim::Mat<51, 51> mass_mat_r, mass_mat_l;
        raisim::Vec<51> non_linear_r, non_linear_l;
        raisim::Vec<3> gravity_;

        gravity_ = world_->getGravity();
        
        for (int i = 0; i < int(control_dt_ / simulation_dt_ + 1e-10); i++){
            if(server_) server_->lockVisualizationServerMutex();

            world_->integrate1();

            if(i == 0){
                mass_mat_r = mano_r_->getMassMatrix();
                non_linear_r = mano_r_->getNonlinearities(gravity_);

                mass_mat_l = mano_l_->getMassMatrix();
                non_linear_l = mano_l_->getNonlinearities(gravity_);
            }
            world_->integrate2();

            if(server_) server_->unlockVisualizationServerMutex();
            

        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant