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

API for LINK property "AddForceAtRelativePosition" #757

Closed
addy1997 opened this issue Apr 11, 2021 · 2 comments
Closed

API for LINK property "AddForceAtRelativePosition" #757

addy1997 opened this issue Apr 11, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@addy1997
Copy link
Contributor

This ticket is raised with reference to this #375 tutorial. I couldn't find a suitable replacement for the "AddForceAtRelativePosition" property of Link API.

Desired behavior

I am writing a wind plugin for pheonixDrone for calculating wind force.
In classical Gazebo, it can be written like this

// Calculate the wind force.
  double wind_strength = wind_force_mean_;

  math::Vector3 wind = wind_strength * wind_direction_;

  // Apply a force from the constant wind to the link.

  link_->AddForceAtRelativePosition(wind, xyz_offset_);

Alternatives considered

Nope, couldn't find suitable alternatives for this.

@addy1997 addy1997 added the enhancement New feature or request label Apr 11, 2021
@diegoferigo
Copy link
Contributor

This is not currently possible with the existing Link APIs. You need to use either Link::AddWorldForce or Link::AddWorldWrench. Be very careful when using any of these methods because they need the force / wrench expressed in different frames (xref #201).

In order to express a force in different frames, you can check the following logic:

https:/ignitionrobotics/ign-gazebo/blob/26832764749291b6ea22b525262136ecbb63fbb9/src/Link.cc#L291-L297

Another example is this downstream project.

@addy1997
Copy link
Contributor Author

@diegoferigo , thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants