diff --git a/examples/scripts/python_api/testFixture.py b/examples/scripts/python_api/testFixture.py index caedebdc84..46a20e0fe9 100644 --- a/examples/scripts/python_api/testFixture.py +++ b/examples/scripts/python_api/testFixture.py @@ -20,7 +20,7 @@ # # Now you can run the example: # -# python3 examples/scripts/python_api/helperFixture.py +# python3 examples/scripts/python_api/testFixture.py import os import time @@ -28,13 +28,12 @@ from ignition.common import set_verbosity from ignition.gazebo import TestFixture, World, world_entity from ignition.math import Vector3d -from sdformat import Element set_verbosity(4) file_path = os.path.dirname(os.path.realpath(__file__)) -helper = TestFixture(os.path.join(file_path, 'gravity.sdf')) +fixture = TestFixture(os.path.join(file_path, 'gravity.sdf')) post_iterations = 0 iterations = 0 @@ -69,12 +68,12 @@ def on_post_udpate_cb(_info, _ecm): print('Post update sim time: ', _info.sim_time) -helper.on_post_update(on_post_udpate_cb) -helper.on_update(on_udpate_cb) -helper.on_pre_update(on_pre_udpate_cb) -helper.finalize() +fixture.on_post_update(on_post_udpate_cb) +fixture.on_update(on_udpate_cb) +fixture.on_pre_update(on_pre_udpate_cb) +fixture.finalize() -server = helper.server() +server = fixture.server() server.run(False, 1000, False) while(server.is_running()): diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index ee094ff590..8c7a98d92a 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -50,7 +50,6 @@ pybind11_add_module(gazebo SHARED target_link_libraries(gazebo PRIVATE ${PROJECT_LIBRARY_TARGET_NAME} - sdformat${SDF_VER}::sdformat${SDF_VER} ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER} ) diff --git a/python/test/testFixture_TEST.py b/python/test/testFixture_TEST.py index 32d6852249..8a0d9995dd 100644 --- a/python/test/testFixture_TEST.py +++ b/python/test/testFixture_TEST.py @@ -30,7 +30,7 @@ def test_test_fixture(self): set_verbosity(4) file_path = os.path.dirname(os.path.realpath(__file__)) - helper = TestFixture(os.path.join(file_path, 'gravity.sdf')) + fixture = TestFixture(os.path.join(file_path, 'gravity.sdf')) def on_post_udpate_cb(_info, _ecm): global post_iterations @@ -49,12 +49,12 @@ def on_udpate_cb(_info, _ecm): global iterations iterations += 1 - helper.on_post_update(on_post_udpate_cb) - helper.on_update(on_udpate_cb) - helper.on_pre_update(on_pre_udpate_cb) - helper.finalize() + fixture.on_post_update(on_post_udpate_cb) + fixture.on_update(on_udpate_cb) + fixture.on_pre_update(on_pre_udpate_cb) + fixture.finalize() - server = helper.server() + server = fixture.server() server.run(False, 1000, False) while(server.is_running()): diff --git a/tutorials/python_interfaces.md b/tutorials/python_interfaces.md index d8f88167f6..f5620e147d 100644 --- a/tutorials/python_interfaces.md +++ b/tutorials/python_interfaces.md @@ -11,7 +11,7 @@ step simulation and check entities and components. ```{.python} file_path = os.path.dirname(os.path.realpath(__file__)) -helper = HelperFixture(os.path.join(file_path, 'gravity.sdf')) +fixture = TestFixture(os.path.join(file_path, 'gravity.sdf')) ``` - **Step 2**: Write your `preupdate`, `update` or `postupdate` code: @@ -25,13 +25,13 @@ def on_post_udpate_cb(_info, _ecm): - **Step 3**: Register the function. ```python -helper.on_post_update(on_post_udpate_cb) +fixture.on_post_update(on_post_udpate_cb) ``` - **Step 4**: Be sure to call finalize before running the server. ```python -helper.finalize() +fixture.finalize() ``` - **Step 5**: Run the server @@ -57,7 +57,7 @@ export PYTHONPATH=$PYTHONPATH:/install/lib/python Now you can run the example: ```bash -$ python3 examples/scripts/python_api/helperFixture.py +$ python3 examples/scripts/python_api/testFixture.py [Msg] Loading SDF world file[/home/ahcorde/ignition_fortress/src/ign-gazebo/examples/scripts/python_api/gravity.sdf]. [Dbg] [Physics.cc:789] Loaded [ignition::physics::dartsim::Plugin] from library [/home/ahcorde/ignition_fortress/install/lib/ign-physics-5/engine-plugins/libignition-physics-dartsim-plugin.so] [Dbg] [SimulationRunner.cc:909] Loaded system [ignition::gazebo::systems::Physics] for entity [1]