Skip to content

Commit

Permalink
Merge 38001ed into 04d7f2e
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Mar 10, 2024
2 parents 04d7f2e + 38001ed commit 945aa24
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- BulletInterface: Set a default servo temperature of 20 °C
- BulletInterface: Set a default servo voltage of 18 V

## [2.2.1] - 2024-02-20

### Added
Expand Down
2 changes: 2 additions & 0 deletions vulp/actuation/BulletInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ BulletInterface::BulletInterface(const ServoLayout& layout,
const std::string& joint_name = id_joint.second;
moteus::ServoReply reply;
reply.id = servo_id;
reply.result.temperature = 20.0; // ['C], simulation room temperature
reply.result.voltage = 18.0; // [V], nominal voltage of a RYOBI battery
joint_index_map_.try_emplace(joint_name, -1);
servo_reply_.try_emplace(joint_name, reply);
}
Expand Down
18 changes: 18 additions & 0 deletions vulp/actuation/tests/BulletInterfaceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,22 @@ TEST_F(BulletInterfaceTest, ComputeJointFeedforwardTorque) {
ASSERT_NEAR(right_wheel_reply.result.torque, 0.42, 1e-3);
}

TEST_F(BulletInterfaceTest, JointRepliesHaveTemperature) {
interface_->cycle(data_, [](const moteus::Output& output) {});
for (const auto& pair : interface_->servo_reply()) {
const auto& reply = pair.second;
ASSERT_GT(reply.result.temperature, 0.0);
ASSERT_LT(reply.result.temperature, 100.0);
}
}

TEST_F(BulletInterfaceTest, JointRepliesHaveVoltage) {
interface_->cycle(data_, [](const moteus::Output& output) {});
for (const auto& pair : interface_->servo_reply()) {
const auto& reply = pair.second;
ASSERT_GT(reply.result.voltage, 10.0); // moteus min 10 V
ASSERT_LT(reply.result.voltage, 44.0); // moteus max 44 V
}
}

} // namespace vulp::actuation

0 comments on commit 945aa24

Please sign in to comment.