-
Notifications
You must be signed in to change notification settings - Fork 26
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
Get force references after stepping Gazebo #133
Comments
Just to understand, why it is necessary for upstream to zero the |
The
I have to double check this, but I think that if multiple systems want to add a force to the same joint, it's the system that has the responsibility to read the current cmd and add its own value instead of overriding it. I understand that sometimes this is not desiderable, because if you're using a third-party system that does not follow this logic, the cmd of systems that are processed before are lost. As a reference, here below you can find the code that applies the force before the physics step: gym-ignition/plugins/Physics/Physics.cpp Lines 636 to 649 in 86a77cc
|
Ack, this may be non-intuitive because it force any system to run at the same frequency of the physics update step, but I guess this is not the right place to discuss this. |
All systems run by design at the same rate. However, systems can read the simulated time and skip updates. We already do something similar for our PID controllers, since users can specify an update rate that differs from the physics rate. |
Closed via #141 |
Right now Ignition Gazebo does not have the support of exposing the generalized force that was applied during the current physics step.
In fact, the component containing the force reference (
JointForceCmd
) is zeroed in the last phase of the step of the Physics system:gym-ignition/plugins/Physics/Physics.cpp
Lines 1042 to 1047 in 86a77cc
A possible solution would be creating a new component, that could be
JointForce
, that is zeroes before the physics step and is filled right after using the data ofJointForceCmd
.This feature is extremely useful for instance to get the force applied by joint controllers implemented as plugins. In fact, in this setting, it's not the user code that sends the force reference to the simulator. Instead, the force is computed in C++ and directly sent to the simulator, and there's no other way to extract it without the introducing a new component and passing through the ECM.
@traversaro comments?
The text was updated successfully, but these errors were encountered: