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

Changing Joint Limits in Simulation? #115

Closed
Woolfrey opened this issue Jan 5, 2022 · 3 comments
Closed

Changing Joint Limits in Simulation? #115

Woolfrey opened this issue Jan 5, 2022 · 3 comments

Comments

@Woolfrey
Copy link

Woolfrey commented Jan 5, 2022

I want to perform a certain action with the iCub in Gazebo, but the angle at the elbow is too large due to joint limits:

image

I have tried altering it with the yarp::dev::iControlLimits class:

this->limits->setLimits(i,lower,upper);

But if I force the joint beyond its default limits it will not move, and I get the following error message:

[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  3  torque too big! (  -9999  )

Is it possible to alter this constraint, just for simulation purposes?

Thanks in advance,

Jon

@traversaro
Copy link
Member

traversaro commented Jan 10, 2022

The setLimits interface can only change the so-called software limits, i.e. the limits imposed by the joint-level controller, both on the simulator and on the real robot. What can't be changed by the setLimits (both on simulation and on the real robot) are the hardware limits, i.e. the configuration where there it is not possible to move the joints due to some kind of hardware hardstop. Indeed, I am not sure if HW fault is the right behavior when setLimits outside the hardware limits are asked, and for that I opened #116 .

On the Gazebo-simulated robot, to change the hardware limits you need to modify the URDF model of the robot, i.e. the lower and upper limits of the limit tag, see

<limit effort="50000" lower="-0.05235987755982989" upper="1.3089969389957472" velocity="120.0"/>
for r_elbow. If you modify the hardware limit, then you need to remember also to modify the corresponding default software limit, i.e. the value in .

In the case you are generating the models from icub-model-generator, the file to modify is https://github.com/robotology/icub-models-generator/blob/master/simmechanics/data/icub3/ICUB_3_joint_all_parameters.csv#L30 .

@Woolfrey
Copy link
Author

Thanks for the information, @traversaro.

I wasn't sure if the setLimits function would also affect the Gazebo simulation, or if the constraints were set somewhere else. But modifying the URDF makes sense. I will give it a try!

Jon.

@traversaro
Copy link
Member

Hi @Woolfrey, I will close this issue as the information has been provided. Feel free to re-open or open a new one if you still have problems.

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

2 participants