Skip to content

Commit 7d9ba11

Browse files
author
Pablo David Aranda Rodriguez
committed
New tests for UrDriver recipe reading changes
1 parent 7d0c16a commit 7d9ba11

15 files changed

+121
-60
lines changed

examples/direct_torque_control.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030

3131
#include <ur_client_library/example_robot_wrapper.h>
3232
#include <cstddef>
33+
#include <vector>
3334

3435
// In a real-world example it would be better to get those values from command line parameters / a
3536
// better configuration system such as Boost.Program_options
3637
const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
3738
const std::string SCRIPT_FILE = "resources/external_control.urscript";
3839
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
3940
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
41+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
4042

4143
const size_t JOINT_INDEX = 5; // Joint index to control, in this case joint 6 (index 5)
4244

@@ -62,8 +64,8 @@ int main(int argc, char* argv[])
6264
}
6365

6466
bool headless_mode = true;
65-
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
66-
"external_control.urp");
67+
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR,
68+
NULL_VECTOR, headless_mode, "external_control.urp");
6769
if (!g_my_robot->isHealthy())
6870
{
6971
URCL_LOG_ERROR("Something in the robot initialization went wrong. Exiting. Please check the output above.");

examples/external_fts_through_rtde.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
9797
const std::string SCRIPT_FILE = "resources/external_control.urscript";
9898
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
9999
const std::string INPUT_RECIPE = "examples/resources/rtde_input_only_ft.txt";
100+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
100101

101102
std::unique_ptr<urcl::ExampleRobotWrapper> g_my_robot;
102103
std::atomic<bool> g_RUNNING = true;
@@ -271,7 +272,8 @@ int main(int argc, char* argv[])
271272
second_to_run = std::stoi(argv[2]);
272273
}
273274

274-
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, true);
275+
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR,
276+
NULL_VECTOR, true);
275277
if (!g_my_robot->isHealthy())
276278
{
277279
URCL_LOG_ERROR("Something in the robot initialization went wrong. Exiting. Please check the output above.");

examples/force_mode_example.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
5151
const std::string SCRIPT_FILE = "resources/external_control.urscript";
5252
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
5353
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
54+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
5455
const std::string CALIBRATION_CHECKSUM = "calib_12788084448423163542";
5556

5657
std::unique_ptr<ExampleRobotWrapper> g_my_robot;
@@ -83,8 +84,8 @@ int main(int argc, char* argv[])
8384
}
8485

8586
bool headless_mode = true;
86-
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
87-
"external_control.urp");
87+
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR, NULL_VECTOR,
88+
headless_mode, "external_control.urp");
8889

8990
if (!g_my_robot->isHealthy())
9091
{

examples/freedrive_example.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ using namespace urcl;
5050
const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
5151
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
5252
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
53+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
5354

5455
std::unique_ptr<ExampleRobotWrapper> g_my_robot;
5556

@@ -82,8 +83,8 @@ int main(int argc, char* argv[])
8283

8384
bool headless_mode = true;
8485

85-
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
86-
"external_control.urp");
86+
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR, NULL_VECTOR,
87+
headless_mode, "external_control.urp");
8788

8889
if (!g_my_robot->isHealthy())
8990
{

examples/full_driver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
4444
const std::string SCRIPT_FILE = "resources/external_control.urscript";
4545
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
4646
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
47+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
4748

4849
std::unique_ptr<ExampleRobotWrapper> g_my_robot;
4950
vector6d_t g_joint_positions;
@@ -60,8 +61,8 @@ int main(int argc, char* argv[])
6061
}
6162

6263
bool headless_mode = true;
63-
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
64-
"external_control.urp");
64+
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR, NULL_VECTOR,
65+
headless_mode, "external_control.urp");
6566
if (!g_my_robot->isHealthy())
6667
{
6768
URCL_LOG_ERROR("Something in the robot initialization went wrong. Exiting. Please check the output above.");

examples/instruction_executor.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
4444
const std::string SCRIPT_FILE = "resources/external_control.urscript";
4545
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
4646
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
47+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
4748
const std::string CALIBRATION_CHECKSUM = "calib_12788084448423163542";
4849

4950
std::unique_ptr<urcl::ExampleRobotWrapper> g_my_robot;
@@ -59,8 +60,8 @@ int main(int argc, char* argv[])
5960
}
6061

6162
bool headless_mode = true;
62-
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
63-
"external_control.urp");
63+
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR,
64+
NULL_VECTOR, headless_mode, "external_control.urp");
6465
if (!g_my_robot->getUrDriver()->checkCalibration(CALIBRATION_CHECKSUM))
6566
{
6667
URCL_LOG_ERROR("Calibration checksum does not match actual robot.");
@@ -113,4 +114,4 @@ int main(int argc, char* argv[])
113114

114115
g_my_robot->getUrDriver()->stopControl();
115116
return 0;
116-
}
117+
}

examples/script_command_interface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
4141
const std::string SCRIPT_FILE = "resources/external_control.urscript";
4242
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
4343
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
44+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
4445

4546
std::unique_ptr<ExampleRobotWrapper> g_my_robot;
4647
bool g_HEADLESS = true;
@@ -103,8 +104,8 @@ int main(int argc, char* argv[])
103104
std::string(argv[3]) == "TRUE";
104105
}
105106

106-
g_my_robot =
107-
std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, g_HEADLESS, "external_control.urp");
107+
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR, NULL_VECTOR,
108+
g_HEADLESS, "external_control.urp");
108109

109110
if (!g_my_robot->isHealthy())
110111
{

examples/spline_example.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
4747
const std::string SCRIPT_FILE = "resources/external_control.urscript";
4848
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
4949
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
50+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
5051

5152
std::unique_ptr<ExampleRobotWrapper> g_my_robot;
5253
vector6d_t g_joint_positions;
@@ -123,8 +124,8 @@ int main(int argc, char* argv[])
123124
}
124125

125126
bool headless_mode = true;
126-
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
127-
"external_control.urp");
127+
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR, NULL_VECTOR,
128+
headless_mode, "external_control.urp");
128129
if (!g_my_robot->isHealthy())
129130
{
130131
URCL_LOG_ERROR("Something in the robot initialization went wrong. Exiting. Please check the output above.");

examples/tool_contact_example.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
4747
const std::string SCRIPT_FILE = "resources/external_control.urscript";
4848
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
4949
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
50+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
5051

5152
std::unique_ptr<ExampleRobotWrapper> g_my_robot;
5253
std::atomic<bool> g_tool_contact_result_triggered;
@@ -78,8 +79,8 @@ int main(int argc, char* argv[])
7879
}
7980

8081
bool headless_mode = true;
81-
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
82-
"external_control.urp");
82+
g_my_robot = std::make_unique<ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR, NULL_VECTOR,
83+
headless_mode, "external_control.urp");
8384
if (!g_my_robot->isHealthy())
8485
{
8586
URCL_LOG_ERROR("Something in the robot initialization went wrong. Exiting. Please check the output above.");

examples/trajectory_point_interface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const std::string DEFAULT_ROBOT_IP = "192.168.56.101";
4343
const std::string SCRIPT_FILE = "resources/external_control.urscript";
4444
const std::string OUTPUT_RECIPE = "examples/resources/rtde_output_recipe.txt";
4545
const std::string INPUT_RECIPE = "examples/resources/rtde_input_recipe.txt";
46+
const std::vector<std::string> NULL_VECTOR = std::vector<std::string>();
4647

4748
std::unique_ptr<urcl::ExampleRobotWrapper> g_my_robot;
4849
std::atomic<bool> g_trajectory_done = false;
@@ -64,8 +65,8 @@ int main(int argc, char* argv[])
6465
}
6566

6667
bool headless_mode = true;
67-
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, headless_mode,
68-
"external_control.urp");
68+
g_my_robot = std::make_unique<urcl::ExampleRobotWrapper>(robot_ip, OUTPUT_RECIPE, INPUT_RECIPE, NULL_VECTOR,
69+
NULL_VECTOR, headless_mode, "external_control.urp");
6970
if (!g_my_robot->isHealthy())
7071
{
7172
URCL_LOG_ERROR("Something in the robot initialization went wrong. Exiting. Please check the output above.");

0 commit comments

Comments
 (0)