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

[Proposal] Add an option to "set_external_force_and_torque" to choose where the forces should be applied. #1678

Open
AntoineRichard opened this issue Jan 15, 2025 · 1 comment · May be fixed by #1680
Labels
enhancement New feature or request

Comments

@AntoineRichard
Copy link
Contributor

Proposal

Changing the "set_external_force_and_torque" method to allow applying wrenches at a position that's not the center of the articulation.

This could look like so:

    def set_external_force_and_torque(
        self,
        forces: torch.Tensor,
        torques: torch.Tensor,
        positions: torch.Tensor | None = None,
        body_ids: Sequence[int] | slice | None = None,
        env_ids: Sequence[int] | None = None,
    ):

When no positions are provided, the implementation uses the current behavior. However, if positions are provided, then it passes them to the PhysX tensor API:

self.root_physx_view.apply_forces_and_torques_at_position(
    force_data=self._external_force_b.view(-1, 3),
    torque_data=self._external_torque_b.view(-1, 3),
    position_data=self._external_wrench_positions_b.view(-1, 3),
    indices=self._ALL_INDICES,
    is_global=False,
)

Motivation

It would be great to be able to apply forces away from the center of the object. This is useful for thruster/propeller based systems such as drones, planes, boats, and satellites. In these systems, the position where the forces are applied can vary depending on the level of realism on wants to have. Also, this can be used to easily implement morphable geometries for drones, satellites, and boats, as there is no need to have different physical configurations: just to apply forces at different positions.

Alternatives

The current alternative is to create rigid bodies where you want to apply the force, but if you want to change their positions, you need to attach it to a set of joints.

Checklist

  • [x ] I have checked that there is no similar issue in the repo (required)

Acceptance Criteria

Add the criteria for which this task is considered done. If not known at issue creation time, you can add this once the issue is assigned.

@AntoineRichard AntoineRichard linked a pull request Jan 15, 2025 that will close this issue
6 tasks
@RandomOakForest RandomOakForest added the enhancement New feature or request label Jan 17, 2025
@RandomOakForest
Copy link
Collaborator

Thanks for posting this proposal. The team will review.

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

Successfully merging a pull request may close this issue.

2 participants