-
Notifications
You must be signed in to change notification settings - Fork 72
/
KukaLBRiiwaVrepPluginTest.cpp
64 lines (55 loc) · 3.02 KB
/
KukaLBRiiwaVrepPluginTest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE grlTest
// system includes
#include <boost/test/unit_test.hpp>
#include <exception>
#include <boost/math/constants/constants.hpp>
#include <iostream>
#include <vector>
//// local includes
#include "grl/vrep/KukaLBRiiwaVrepPlugin.hpp"
BOOST_AUTO_TEST_SUITE(KukaLBRiiwaVrepPluginTest)
BOOST_AUTO_TEST_CASE(initialization){
auto plugin = std::make_shared<grl::vrep::KukaVrepPlugin>();
//BOOST_CHECK_THROW (std::make_shared<grl::KukaVrepPlugin>(),boost::exception);
// plugin->construct() // shouldn't work, because vrep isn't around to get handles
//// uncomment to test error output
// try {
// BOOST_LOG_TRIVIAL(info) << "Starting KUKA LBR iiwa plugin connection to Kuka iiwa\n";
// auto kukaPluginPG = std::make_shared<grl::KukaVrepPlugin>();
// kukaPluginPG->construct();
// } catch (boost::exception& e){
// // log the error and print it to the screen, don't release the exception
// BOOST_LOG_TRIVIAL(error) << boost::diagnostic_information(e);
// }
}
BOOST_AUTO_TEST_CASE(connectToFake){
std::vector<std::string> jointHandles;
jointHandles.push_back("LBR_iiwa_14_R820_joint1"); // Joint1Handle,
jointHandles.push_back("LBR_iiwa_14_R820_joint2"); // Joint2Handle,
jointHandles.push_back("LBR_iiwa_14_R820_joint3"); // Joint3Handle,
jointHandles.push_back("LBR_iiwa_14_R820_joint4"); // Joint4Handle,
jointHandles.push_back("LBR_iiwa_14_R820_joint5"); // Joint5Handle,
jointHandles.push_back("LBR_iiwa_14_R820_joint6"); // Joint6Handle,
jointHandles.push_back("LBR_iiwa_14_R820_joint7"); // Joint7Handle,
auto config = std::make_tuple(
jointHandles , // JointHandles,
"RobotFlangeTip" , // RobotFlangeTipHandle,
"RobotMillTip" , // RobotTipHandle,
"RobotMillTipTarget" , // RobotTargetHandle,
"Robotiiwa" , // RobotTargetBaseHandle,
"KUKA_LBR_IIWA_14_R820" , // RobotModel (options are KUKA_LBR_IIWA_14_R820, KUKA_LBR_IIWA_7_R800)
"tcp://0.0.0.0" , // LocalUDPAddress
"30010" , // LocalUDPPort
"172.31.1.147" , // RemoteUDPAddress
"192.170.10.100" , // LocalHostKukaKoniUDPAddress,
"30200" , // LocalHostKukaKoniUDPPort,
"192.170.10.2" , // RemoteHostKukaKoniUDPAddress,
"30200" , // RemoteHostKukaKoniUDPPort
"JAVA" , // KukaCommandMode (options are FRI, JAVA)
"FRI" , // KukaMonitorMode (options are FRI, JAVA)
"IK_Group1_iiwa" // IKGroupName
);
auto plugin = std::make_shared<grl::vrep::KukaVrepPlugin>(config);
}
BOOST_AUTO_TEST_SUITE_END()