Skip to content
Merged
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
16 changes: 8 additions & 8 deletions ur_robot_driver/src/hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,12 +1099,6 @@
}
}

if (!std::all_of(start_modes_.begin() + 1, start_modes_.end(),
[&](const std::vector<std::string>& other) { return other == start_modes_[0]; })) {
RCLCPP_ERROR(get_logger(), "Start modes of all joints have to be the same.");
return hardware_interface::return_type::ERROR;
}

// Starting interfaces
// If a joint has been reserved already, raise an error.
// Modes that are not directly mapped to a single joint such as force_mode reserve all joints.
Expand All @@ -1119,7 +1113,7 @@
"requested.");
return hardware_interface::return_type::ERROR;
}
start_modes_[i] = { hardware_interface::HW_IF_POSITION };
start_modes_[i].push_back(hardware_interface::HW_IF_POSITION);

Check warning on line 1116 in ur_robot_driver/src/hardware_interface.cpp

View check run for this annotation

Codecov / codecov/patch

ur_robot_driver/src/hardware_interface.cpp#L1116

Added line #L1116 was not covered by tests
} else if (key == info_.joints[i].name + "/" + hardware_interface::HW_IF_VELOCITY) {
if (std::any_of(start_modes_[i].begin(), start_modes_[i].end(), [&](const std::string& item) {
return item == hardware_interface::HW_IF_POSITION || item == PASSTHROUGH_GPIO ||
Expand All @@ -1129,7 +1123,7 @@
"requested.");
return hardware_interface::return_type::ERROR;
}
start_modes_[i] = { hardware_interface::HW_IF_VELOCITY };
start_modes_[i].push_back(hardware_interface::HW_IF_VELOCITY);

Check warning on line 1126 in ur_robot_driver/src/hardware_interface.cpp

View check run for this annotation

Codecov / codecov/patch

ur_robot_driver/src/hardware_interface.cpp#L1126

Added line #L1126 was not covered by tests
} else if (key == tf_prefix + FORCE_MODE_GPIO + "/type") {
if (std::any_of(start_modes_[i].begin(), start_modes_[i].end(), [&](const std::string& item) {
return item == hardware_interface::HW_IF_POSITION || item == hardware_interface::HW_IF_VELOCITY;
Expand Down Expand Up @@ -1169,6 +1163,12 @@
}
}

if (!std::all_of(start_modes_.begin() + 1, start_modes_.end(),
[&](const std::vector<std::string>& other) { return other == start_modes_[0]; })) {
RCLCPP_ERROR(get_logger(), "Start modes of all joints have to be the same.");
return hardware_interface::return_type::ERROR;

Check warning on line 1169 in ur_robot_driver/src/hardware_interface.cpp

View check run for this annotation

Codecov / codecov/patch

ur_robot_driver/src/hardware_interface.cpp#L1167-L1169

Added lines #L1167 - L1169 were not covered by tests
}

// Stopping interfaces
// add stop interface per joint in tmp var for later check
for (const auto& key : stop_interfaces) {
Expand Down
Loading