From 77303e57f0b38bd97e8f87926bf88e6f0d78f1c3 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 17:29:24 +0200 Subject: [PATCH 01/23] fix: use SP in test --- tests/test_eagerx_pybullet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index fdee3e8..bde73d5 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -68,10 +68,10 @@ def test_eagerx_pybullet(control_mode, p): ) # Make backend - from eagerx.backends.ros1 import Ros1 - backend = Ros1.make() - # from eagerx.backends.single_process import SingleProcess - # backend = SingleProcess.make() + # from eagerx.backends.ros1 import Ros1 + # backend = Ros1.make() + from eagerx.backends.single_process import SingleProcess + backend = SingleProcess.make() # Define environment class TestEnv(eagerx.BaseEnv): From 32103973387530308fd39a9f0e7c41b113435295 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 17:34:17 +0200 Subject: [PATCH 02/23] chore: reduce CI time --- .github/workflows/ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0767787..cda0024 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,24 +65,24 @@ jobs: #---------------------------------------------- # check codestyle & lint #---------------------------------------------- - - name: Check codestyle - run: | - make check-codestyle - - name: Lint with flake8 - run: | - make lint +# - name: Check codestyle +# run: | +# make check-codestyle +# - name: Lint with flake8 +# run: | +# make lint #---------------------------------------------- # ----- install & configure ROS ----- #---------------------------------------------- - - name: install ROS - run: | - sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' - sudo apt install curl # if you haven't already installed curl - curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - - sudo apt update - sudo apt install ros-noetic-ros-base - echo "source /opt/ros/noetic/setup.bash" >> .venv/bin/activate - sudo apt-get install ros-noetic-cv-bridge +# - name: install ROS +# run: | +# sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' +# sudo apt install curl # if you haven't already installed curl +# curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - +# sudo apt update +# sudo apt install ros-noetic-ros-base +# echo "source /opt/ros/noetic/setup.bash" >> .venv/bin/activate +# sudo apt-get install ros-noetic-cv-bridge #---------------------------------------------- # add matrix specifics and run test suite #---------------------------------------------- From 99e7b1012f20ab628c8acb605568168eed5bd73e Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 17:41:47 +0200 Subject: [PATCH 03/23] chore:rm cam, cube, extra sensors --- tests/test_eagerx_pybullet.py | 38 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index bde73d5..c645e83 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -26,27 +26,29 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.camera.objects import Camera import example.objects urdf = os.path.dirname(example.objects.__file__) + "/camera/assets/realsense2_d435.urdf" - cam = Camera.make( - "cam", - rate=rate, - sensors=["rgb", "rgba", "rgbd"], - urdf=urdf, - optical_link="camera_color_optical_frame", - calibration_link="camera_bottom_screw_frame", - ) - graph.add(cam) + # cam = Camera.make( + # "cam", + # rate=rate, + # sensors=["rgb", "rgba", "rgbd"], + # urdf=urdf, + # optical_link="camera_color_optical_frame", + # calibration_link="camera_bottom_screw_frame", + # ) + # graph.add(cam) # Create solid object - from example.objects.solid.objects import Solid - cube = Solid.make("cube", urdf="cube_small.urdf", rate=rate) - graph.add(cube) + # from example.objects.solid.objects import Solid + # cube = Solid.make("cube", urdf="cube_small.urdf", rate=rate) + # graph.add(cube) # Create arm from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - sensors=["pos", "vel", "ft", "at"], - actuators=["joint_control", "gripper_control"], + # sensors=["pos", "vel", "ft", "at"], + sensors=["pos"], + # actuators=["joint_control", "gripper_control"], + actuators=["joint_control"], states=["pos", "vel", "gripper"], rate=rate, control_mode=control_mode, @@ -55,11 +57,11 @@ def test_eagerx_pybullet(control_mode, p): # Connect the nodes graph.connect(action="joints", target=arm.actuators.joint_control) - graph.connect(action="gripper", target=arm.actuators.gripper_control) + # graph.connect(action="gripper", target=arm.actuators.gripper_control) graph.connect(source=arm.sensors.pos, observation="observation") - graph.connect(source=arm.sensors.vel, observation="vel") - graph.connect(source=arm.sensors.ft, observation="ft") - graph.connect(source=arm.sensors.at, observation="at") + # graph.connect(source=arm.sensors.vel, observation="vel") + # graph.connect(source=arm.sensors.ft, observation="ft") + # graph.connect(source=arm.sensors.at, observation="at") # Define engines from eagerx_pybullet.engine import PybulletEngine From 4860d117e308172fda7ef183b43853dc7c54107d Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 17:46:27 +0200 Subject: [PATCH 04/23] chore: update poetry cache --- .github/workflows/ci.yml | 14 +++++++------- tests/test_eagerx_pybullet.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cda0024..5009d23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,17 +45,17 @@ jobs: #---------------------------------------------- # load cached venv if cache exists #---------------------------------------------- - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v2 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} +# - name: Load cached venv +# id: cached-poetry-dependencies +# uses: actions/cache@v2 +# with: +# path: .venv +# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} #---------------------------------------------- # install dependencies if cache does not exist #---------------------------------------------- - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' +# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- # install your root project, if required diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index c645e83..34300c9 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -8,7 +8,7 @@ ENV = eagerx.process.ENVIRONMENT -@pytest.mark.timeout(60) +@pytest.mark.timeout(20) @pytest.mark.parametrize("control_mode", ["position_control", "pd_control", "torque_control", "velocity_control"]) @pytest.mark.parametrize("p", [ENV, NP]) def test_eagerx_pybullet(control_mode, p): From 6375a9798528112f09ab7106ef88ed06d0aa3fa4 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 17:50:45 +0200 Subject: [PATCH 05/23] fix: add all sensors --- .github/workflows/ci.yml | 14 +++++++------- tests/test_eagerx_pybullet.py | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5009d23..cda0024 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,17 +45,17 @@ jobs: #---------------------------------------------- # load cached venv if cache exists #---------------------------------------------- -# - name: Load cached venv -# id: cached-poetry-dependencies -# uses: actions/cache@v2 -# with: -# path: .venv -# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} #---------------------------------------------- # install dependencies if cache does not exist #---------------------------------------------- - name: Install dependencies -# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- # install your root project, if required diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 34300c9..f6a6b1a 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -45,8 +45,8 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - # sensors=["pos", "vel", "ft", "at"], - sensors=["pos"], + sensors=["pos", "vel", "ft", "at"], + # sensors=["pos"], # actuators=["joint_control", "gripper_control"], actuators=["joint_control"], states=["pos", "vel", "gripper"], @@ -59,9 +59,9 @@ def test_eagerx_pybullet(control_mode, p): graph.connect(action="joints", target=arm.actuators.joint_control) # graph.connect(action="gripper", target=arm.actuators.gripper_control) graph.connect(source=arm.sensors.pos, observation="observation") - # graph.connect(source=arm.sensors.vel, observation="vel") - # graph.connect(source=arm.sensors.ft, observation="ft") - # graph.connect(source=arm.sensors.at, observation="at") + graph.connect(source=arm.sensors.vel, observation="vel") + graph.connect(source=arm.sensors.ft, observation="ft") + graph.connect(source=arm.sensors.at, observation="at") # Define engines from eagerx_pybullet.engine import PybulletEngine From 88fc6b6af0eea77e49633851b108d5d484649478 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 17:54:44 +0200 Subject: [PATCH 06/23] fix: add all actuators --- tests/test_eagerx_pybullet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index f6a6b1a..b2c5627 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -47,8 +47,8 @@ def test_eagerx_pybullet(control_mode, p): "viper", sensors=["pos", "vel", "ft", "at"], # sensors=["pos"], - # actuators=["joint_control", "gripper_control"], - actuators=["joint_control"], + actuators=["joint_control", "gripper_control"], + # actuators=["joint_control"], states=["pos", "vel", "gripper"], rate=rate, control_mode=control_mode, @@ -57,7 +57,7 @@ def test_eagerx_pybullet(control_mode, p): # Connect the nodes graph.connect(action="joints", target=arm.actuators.joint_control) - # graph.connect(action="gripper", target=arm.actuators.gripper_control) + graph.connect(action="gripper", target=arm.actuators.gripper_control) graph.connect(source=arm.sensors.pos, observation="observation") graph.connect(source=arm.sensors.vel, observation="vel") graph.connect(source=arm.sensors.ft, observation="ft") From 3000e28759f83385c603dbc59a4885ae6f6ef99c Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 17:57:01 +0200 Subject: [PATCH 07/23] chore: do not use cached env --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cda0024..5009d23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,17 +45,17 @@ jobs: #---------------------------------------------- # load cached venv if cache exists #---------------------------------------------- - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v2 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} +# - name: Load cached venv +# id: cached-poetry-dependencies +# uses: actions/cache@v2 +# with: +# path: .venv +# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} #---------------------------------------------- # install dependencies if cache does not exist #---------------------------------------------- - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' +# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- # install your root project, if required From a8eab7b3ef9d649e07b18a3664a18a5a67b334be Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:05:37 +0200 Subject: [PATCH 08/23] chore add cube, no states, only sensors --- .github/workflows/ci.yml | 15 ++++++++------- Makefile | 3 +++ scripts/empty.bash | 9 +++++++++ tests/test_eagerx_pybullet.py | 13 ++++++++++--- 4 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 scripts/empty.bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5009d23..95a56e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,17 +45,17 @@ jobs: #---------------------------------------------- # load cached venv if cache exists #---------------------------------------------- -# - name: Load cached venv -# id: cached-poetry-dependencies -# uses: actions/cache@v2 -# with: -# path: .venv -# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} #---------------------------------------------- # install dependencies if cache does not exist #---------------------------------------------- - name: Install dependencies -# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- # install your root project, if required @@ -88,6 +88,7 @@ jobs: #---------------------------------------------- - name: Run tests run: | + make source_ros source .venv/bin/activate make pytest release: diff --git a/Makefile b/Makefile index 0e4613d..25abcff 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ PACKAGE_NAME=eagerx_pybullet SHELL=/bin/bash LINT_PATHS=${PACKAGE_NAME}/ +source_ros: + bash ./scripts/empty.bash + pytest: bash ./scripts/run_tests.sh diff --git a/scripts/empty.bash b/scripts/empty.bash new file mode 100644 index 0000000..8c9d849 --- /dev/null +++ b/scripts/empty.bash @@ -0,0 +1,9 @@ +#!/bin/bash -e + +if [ -s diff.txt ]; then + # The file is not-empty. + echo "/opt/ros/noetic/setup.bash exists!" +else + # The file is empty. + touch /opt/ros/noetic/setup.bash +fi diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index b2c5627..f8ec931 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -37,9 +37,16 @@ def test_eagerx_pybullet(control_mode, p): # graph.add(cam) # Create solid object - # from example.objects.solid.objects import Solid - # cube = Solid.make("cube", urdf="cube_small.urdf", rate=rate) - # graph.add(cube) + from example.objects.solid.objects import Solid + cube = Solid.make("cube", + urdf="cube_small.urdf", + rate=rate, + # sensors=["pos", "vel", "orientation", "angular_vel"], + sensors=["pos", "vel", "orientation", "angular_vel"], + # states=["pos", "vel", "orientation", "angular_vel"], + states=[], + ) + graph.add(cube) # Create arm from example.objects.vx300s.objects import Vx300s From 1819c8f3943a3d164d6cfd9617d629c649cc9da1 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:08:16 +0200 Subject: [PATCH 09/23] chore: create dirs --- scripts/empty.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/empty.bash b/scripts/empty.bash index 8c9d849..3b100e9 100644 --- a/scripts/empty.bash +++ b/scripts/empty.bash @@ -1,9 +1,10 @@ #!/bin/bash -e -if [ -s diff.txt ]; then +if [ -s /opt/ros/noetic/setup.bash ]; then # The file is not-empty. echo "/opt/ros/noetic/setup.bash exists!" else # The file is empty. + mkdir -p /opt/ros/noetic/ touch /opt/ros/noetic/setup.bash fi From c9e3eab52f492149bbc9bb45047c11180b476f95 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:12:54 +0200 Subject: [PATCH 10/23] chore: add states [seems they are auto selected] --- example/objects/solid/objects.py | 4 ++-- tests/test_eagerx_pybullet.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/objects/solid/objects.py b/example/objects/solid/objects.py index 9244de3..fee4d8e 100644 --- a/example/objects/solid/objects.py +++ b/example/objects/solid/objects.py @@ -42,8 +42,8 @@ def make( # Modify default agnostic params # Only allow changes to the agnostic params (rates, windows, (space)converters, etc... spec.config.name = name - spec.config.sensors = sensors if sensors is not None else ["pos", "vel", "orientation", "angular_vel"] - spec.config.states = states if states is not None else ["pos", "vel", "orientation", "angular_vel"] + spec.config.sensors = sensors if isinstance(sensors, list) is not None else ["pos", "vel", "orientation", "angular_vel"] + spec.config.states = states if isinstance(states, list) is not None else ["pos", "vel", "orientation", "angular_vel"] # Add registered agnostic params spec.config.urdf = urdf diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index f8ec931..4fa2a84 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -43,8 +43,8 @@ def test_eagerx_pybullet(control_mode, p): rate=rate, # sensors=["pos", "vel", "orientation", "angular_vel"], sensors=["pos", "vel", "orientation", "angular_vel"], - # states=["pos", "vel", "orientation", "angular_vel"], - states=[], + states=["pos", "vel", "orientation", "angular_vel"], + # states=[], ) graph.add(cube) From 434a5fbe022b88739463f2016d29684f5ee68341 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:15:33 +0200 Subject: [PATCH 11/23] chore: select cam --- tests/test_eagerx_pybullet.py | 39 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 4fa2a84..9b50ba8 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -26,27 +26,28 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.camera.objects import Camera import example.objects urdf = os.path.dirname(example.objects.__file__) + "/camera/assets/realsense2_d435.urdf" - # cam = Camera.make( - # "cam", - # rate=rate, - # sensors=["rgb", "rgba", "rgbd"], - # urdf=urdf, - # optical_link="camera_color_optical_frame", - # calibration_link="camera_bottom_screw_frame", - # ) - # graph.add(cam) + cam = Camera.make( + "cam", + rate=rate, + sensors=["rgb", "rgba", "rgbd"], + states=["pos", "orientation"], + urdf=urdf, + optical_link="camera_color_optical_frame", + calibration_link="camera_bottom_screw_frame", + ) + graph.add(cam) # Create solid object - from example.objects.solid.objects import Solid - cube = Solid.make("cube", - urdf="cube_small.urdf", - rate=rate, - # sensors=["pos", "vel", "orientation", "angular_vel"], - sensors=["pos", "vel", "orientation", "angular_vel"], - states=["pos", "vel", "orientation", "angular_vel"], - # states=[], - ) - graph.add(cube) + # from example.objects.solid.objects import Solid + # cube = Solid.make("cube", + # urdf="cube_small.urdf", + # rate=rate, + # # sensors=["pos", "vel", "orientation", "angular_vel"], + # sensors=["pos", "vel", "orientation", "angular_vel"], + # states=["pos", "vel", "orientation", "angular_vel"], + # # states=[], + # ) + # graph.add(cube) # Create arm from example.objects.vx300s.objects import Vx300s From b5e9323bfceb0cd2abd8dc5ce4405eb451e7a29b Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:17:29 +0200 Subject: [PATCH 12/23] chore: reduce total number of sensors --- tests/test_eagerx_pybullet.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 9b50ba8..422801c 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -29,7 +29,7 @@ def test_eagerx_pybullet(control_mode, p): cam = Camera.make( "cam", rate=rate, - sensors=["rgb", "rgba", "rgbd"], + sensors=["rgb"], states=["pos", "orientation"], urdf=urdf, optical_link="camera_color_optical_frame", @@ -53,9 +53,9 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - sensors=["pos", "vel", "ft", "at"], + sensors=["pos"], # sensors=["pos"], - actuators=["joint_control", "gripper_control"], + actuators=["joint_control"], # actuators=["joint_control"], states=["pos", "vel", "gripper"], rate=rate, @@ -65,11 +65,11 @@ def test_eagerx_pybullet(control_mode, p): # Connect the nodes graph.connect(action="joints", target=arm.actuators.joint_control) - graph.connect(action="gripper", target=arm.actuators.gripper_control) + # graph.connect(action="gripper", target=arm.actuators.gripper_control) graph.connect(source=arm.sensors.pos, observation="observation") - graph.connect(source=arm.sensors.vel, observation="vel") - graph.connect(source=arm.sensors.ft, observation="ft") - graph.connect(source=arm.sensors.at, observation="at") + # graph.connect(source=arm.sensors.vel, observation="vel") + # graph.connect(source=arm.sensors.ft, observation="ft") + # graph.connect(source=arm.sensors.at, observation="at") # Define engines from eagerx_pybullet.engine import PybulletEngine From 31cba16a2bd7893574b60beb86bce26a256b5574 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:20:13 +0200 Subject: [PATCH 13/23] chore: add all objects --- tests/test_eagerx_pybullet.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 422801c..bbbfb8f 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -9,7 +9,7 @@ @pytest.mark.timeout(20) -@pytest.mark.parametrize("control_mode", ["position_control", "pd_control", "torque_control", "velocity_control"]) +@pytest.mark.parametrize("control_mode", ["position_control"]) @pytest.mark.parametrize("p", [ENV, NP]) def test_eagerx_pybullet(control_mode, p): eagerx.set_log_level(eagerx.DEBUG) @@ -38,23 +38,23 @@ def test_eagerx_pybullet(control_mode, p): graph.add(cam) # Create solid object - # from example.objects.solid.objects import Solid - # cube = Solid.make("cube", - # urdf="cube_small.urdf", - # rate=rate, - # # sensors=["pos", "vel", "orientation", "angular_vel"], - # sensors=["pos", "vel", "orientation", "angular_vel"], - # states=["pos", "vel", "orientation", "angular_vel"], - # # states=[], - # ) - # graph.add(cube) + from example.objects.solid.objects import Solid + cube = Solid.make("cube", + urdf="cube_small.urdf", + rate=rate, + # sensors=["pos", "vel", "orientation", "angular_vel"], + sensors=["pos"], + states=["pos", "vel", "orientation", "angular_vel"], + # states=[], + ) + graph.add(cube) # Create arm from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", sensors=["pos"], - # sensors=["pos"], + # sensors=["pos", "vel", "ft", "at"], actuators=["joint_control"], # actuators=["joint_control"], states=["pos", "vel", "gripper"], From 693964d549c76bec7b7785114629f6891a01661d Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:22:11 +0200 Subject: [PATCH 14/23] chore: more sensors --- tests/test_eagerx_pybullet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index bbbfb8f..c00f97a 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -9,7 +9,7 @@ @pytest.mark.timeout(20) -@pytest.mark.parametrize("control_mode", ["position_control"]) +@pytest.mark.parametrize("control_mode", ["position_control", "position_control", "position_control", "position_control","position_control", "position_control", "position_control","position_control", "position_control","position_control"]) @pytest.mark.parametrize("p", [ENV, NP]) def test_eagerx_pybullet(control_mode, p): eagerx.set_log_level(eagerx.DEBUG) @@ -43,7 +43,7 @@ def test_eagerx_pybullet(control_mode, p): urdf="cube_small.urdf", rate=rate, # sensors=["pos", "vel", "orientation", "angular_vel"], - sensors=["pos"], + sensors=["pos", "vel"], states=["pos", "vel", "orientation", "angular_vel"], # states=[], ) From c7c9f6498b265848b2946bfa96ed77e79d255ca9 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:24:02 +0200 Subject: [PATCH 15/23] chore: more sensors --- tests/test_eagerx_pybullet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index c00f97a..8583e90 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -43,7 +43,7 @@ def test_eagerx_pybullet(control_mode, p): urdf="cube_small.urdf", rate=rate, # sensors=["pos", "vel", "orientation", "angular_vel"], - sensors=["pos", "vel"], + sensors=["pos", "vel", "orientation"], states=["pos", "vel", "orientation", "angular_vel"], # states=[], ) From 72de894855bf2314d8f551f97b961be891d8106e Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:25:51 +0200 Subject: [PATCH 16/23] chore: more senosrs --- tests/test_eagerx_pybullet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 8583e90..247d02c 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -43,7 +43,7 @@ def test_eagerx_pybullet(control_mode, p): urdf="cube_small.urdf", rate=rate, # sensors=["pos", "vel", "orientation", "angular_vel"], - sensors=["pos", "vel", "orientation"], + sensors=["pos", "vel", "orientation", "angular_vel"], states=["pos", "vel", "orientation", "angular_vel"], # states=[], ) From 4047c8d9709c5bb2877f65c5d72dc674e5ac73f4 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:27:46 +0200 Subject: [PATCH 17/23] chore: more sensors --- tests/test_eagerx_pybullet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 247d02c..a1c35d8 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -53,7 +53,7 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - sensors=["pos"], + sensors=["pos", "vel"], # sensors=["pos", "vel", "ft", "at"], actuators=["joint_control"], # actuators=["joint_control"], From 0d7c464b85b93df57fe79537ea0ace4b8f11e721 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:30:01 +0200 Subject: [PATCH 18/23] chore: 1 less sensor --- tests/test_eagerx_pybullet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index a1c35d8..eb870d6 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -42,7 +42,6 @@ def test_eagerx_pybullet(control_mode, p): cube = Solid.make("cube", urdf="cube_small.urdf", rate=rate, - # sensors=["pos", "vel", "orientation", "angular_vel"], sensors=["pos", "vel", "orientation", "angular_vel"], states=["pos", "vel", "orientation", "angular_vel"], # states=[], @@ -53,7 +52,7 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - sensors=["pos", "vel"], + sensors=["pos"], # sensors=["pos", "vel", "ft", "at"], actuators=["joint_control"], # actuators=["joint_control"], From 50ae544c88a454c03fbfa7796c3e32526ec6614e Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:31:49 +0200 Subject: [PATCH 19/23] chore: same number of sensors, but different sensors --- tests/test_eagerx_pybullet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index eb870d6..7e51a70 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -42,7 +42,7 @@ def test_eagerx_pybullet(control_mode, p): cube = Solid.make("cube", urdf="cube_small.urdf", rate=rate, - sensors=["pos", "vel", "orientation", "angular_vel"], + sensors=["pos", "vel", "orientation"], states=["pos", "vel", "orientation", "angular_vel"], # states=[], ) @@ -52,7 +52,7 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - sensors=["pos"], + sensors=["pos", "vel"], # sensors=["pos", "vel", "ft", "at"], actuators=["joint_control"], # actuators=["joint_control"], From c39bfa5856e7a26ef9277dfd24c7968a2838d1a8 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:35:15 +0200 Subject: [PATCH 20/23] chore: swap sensor for actuator --- tests/test_eagerx_pybullet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 7e51a70..35b9e52 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -52,9 +52,9 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - sensors=["pos", "vel"], + sensors=["pos"], # sensors=["pos", "vel", "ft", "at"], - actuators=["joint_control"], + actuators=["joint_control", "gripper_control"], # actuators=["joint_control"], states=["pos", "vel", "gripper"], rate=rate, @@ -64,7 +64,7 @@ def test_eagerx_pybullet(control_mode, p): # Connect the nodes graph.connect(action="joints", target=arm.actuators.joint_control) - # graph.connect(action="gripper", target=arm.actuators.gripper_control) + graph.connect(action="gripper", target=arm.actuators.gripper_control) graph.connect(source=arm.sensors.pos, observation="observation") # graph.connect(source=arm.sensors.vel, observation="vel") # graph.connect(source=arm.sensors.ft, observation="ft") From 626a80cb56b788dd756721c829cd51ca562a42c1 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:39:24 +0200 Subject: [PATCH 21/23] chore: add sensor [should break here] --- tests/test_eagerx_pybullet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 35b9e52..589b282 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -52,7 +52,7 @@ def test_eagerx_pybullet(control_mode, p): from example.objects.vx300s.objects import Vx300s arm = Vx300s.make( "viper", - sensors=["pos"], + sensors=["pos", "vel"], # sensors=["pos", "vel", "ft", "at"], actuators=["joint_control", "gripper_control"], # actuators=["joint_control"], From 221d10507d9d956af130c704429bc78357f09877 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 18:41:54 +0200 Subject: [PATCH 22/23] chore: increase min threads --- tests/test_eagerx_pybullet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 589b282..949003a 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -81,6 +81,7 @@ def test_eagerx_pybullet(control_mode, p): # backend = Ros1.make() from eagerx.backends.single_process import SingleProcess backend = SingleProcess.make() + SingleProcess.MIN_THREADS = 16 # Define environment class TestEnv(eagerx.BaseEnv): From c62470839205ea9e6a61b2ce0b2b089d4d1b28f0 Mon Sep 17 00:00:00 2001 From: Bas van der Heijden Date: Tue, 13 Sep 2022 19:00:53 +0200 Subject: [PATCH 23/23] chore: 10 threads [should break] --- tests/test_eagerx_pybullet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_eagerx_pybullet.py b/tests/test_eagerx_pybullet.py index 949003a..25ca54a 100644 --- a/tests/test_eagerx_pybullet.py +++ b/tests/test_eagerx_pybullet.py @@ -81,7 +81,7 @@ def test_eagerx_pybullet(control_mode, p): # backend = Ros1.make() from eagerx.backends.single_process import SingleProcess backend = SingleProcess.make() - SingleProcess.MIN_THREADS = 16 + SingleProcess.MIN_THREADS = 10 # Define environment class TestEnv(eagerx.BaseEnv):