Skip to content

Commit

Permalink
Merge 94fc877 into bb0b27d
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed May 14, 2024
2 parents bb0b27d + 94fc877 commit 274275c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.

### Added

- BulletInterface: Unit test for contact monitoring
- Python: Expose ``SpineInterface`` from top-level module

### Fixed
Expand Down
23 changes: 23 additions & 0 deletions vulp/actuation/tests/BulletInterfaceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,27 @@ TEST_F(BulletInterfaceTest, ObserveImuOrientation) {
.isApprox(orientation_imu_in_ars));
}

TEST_F(BulletInterfaceTest, MonitorContacts) {
Dictionary config;
config("bullet")("gui") = false;
config("bullet")("monitor")("contacts")("left_wheel_tire") = true;
config("bullet")("monitor")("contacts")("right_wheel_tire") = true;
interface_->reset(config);

Dictionary observation;
interface_->cycle(data_, [](const moteus::Output& output) {});
interface_->observe(observation);

ASSERT_TRUE(observation.has("bullet"));
ASSERT_TRUE(observation("bullet").has("contact"));
ASSERT_TRUE(observation("bullet")("contact").has("left_wheel_tire"));
ASSERT_TRUE(observation("bullet")("contact").has("right_wheel_tire"));
ASSERT_EQ(observation("bullet")("contact")("left_wheel_tire")
.get<int>("num_contact_points"),
0);
ASSERT_EQ(observation("bullet")("contact")("right_wheel_tire")
.get<int>("num_contact_points"),
0);
}

} // namespace vulp::actuation

0 comments on commit 274275c

Please sign in to comment.