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

Cannot reset the robot in simulation when using DART #190

Closed
PasMarra opened this issue Nov 13, 2023 · 22 comments · Fixed by #192
Closed

Cannot reset the robot in simulation when using DART #190

PasMarra opened this issue Nov 13, 2023 · 22 comments · Fixed by #192
Assignees
Labels
domain-software Related to Software prj-ergocub Related to ErgoCub Project team-fix Related to Team Fix

Comments

@PasMarra
Copy link

As per title, I cannot reset ergoCub in simulation when using DART. Some joints go in hardware fault when I try.

@Nicogene
Copy link
Member

Nicogene commented Nov 15, 2023

Hi @PasMarra, could you please post which error you are experiencing? (the cause of hardware fault)
What do you mean for "reset"?
"Using DART" it means using DART physical engine in gazebo?
Using other engines fixes this problem?
Which version of gazebo you are using?
Gazebo classic or the new one?
Which ergoCub model are you using?
Which version of ergocub-software?

@PasMarra
Copy link
Author

PasMarra commented Nov 15, 2023

Hi @Nicogene, here you can find the required info:

could you please post which error you are experiencing? (the cause of hardware fault)
What do you mean for "reset"?

This is what happen when I reset the world (ctrl+R):

issue.online-video-cutter.com.mp4
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| INITIAL CONFIGURATION IS:  -0.520000	 0.520000	 0.000000	 0.785000	 0.000000	 0.000000	 0.000000
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with default values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| INITIAL CONFIGURATION IS:  -0.520000	 0.520000	 0.000000	 0.785000	 0.000000	 0.000000	 0.000000
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with default values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  1  torque too big! (  -2030.98  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  4 torque too big! (  -2012.41  )

"Using DART" it means using DART physical engine in gazebo?

Yes, indeed.

gazebo -e dart

Using other engines fixes this problem?

Yes, it does. For example, with ODE there isn't any problem.

Which version of gazebo you are using?
Gazebo classic or the new one?

Gazebo classic, version 11.10.2

Which ergoCub model are you using?

ergocubGazeboV1_1

Which version of ergocub-software?

Latest one a092c3a53ab2ab8c9e46bd0a4210ee8815cbaf52

@xEnVrE
Copy link
Contributor

xEnVrE commented Nov 15, 2023

Using other engines fixes this problem?

Let me add that although using ode the problem is not there, we would like to use DART as it works best for our scenario (e.g. objects not drifting on the table, better contacts). Thanks

@Nicogene
Copy link
Member

To me is not clear what happens on the gyp plugins when you reset the world, it seems they are not reloaded, but they do something since I am seeing this log

[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| INITIAL CONFIGURATION IS:  -0.520000        0.520000        0.000000        0.785000        0.000000        0.000000        0.000000
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with default values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| INITIAL CONFIGURATION IS:  -0.520000        0.520000        0.000000        0.785000        0.000000        0.000000        0.000000
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with default values
[DEBUG] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| Initializing Trajectory Generator with current values

It seems it is commanding to the controlboards the initial configuration of the robot

Maybe @traversaro or @randaz81 knows something about it?

I am not understanding why this HF does not happen when you insert the model, since the execution seems the same

@Nicogene Nicogene self-assigned this Nov 16, 2023
@Nicogene Nicogene added team-fix Related to Team Fix domain-software Related to Software prj-ergocub Related to ErgoCub Project labels Nov 16, 2023
@Nicogene
Copy link
Member

Nicogene commented Nov 16, 2023

I tried to set max_torques to 9999.9 and still we are getting the hw fault

[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  1  torque too big! (  -10005.7  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  0  torque too big! (  -10015.4  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  0  torque too big! (  -10017.7  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  4  torque too big! (  10009.9  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  4  torque too big! (  10009.8  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  3  torque too big! (  -10002  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  3  torque too big! (  -10001.2  )
[ERROR] |gazebo-yarp-plugins.plugins.GazeboYarpControlBoard| An hardware fault occurred on joint  0  torque too big! (  10008.2  )

So I think increasing the max_torques is not the right way to fix it

Maybe it is related to this warning I am getting when launching gazebo w/ dart?

Warning [BodyNode.cpp:498] [BodyNode] A negative or zero mass [0] is set to BodyNode [link], which can cause invalid physical behavior or segfault. Consider setting positive value instead.

@traversaro
Copy link
Member

traversaro commented Nov 16, 2023

Maybe @traversaro or @randaz81 knows something about it?

As you found yourself in https://github.com/robotology/gazebo-yarp-plugins/pull/247/files, on reset the onReset callback of the plugin is called. It is not clear to me anyhow what is happening. When you launch on a clean world the robot, do you see anything like that? Or the problem is just on reset. It seems that the robot is spawned at reset with the feet far from the ground, is that intentional? Can you try to change the initial base position to avoid that?

@traversaro
Copy link
Member

I am not understanding why this HF does not happen when you insert the model, since the execution seems the same

Sorry, I missed this, this answer one of my previous questions.

@traversaro
Copy link
Member

So I think increasing the max_torques is not the right way to fix it

That's true, but just as a workaround I would try to set max_torques to a really high value (like 1000000) to see if the simulation works fine.

@Nicogene
Copy link
Member

So I think increasing the max_torques is not the right way to fix it

That's true, but just as a workaround I would try to set max_torques to a really high value (like 1000000) to see if the simulation works fine.

With 100000.0 the reset works fine, @traversaro @xEnVrE @PasMarra I can open a PR w/ this very high value as max_torques but I think that this issue should be tracked in GYP

@Nicogene
Copy link
Member

@Nicogene
Copy link
Member

I paused the simulation in order to check what happens when you insert the model and when you reset the world and seems that it is falling from the very same height:

Put in the model Reset world
immagine immagine

Unfortunately this #190 (comment) is not enough, some times goes in HF also with these high threshold, I can increase it more in case

@traversaro
Copy link
Member

This is kind of ortogonal, but why don't we set the robot height such that it does not jump at the beginning of the simulation?

@Nicogene
Copy link
Member

This is kind of ortogonal, but why don't we set the robot height such that it does not jump at the beginning of the simulation?

If you mean to lower the spawn point I tried to set it at 0.78 m height that is the lower possible since the root is 0.779 meters from the sole plane, but this problem persist

@traversaro
Copy link
Member

This is kind of ortogonal, but why don't we set the robot height such that it does not jump at the beginning of the simulation?

If you mean to lower the spawn point I tried to set it at 0.78 m height that is the lower possible since the root is 0.779 meters from the sole plane, but this problem persist

Ok, thanks! Anyhow it probably make sense to implement that change anyhow, independently by this problem?

@Nicogene
Copy link
Member

@martinaxgloria noticed that this problems happens also w/ iCubGazeboV2_5

Nicogene added a commit that referenced this issue Dec 4, 2023
@traversaro
Copy link
Member

@martinaxgloria noticed that this problems happens also w/ iCubGazeboV2_5

Is this tracked or solved somewhere?

@Nicogene
Copy link
Member

Nicogene commented Dec 5, 2023

@martinaxgloria noticed that this problems happens also w/ iCubGazeboV2_5

Is this tracked or solved somewhere?

Opened now:

@traversaro
Copy link
Member

@martinaxgloria noticed that this problems happens also w/ iCubGazeboV2_5

Is this tracked or solved somewhere?

Opened now:

Thanks!

@PasMarra
Copy link
Author

PasMarra commented Dec 6, 2023

fault.mp4

Hi @Nicogene, as you can see from the video, incrementing max_torques to 1e6 is not sufficient for a successful reset.

ergocub-software version 0945da4e405e72b6fa45664a027d0d6fe0fcb008

cc: @traversaro @xEnVrE

@traversaro
Copy link
Member

While the problem is indeed there, @PasMarra for your experiments have you considered either to fix the the robot base to the world, or at least to create a world in which the model is already placed of the correct location, instead of spawning it far from the ground?

@PasMarra
Copy link
Author

PasMarra commented Dec 6, 2023

While the problem is indeed there, @PasMarra for your experiments have you considered either to fix the the robot base to the world, or at least to create a world in which the model is already placed of the correct location, instead of spawning it far from the ground?

After some tests I realized that the problem occurs only if I try to reset the robot when it is already in HF for other reasons. Not sure that fixing the base will solve this but I can try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-software Related to Software prj-ergocub Related to ErgoCub Project team-fix Related to Team Fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants