Skip to content

Commit

Permalink
Merge pull request #339 from robotology/fix/ik
Browse files Browse the repository at this point in the history
Fix call to `setComTarget` in InverseKinematicsNLP
  • Loading branch information
diegoferigo authored Apr 28, 2021
2 parents a205009 + 821821b commit dd87f6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions python/gym_ignition/rbd/idyntree/inverse_kinematics_nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def add_com_target(self,
constraint_tolerance: float = 1E-8) -> None:

# Add the target
self._ik.setCOMTarget(desiredPosition=idt.Position_Zero(), weight=weight)
self._ik.setCOMTarget(idt.Position_Zero(), weight)

# Configure it either as target or constraint
self._ik.setCOMAsConstraint(asConstraint=as_constraint)
Expand Down Expand Up @@ -374,8 +374,7 @@ def update_com_target(self,
p = rbd.idyntree.numpy.FromNumPy.to_idyntree_position(position=position)

# Update the target inside IK
self._ik.setCOMTarget(desiredPosition=p,
weight=self._targets_data["com"].weight)
self._ik.setCOMTarget(p, self._targets_data["com"].weight)

# Update the target data
self._targets_data["com"] = TargetData(type=TargetType.POSITION,
Expand Down
4 changes: 3 additions & 1 deletion tests/test_scenario/test_ignition_fuel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
scenario.set_verbosity(scenario.Verbosity_debug)


# See https://github.com/robotology/gym-ignition/pull/339#issuecomment-828300490
@pytest.mark.xfail(strict=False)
@pytest.mark.parametrize(
"gazebo", [(0.001, 1.0, 1)], indirect=True, ids=utils.id_gazebo_fn
)
Expand Down Expand Up @@ -49,7 +51,7 @@ def test_download_model_from_fuel(gazebo: scenario.GazeboSimulator):
@pytest.mark.parametrize(
"gazebo", [(0.001, 1.0, 1)], indirect=True, ids=utils.id_gazebo_fn
)
def test_fuel_world(gazebo):
def test_fuel_world(gazebo: scenario.GazeboSimulator):
# (setup) load a world that includes a fuel model
worlds_folder = Path(__file__) / ".." / ".." / "assets" / "worlds"
world_file = worlds_folder / "fuel_support.sdf"
Expand Down

0 comments on commit dd87f6e

Please sign in to comment.