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

Add resetSimulationState and regenerate thrift-generated files #424

Merged
merged 3 commits into from
May 6, 2019

Conversation

triccyx
Copy link
Member

@triccyx triccyx commented Apr 30, 2019

Reset position to initial pose, do not reset time.

@traversaro
Copy link
Member

What is the advantage of resetting the state but not resetting time?

@triccyx
Copy link
Member Author

triccyx commented May 2, 2019

This is a work-around in order to avoid a problem when resetting the time. If a yarp network wait is running
it will hang (not really hung but delayed) when the time is reset.

@traversaro
Copy link
Member

Given that we have already resetSimulation that resets time and state, and resetSimulationTime that resets only the time, I suggest to rename the method resetSimulationState, that just reset the state but not the time. This should make the interface more portable to other simulators and clarify better its behavior (for example, I guess the method also resets the velocity of the links and joints, not only its position.

@traversaro traversaro changed the title Reset position to initial pose Add resetSimulationState and regenerate thrift-generated files May 3, 2019
plugins/clock/src/Clock.cc Outdated Show resolved Hide resolved
@traversaro
Copy link
Member

Ok for me, modulo the small trailing whitespace comment. @diegoferigo any comment?

Co-Authored-By: triccyx <triccyx@gmail.com>
@diegoferigo diegoferigo self-requested a review May 6, 2019 12:31
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

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

I didn't go in detail though the code. It seems fine to me as long as you checked:

  • Both position and velocity are reset
  • The state of the low-level controllers is reset

Just a minor comment, @triccyx it would be easier to review the PR if you commit the autogenerated sources separately.

@triccyx
Copy link
Member Author

triccyx commented May 6, 2019

@traversaro @diegoferigo gentle ping
Could you merge the pull request?

@traversaro traversaro merged commit f52c36e into devel May 6, 2019
@traversaro
Copy link
Member

Thanks for the PR!

@traversaro traversaro deleted the resetsimulationpos branch November 16, 2019 16:21
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

Successfully merging this pull request may close these issues.

3 participants