Skip to content

Commit 7c6d95a

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

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/ur/ur_driver.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -703,15 +703,20 @@ std::deque<urcl::primary_interface::ErrorCode> UrDriver::getErrorCodes()
703703

704704
void UrDriver::handleRTDEReset(const UrDriverConfiguration& config)
705705
{
706-
bool use_output_file = true;
706+
auto output_recipe = config.output_recipe;
707707
if (config.output_recipe_file.empty() && config.output_recipe.size() == 0)
708-
throw UrException("Neither output recipe file nor output recipe have been defined");
709-
else if (!config.output_recipe_file.empty() && config.output_recipe.size() != 0)
710-
URCL_LOG_WARN("Both output recipe file and output recipe vector are used. Defaulting to output recipe file");
711-
else if (config.output_recipe_file.empty())
712-
use_output_file = false;
713-
if (use_output_file && !std::filesystem::exists(config.output_recipe_file))
714-
throw UrException("Output recipe file does not exist: " + config.output_recipe_file);
708+
{
709+
throw UrException("Neither output recipe file nor output recipe have been defined. An output recipe is required.");
710+
}
711+
if (!config.output_recipe_file.empty())
712+
{
713+
if (config.output_recipe.size() != 0)
714+
URCL_LOG_WARN("Both output recipe file and output recipe vector are used. Defaulting to output recipe vector");
715+
}
716+
else
717+
{
718+
output_recipe = rtde_interface::RTDEClient::readRecipe(config.output_recipe_file);
719+
}
715720

716721
bool use_input_file = true;
717722
if (config.input_recipe_file.empty() && config.input_recipe.size() == 0)

0 commit comments

Comments
 (0)