Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Clang build
run: make clangcompile
- name: Clang Tidy
run: clang-tidy-15 -p=build --warnings-as-errors='*' $(find src -name '*.cpp' -o -name '*.cc' -name '*.h')
run: clang-tidy -p=build --warnings-as-errors='*' $(find src -name '*.cpp' -o -name '*.cc' -name '*.h')

build_gcc:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
pythonpackage:
runs-on: ubuntu-latest
env:
CC: clang-15
CXX: clang++-15
CC: clang
CXX: clang++
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
Expand Down
46 changes: 46 additions & 0 deletions python/tests/test_sim_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ def assert_collision(self, info: dict):
class TestSimEnvsTRPY(TestSimEnvs):
"""This class is for testing TRPY sim env functionalities"""

def test_reset(self, cfg, gripper_cfg, cam_cfg):
"""
Test reset functionality.
"""
# TODO:
# - test initial pose after reset.
# - test initial gripper config.
env = fr3_sim_env(
ControlMode.CARTESIAN_TRPY, cfg, gripper_cfg=gripper_cfg, camera_set_cfg=cam_cfg, max_relative_movement=None
)
# Test double reset. Regression test. A lot can go wrong when resetting.
env.reset()
env.reset()

def test_zero_action_trpy(self, cfg):
"""
Test that a zero action does not change the state significantly
Expand Down Expand Up @@ -169,6 +183,24 @@ def test_collision_guard_trpy(self, cfg, gripper_cfg, cam_cfg):
class TestSimEnvsTquart(TestSimEnvs):
"""This class is for testing Tquart sim env functionalities"""

def test_reset(self, cfg, gripper_cfg, cam_cfg):
"""
Test reset functionality.
"""
# TODO:
# - test initial pose after reset.
# - test initial gripper config.
env = fr3_sim_env(
ControlMode.CARTESIAN_TQuart,
cfg,
gripper_cfg=gripper_cfg,
camera_set_cfg=cam_cfg,
max_relative_movement=None,
)
# Test double reset. Regression test. A lot can go wrong when resetting.
env.reset()
env.reset()

def test_non_zero_action_tquart(self, cfg):
"""
Test that a zero action does not change the state significantly in the tquart configuration
Expand Down Expand Up @@ -271,6 +303,20 @@ def test_collision_guard_tquart(self, cfg, gripper_cfg, cam_cfg):
class TestSimEnvsJoints(TestSimEnvs):
"""This class is for testing Joints sim env functionalities"""

def test_reset(self, cfg, gripper_cfg, cam_cfg):
"""
Test reset functionality.
"""
# TODO:
# - test initial pose after reset.
# - test initial gripper config.
env = fr3_sim_env(
ControlMode.JOINTS, cfg, gripper_cfg=gripper_cfg, camera_set_cfg=cam_cfg, max_relative_movement=None
)
# Test double reset. Regression test. A lot can go wrong when resetting.
env.reset()
env.reset()

def test_zero_action_joints(self, cfg):
"""
This is for testing that a certain action leads to the expected change in state
Expand Down
2 changes: 2 additions & 0 deletions src/sim/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ int SimCameraSet::buffer_size() {
}
void SimCameraSet::clear_buffer() {
std::lock_guard<std::mutex> lock(buffer_lock);
// when we clear the buffer, there is no last image timestep
this->last_ts = 0;
buffer.clear();
}

Expand Down
Loading