-
Notifications
You must be signed in to change notification settings - Fork 276
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
Save model states when saving the world #137
Comments
For links connected with non-free joints (less than 6 DOF), it would be nice to save the joint positions instead of link positions. Since a lot of robots are controlled by changing joint states, having this capability would be very beneficial for testing and experimenting with many robot controllers. From the physics perspective, depending on the physics engine, it might be difficult to reconstruct a world from just the link poses since the physics engine will have to calculate the joint angles and try to enforce joint constraints. |
But this is currently what we do with the existing SDF spec, right? My main point with this proposal is that we're saving a world that has |
Do you mean when loading a model from SDF? For that case, yes, but we assume that the joint is at position 0 for the given parent and child link poses. But, what I'm referring to is to be able to save the non-zero joint position (after simulation has run) and then be able to load that back and have the joint position have the value it had (not zero). There is some relevant discussion on a Drake issue related to this.
For links not connected by joints, this makes sense. For jointed links, if we want to also keep the joint state (down the road), saving the link poses will be redundant. The physics engine will have to choose whether to use the joint positions to derive the link poses or vice versa. Either way, if the link poses and joint positions are inconsistent, maybe because they were manually edited, then how will the physics engine know which information to use? |
Yup, reloading the model that was saved.
Yeah if I understand correctly, this is what
Yeah my assumption is that the SDF proposal mentioned by @EricCousineau-TRI would have recommendations for how to address that, so that it's clear how to use the spec. So just so it is clear:
|
Awesome!!! Only caveat is that we may not get to this proposal until our current "epic" (gazebosim/sdformat#278) has a majority of its work / prototyping fleshed out - that may not be until late August, which may miss Ignition Dome (Sep 2020): Is that timeline OK with you? FYI @joemasterjohn FTR Ran into gazebosim/docs#28 and gazebosim/docs#29 when trying to see release dates |
Yeah we're ok with that. Our most immediate need is saving models that are edited / constructed through the GUI, so we don't need the physics state for now. |
This pull request added the ability of saving the world. However, models are being saved with their initial configuration and keeping no state. For example, if you start
fuel.sdf
, let it play for a while, then save it, once you load the saved world, the pendulum's arms will be on its initial configuration, not at the pose when saved.Gazebo-classic
Gazebo-classic used the SDF
<state>
tag to store this kind of information. Some limitations of this approach:<state>
. For example,<state><model><link><velocity>
.<state><model><pose>
tag overrides<model><pose>
.Gazebo-classic also had a separate mechanism for saving models created by the model editor, which would populate all aspects of the
<model>
tag itself.Proposal
On Ignition, it would be convenient to handle saving the world states and saving edited models the same way, to reduce duplication. So my suggestion is to implement a mechanism by which a model's SDF is updated based on its components before being saved. Then this mechanism can be used to to save the configuration of a model in the world, as well as saving a model that was edited.
Take the link poses for example:
Once we have the ability to change color, size, mass, etc, we should use the same mechanism to update those before saving the model. Kinematic variables don't need to be the only "state" 😉
For variables like velocity and acceleration, which don't have an equivalent within the
<model>
tag, I have 3 ideas:ign-transport
log files alongside the SDF model (less self-contained)This ties into the WIP GUI interactions design: gazebosim/design#2
To close this issue, I think it should be enough to save link poses. We can ticket new issues for saving new variables as the need arises.
The code should be organized in such a way that adding support for more component -> SDF conversions should be straight-forward.
The text was updated successfully, but these errors were encountered: