Skip to content

Commit c98ad77

Browse files
author
Pablo David Aranda Rodriguez
committed
Added support for std::vector strings in UrDriver
1 parent 1d785d9 commit c98ad77

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

include/ur_client_library/ur/ur_driver.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ namespace urcl
5252
*/
5353
struct UrDriverConfiguration
5454
{
55-
std::string robot_ip; //!< IP-address under which the robot is reachable.
56-
std::string script_file; //!< URScript file that should be sent to the robot.
57-
std::string output_recipe_file; //!< Filename where the output recipe is stored in.
58-
std::string input_recipe_file; //!< Filename where the input recipe is stored in.
55+
std::string robot_ip; //!< IP-address under which the robot is reachable.
56+
std::string script_file; //!< URScript file that should be sent to the robot.
57+
std::string output_recipe_file; //!< Filename where the output recipe is stored in.
58+
std::string input_recipe_file; //!< Filename where the input recipe is stored in.
59+
std::vector<std::string> output_recipe; //!< Vector with the output recipe fields.
60+
std::vector<std::string> input_recipe; //!< Vector with the input recipe fields.
5961

6062
/*!
6163
* \brief Function handle to a callback on program state changes.

src/ur/ur_driver.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ void UrDriver::init(const UrDriverConfiguration& config)
7676

7777
URCL_LOG_DEBUG("Initializing urdriver");
7878
URCL_LOG_DEBUG("Initializing RTDE client");
79-
rtde_client_.reset(
80-
new rtde_interface::RTDEClient(robot_ip_, notifier_, config.output_recipe_file, config.input_recipe_file));
79+
if (config.output_recipe_file.empty() && config.input_recipe_file.empty())
80+
rtde_client_.reset(new rtde_interface::RTDEClient(robot_ip_, notifier_, config.output_recipe, config.input_recipe));
81+
else
82+
rtde_client_.reset(
83+
new rtde_interface::RTDEClient(robot_ip_, notifier_, config.output_recipe_file, config.input_recipe_file));
8184

8285
primary_client_.reset(new urcl::primary_interface::PrimaryClient(robot_ip_, notifier_));
8386

0 commit comments

Comments
 (0)