gazebo-yarp-plugins icon indicating copy to clipboard operation
gazebo-yarp-plugins copied to clipboard

Add in the `externalwrench` plugin the option to specify the orientation frame "local"

Open HosameldinMohamed opened this issue 5 years ago • 7 comments

In the current implementation of the nice plugin externalwrench, the applied wrenches can only be set w.r.t the world reference frame.

See the response to the "help" command:

  Insert a command with the following format:
  [link] [force] [torque] [duration]
  e.g. chest 10 0 0 0 0 0 1
  [link]:     (string) Link ID of the robot as specified in robot's SDF
  [force]:    (double x, y, z) Force components in N w.r.t. world reference frame
  [torque]:   (double x, y, z) Torque components in N.m w.r.t world reference frame
  [duration]: (double) Duration of the applied force in seconds
  Note: The reference frame is the base/root robot frame with x pointing backwards and z upwards.

It would be nice to have an option to specify the wrenches orientations in the link frame. It could be useful for simulating, for example, the forces of jet engines attached to the robot.

HosameldinMohamed avatar Jan 28 '20 10:01 HosameldinMohamed

The interface can be similar to what had been done in https://github.com/robotology/gazebo-yarp-plugins/pull/418

Where the user can write a command:

orient_local

And the mode will change to "orient_local" where the applied forces will have the orientation of the link frame. Moreover, the user will specify the force components w.r.t the link frame.

Writing the command:

orient_global

Will switch to the already implemented settings.

  • The default setting is orient_global

HosameldinMohamed avatar Jan 28 '20 10:01 HosameldinMohamed

I have made a draft of the feature, It's in a Fork and a branch https://github.com/HosameldinMohamed/gazebo-yarp-plugins/tree/feature/addOrientOption

if it's okay I can open a pull request.

CC @prashanthr05 @traversaro

HosameldinMohamed avatar Jan 28 '20 10:01 HosameldinMohamed

I have made a draft of the feature, It's in a Fork and a branch https://github.com/HosameldinMohamed/gazebo-yarp-plugins/tree/feature/addOrientOption

The following GIF shows the current status in the forked repo (https://github.com/HosameldinMohamed/gazebo-yarp-plugins/commit/b674a933bc6d5950fa603269c475da25e7b60eb7) when switching from between the modes orient_local and orient_global modes: Peek 2020-01-28 00-42

This shows the current status

HosameldinMohamed avatar Jan 28 '20 10:01 HosameldinMohamed

I have made a draft of the feature, It's in a Fork and a branch https://github.com/HosameldinMohamed/gazebo-yarp-plugins/tree/feature/addOrientOption

if it's okay I can open a pull request.

CC @prashanthr05 @traversaro

Please open a PR, thanks!

traversaro avatar Jan 28 '20 12:01 traversaro

Please open a PR, thanks!

Done here.

HosameldinMohamed avatar Jan 28 '20 13:01 HosameldinMohamed

I have made a draft of the feature, It's in a Fork and a branch https://github.com/HosameldinMohamed/gazebo-yarp-plugins/tree/feature/addOrientOption

The following GIF shows the current status in the forked repo (HosameldinMohamed@b674a93) when switching from between the modes orient_local and orient_global modes: Peek 2020-01-28 00-42

This shows the current status

Doesn't the force on the left hand that is applied along the x, seem a bit skewed in mode orient_local?

Could we also try and visualize the link frames, so that we understand if the forces are applied in the correct directions?

prashanthr05 avatar Feb 08 '20 17:02 prashanthr05

Doesn't the force on the left hand that is applied along the x, seem a bit skewed in mode orient_local?

@prashanthr05, Here's a zoomed screenshot where the link frame is shown

image

It seems that it's aligned with the x-axis.

HosameldinMohamed avatar Feb 10 '20 11:02 HosameldinMohamed