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

New JointController plugin to implement Position and Velocity joint control modes #166

Conversation

diegoferigo
Copy link
Collaborator

This is the first example of a model plugin that could be inserted during runtime, i.e. after inserting the model in the simulation.

The plugin runs as a System stepped by Gazebo at the rate the server was configured. In order to run the PIDs at a different rate, users could define a different period with:

https://github.com/robotology/gym-ignition/blob/e7c6b7d5f566f356de54a4cf15fc4015aa013090/cpp/scenario/gazebo/include/scenario/gazebo/Model.h#L101-L102

There is a single PID per joint that must be configured when either JointControlModel::Position or JointControlMode::Velocity are enabled.

@diegoferigo diegoferigo requested a review from traversaro March 31, 2020 14:43
@diegoferigo diegoferigo self-assigned this Mar 31, 2020
@diegoferigo diegoferigo changed the title New JointController plugin to implement JointControlMode::Position New JointController plugin to implement Position and Velocity joint control modes Mar 31, 2020
@diegoferigo
Copy link
Collaborator Author

Ready to be reviewed @traversaro

Copy link
Contributor

@traversaro traversaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand, we have any pratical idea of whether this system does run before or after the physics update?

@diegoferigo
Copy link
Collaborator Author

we have any pratical idea of whether this system does run before or after the physics update?

Yours is an excellent question, and I don't have a ready answer. Though, I did consider it while designing the plugin. If you notice, the output of the PIDs is computed in the JointController::PreUpdate method. This method for sure is running before Physics::Update, so in this sense the execution should run flawless.

Something instead that I'm not sure is whether JointController::PreUpdate is called before Physics::PreUpdate. Right now Physics::PreUpdate is not doing much (and nothing related to PIDs), but we should keep this in mind if the logic of that physics callback will be used more extensively.

@diegoferigo
Copy link
Collaborator Author

I leave as a reference the link to a PR hitting upstream with a different joint controller gazebosim/gz-sim#216

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.

None yet

2 participants