-
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
Clearing pending commands - unexpected behavior #1926
Comments
Ah, yes, I think clearing to zero only makes sense for force components.
I'd favor this too. I think in the past we had performance issues with repeatedly creating and deleting components, but I believe that has been fixed as of #856. The only caveat is I think this would be considered a behavior change since a system that assumes that keeps updating a velocity command now needs to recreate the component in every step, so at best, we'd have to target a PR against |
Looking throughout the codebase, there are a few systems and tests that rely on the current behavior so it might be a good option to go with the approach of creating a new vel cmd component for the different behavior. For the Link API, We can also add an optional arg to indicate whether the vel cmd should persist or not, e.g. |
Could you point to places that rely on this behavior? I'm interested in seeing a situation where the current behavior is useful because I really can't conceive a situation where it makes sense (nor reconcile it semantically to the function's name) We have 3 behavior: I agree that a |
I noticed that most of the systems and tests inside gz-sim had to send the cmd continuously, e.g. velocity_control system and a test helper class. The behavior change here is that if one of our users had code to move a model for a fixed period of time, e.g. by sending vel cmds for 5 seconds then expect the model to stop moving once they stop sending the cmd, the new proposed change would break this behavior. |
Fair point for user code (though I hope they do not do that :) ). How do you want to proceed: should I stop bothering you and leave you people to it (I don't know much about the organization, if you're full time on gazebo or not) or we settle on a direction and I write a PR? |
PRs are welcome :) I think we just need to agree on the design and what's to be implemented. @azeey what do you think adding a new component or do you have other ideas? |
I don't think that's quite right because those systems assume the component is there and just update the value. If we remove the component, those systems would have to be updated to recreate the component in every time step. We could create new components (eg. So my proposal would be to change the current behavior in the BTW, I also see the same problem with |
Part of #1926. Signed-off-by: Steve Peters <[email protected]>
I've started work on this suggestion in #2228 |
Part of #1926. Signed-off-by: Steve Peters <[email protected]>
This implements a suggestion from #1926 to delete all `*VelocityCmd` components after each time step. This also updates the logic for the following two systems to handle this change: * MulticopterMotorModel: handle missing component Since JointVelocityCmd components are deleted after each timestep, don't skip updating forces and moments if the component does not exist, and use the SetComponent API to more cleanly handle the component creation logic. A syntax error in the the quadcopter test worlds was fixed as well. * TrajectoryFollower: don't need to remove commands Now that the physics system is removing AngularVelocityCmd components at every timestep, that logic can be removed from the trajectory follower system. Signed-off-by: Steve Peters <[email protected]>
all |
Hi,
Issue summary:
ecm.RemoveComponent(...)
)When specify attaching a command to an entity (such as
JointForceCmd
,AngularVelocityCmd
), these commands get cleared after a physic step (physics.cc)This clearing has, I'd say, an unexpected behavior for some commands.
Most notably, the velocity commands (angular and linear) get set to the zero vector. This zero vector is then used on later steps to overwrite the velocities.
I suppose the clearing of commands after an integration step means that these commands are considered as impulses - meaning a command should only alter one step and then be no-op.
While clearing a force to the zero vector achieves that, doing the same for the velocity is not correct.
Possibles solutions:
I'd favor (1) but I've just started using gazebo so I don't know much :)
Edit: I could do the PR once we've settled on a direction
Thanks
The text was updated successfully, but these errors were encountered: