Skip to content

Commit 43f5dab

Browse files
Update src/ur/ur_driver.cpp
Co-authored-by: Felix Exner <feex@universal-robots.com>
1 parent 7c6d95a commit 43f5dab

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/ur/ur_driver.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,17 @@ void UrDriver::handleRTDEReset(const UrDriverConfiguration& config)
718718
output_recipe = rtde_interface::RTDEClient::readRecipe(config.output_recipe_file);
719719
}
720720

721-
bool use_input_file = true;
722-
if (config.input_recipe_file.empty() && config.input_recipe.size() == 0)
723-
throw UrException("Neither input recipe file nor input recipe have been defined");
724-
else if (!config.input_recipe_file.empty() && config.input_recipe.size() != 0)
725-
URCL_LOG_WARN("Both input recipe file and input recipe vector are used. Defaulting to input recipe file");
726-
else if (config.input_recipe_file.empty())
727-
use_input_file = false;
721+
auto input_recipe = config.input_recipe;
722+
if (!config.input_recipe_file.empty())
723+
{
724+
if (config.input_recipe.size() != 0)
725+
{
726+
URCL_LOG_WARN("Both input recipe file and input recipe vector are used. Defaulting to input recipe vector.");
727+
}
728+
else
729+
{
730+
input_recipe = rtde_interface::RTDEClient::readRecipe(config.input_recipe_file);
731+
}
728732

729733
if (use_input_file && !std::filesystem::exists(config.input_recipe_file))
730734
throw UrException("Input recipe file does not exist: " + config.input_recipe_file);

0 commit comments

Comments
 (0)