Open
Description
Our integration tests currently have a recurring pattern where the robot hardware read/update/write steps are repeated a couple of times in a loop until a condition is met.
An occurence of this pattern is such:
auto start_time = rclcpp::Clock().now();
rclcpp::Duration wait = rclcpp::Duration::from_seconds(0.5);
auto end_time = start_time + wait;
while (rclcpp::Clock().now() < end_time) {
test_robot->read();
traj_controller->update();
test_robot->write();
}
To improve readability and reduce duplicated code in the future, this could be factored into a test_common file with a name along the lines of run_mini_simulation(test_robot, time_to_run_for)
.
Metadata
Metadata
Assignees
Type
Projects
Status
No status