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

Make Joint::jointGeneralizedForceTarget return data from the right component #276

Merged
merged 2 commits into from
Nov 22, 2020

Conversation

diegoferigo
Copy link
Collaborator

@diegoferigo diegoferigo commented Nov 20, 2020

Before #259, and particularly 5bf1b4b, we were handling differently what was stored in the JointForce component. Now, the force is filled by what the ign-physics plugin provides. Before, we were storing the command. In presence of friction or when the joint limit is reached, the command and the real joint force do not match.

This PR makes gazebo::Joint::jointGeneralizedForceTarget return the JointForceCmd instead. The trade off here is that this component is cleared after the first application, therefore getting the target is valid only before the next GazeboSimulator::run() call.

Until now, there have always been a mismatch about how the force target was handled wrt to the position, velocity, etc. This PR reduces the gap. It does not fill it entirely because the other targets will persist even after the run. However, this behaviour matches what happens in reality, since the force command is only applied once. Instead, when a joint controller is enabled, the position, velocity, etc. targets remain valid.

@diegoferigo

This comment has been minimized.

@traversaro

This comment has been minimized.

@diegoferigo

This comment has been minimized.

@diegoferigo

This comment has been minimized.

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

Successfully merging this pull request may close these issues.

2 participants