visp
visp copied to clipboard
error connecting with UR10e robotundefined symbol: _ZNK22vpRobotUniversalRobots12getRobotModeEv
Hello! I have followed the tutorial on https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-calibration-extrinsic.html
But when I launch the file ./testUniversalRobotsGetData --ip <my robot ip > I get the following error:
./testUniversalRobotsGetData: symbol lookup error: ./testUniversalRobotsGetData: undefined symbol: _ZNK22vpRobotUniversalRobots12getRobotModeEv
I am running the files on an ubuntu22.04 machine and I have installed and built visp from source. Any ideas would be very helpful?
You can launch ldd ./testUniversalRobotsGetData and see which is the libvisp_robot.so library that is used.
One possible reason is that you have multiple ViSP libraries installed and the one that is used isn't build with ur_rtde 3rd party. To check that, run:
$ sudo updatedb
$ locate libvisp_robot.so
PS: Run sudo apt install locate if updatedb is unknown.
Hello @fspindle, thanks! I have visp-ros installed as well.. I'm not sure if that is the issue. Here is what I find when I execute locate libvisp_robot.so
Here's what I have when I run ldd ./testUniversalRobotsGetData
I guess I made a listake with my setup, however, I had followed the instructions to build my visp_ws from source (as it said to do so to work with real robot) and prior to that I had installed visp-ros and visp_vision but these folders are in my ros2 workspace.
Could you tell me how to solve this issue?
[EDIT] : I solved the issue by re-building the visp-ws by running cmake -DCMAKE_INSTALL_PREFIX=/opt/ros/$ROS_DISTRO ../visp But I would still like to know how you suggest to organise the different folders and libraries to avoid this kindo fissue in the future.
Also I run into another error :
I have a gripper at the end of my UR robot. Do I have to change any default parameters of the code somewhere ?
To use ViSP enabled to use specific 3rd parties linked to hardware (like librealsense, ur_rtde, libfranka, complete list) and ros, I suggest to build everything from source (all the 3rd parties first like librealsense, ur_rtde, libfranka, then visp, then vision_visp and finally visp_ros).
The good way is:
- to check if
ros-$ROS_DISTRO-vispandros-$ROS_DISTRO-vision-vispbinary packages are installed. If so, remove them - to build ViSP from source as you did. Note:
sudo make installin/opt/ros/$ROS_DISTROor in/usris optional- without
make installyou can setVISP_DIRenv var to point simply to VISP build folder - when ViSP is not found by a cmake project, just set
VISP_DIRenv var and relaunch a cmake configuration on your project
- to build and install
vision_vispfrom source (https://github.com/lagadic/vision_visp rolling branch for ros2) - to build and install
visp_rosfrom source (https://github.com/lagadic/visp_ros rolling branch for ros2)
Concerning testUniversalRobotsGetData.cpp that fails around line 134 a possible reason is that the robot moves a little bit between line 119 and line 132.
This can be checked retrieving the joint positions before these 2 lines to see if the robot has moved
robot.getPosition(vpRobot::JOINT_STATE, q);
std::cout << "Joint position before fMe_2 [deg]: " << q.rad2deg().t() << std::endl;
vpHomogeneousMatrix fMe_2 = robot.get_fMe();
std::cout << "fMe pose matrix: \n" << fMe_2 << std::endl;
for (size_t i = 0; i < fMe_2.size(); i++) {
if (!vpMath::equal(fMe_1.data[i], fMe_2.data[i])) {
std::cout << "Wrong end-effector pose returned by get_fMe(). Test failed" << std::endl;
return EXIT_FAILURE;
}
}
if (robot.getRobotMode() == 7) {
robot.getPosition(vpRobot::JOINT_STATE, q);
std::cout << "Joint position before fMe_3 [deg]: " << q.rad2deg().t() << std::endl;
vpHomogeneousMatrix fMe_3 = robot.get_fMe(q_init);
std::cout << "fMe pose matrix: \n" << fMe_3 << std::endl;
for (size_t i = 0; i < fMe_3.size(); i++) {
if (!vpMath::equal(fMe_2.data[i], fMe_3.data[i])) {
std::cout << "Wrong end-effector forward kinematics . Test failed" << std::endl;
return EXIT_FAILURE;
}
}
}
Concerning
testUniversalRobotsGetData.cppthat fails around line 134 a possible reason is that the robot moves a little bit between line 119 and line 132.This can be checked retrieving the joint positions before these 2 lines to see if the robot has moved
robot.getPosition(vpRobot::JOINT_STATE, q); std::cout << "Joint position before fMe_2 [deg]: " << q.rad2deg().t() << std::endl; vpHomogeneousMatrix fMe_2 = robot.get_fMe(); std::cout << "fMe pose matrix: \n" << fMe_2 << std::endl; for (size_t i = 0; i < fMe_2.size(); i++) { if (!vpMath::equal(fMe_1.data[i], fMe_2.data[i])) { std::cout << "Wrong end-effector pose returned by get_fMe(). Test failed" << std::endl; return EXIT_FAILURE; } } if (robot.getRobotMode() == 7) { robot.getPosition(vpRobot::JOINT_STATE, q); std::cout << "Joint position before fMe_3 [deg]: " << q.rad2deg().t() << std::endl; vpHomogeneousMatrix fMe_3 = robot.get_fMe(q_init); std::cout << "fMe pose matrix: \n" << fMe_3 << std::endl; for (size_t i = 0; i < fMe_3.size(); i++) { if (!vpMath::equal(fMe_2.data[i], fMe_3.data[i])) { std::cout << "Wrong end-effector forward kinematics . Test failed" << std::endl; return EXIT_FAILURE; } } }
Thanks a lot @fspindle for your help! The robot does move a bit after the breaks are turned off and the robot starts properly. So I run the code after the robot has started. It seems now there is no movement in the robot and I still have the same error :
I do notice that the fMe pose matrix is a bit different but since the robot is not physically moving I am not sure where this is coming from?
Concerning
testUniversalRobotsGetData.cppthat fails around line 134 a possible reason is that the robot moves a little bit between line 119 and line 132. This can be checked retrieving the joint positions before these 2 lines to see if the robot has movedrobot.getPosition(vpRobot::JOINT_STATE, q); std::cout << "Joint position before fMe_2 [deg]: " << q.rad2deg().t() << std::endl; vpHomogeneousMatrix fMe_2 = robot.get_fMe(); std::cout << "fMe pose matrix: \n" << fMe_2 << std::endl; for (size_t i = 0; i < fMe_2.size(); i++) { if (!vpMath::equal(fMe_1.data[i], fMe_2.data[i])) { std::cout << "Wrong end-effector pose returned by get_fMe(). Test failed" << std::endl; return EXIT_FAILURE; } } if (robot.getRobotMode() == 7) { robot.getPosition(vpRobot::JOINT_STATE, q); std::cout << "Joint position before fMe_3 [deg]: " << q.rad2deg().t() << std::endl; vpHomogeneousMatrix fMe_3 = robot.get_fMe(q_init); std::cout << "fMe pose matrix: \n" << fMe_3 << std::endl; for (size_t i = 0; i < fMe_3.size(); i++) { if (!vpMath::equal(fMe_2.data[i], fMe_3.data[i])) { std::cout << "Wrong end-effector forward kinematics . Test failed" << std::endl; return EXIT_FAILURE; } } }Thanks a lot @fspindle for your help! The robot does move a bit after the breaks are turned off and the robot starts properly. So I run the code after the robot has started. It seems now there is no movement in the robot and I still have the same error :
I do notice that the fMe pose matrix is a bit different but since the robot is not physically moving I am not sure where this is coming from?
Hello @fspindle , I think the error could due to the TCP, from what I understand the kinematic information of the robot is extracted from the UR robot directly therefore the defined TCP on the robot information is communicated to visp. Am I right ? Is there any way that the program does not get access to this information and therefore calculated the kinematics from the tool flange? Am I supposed to change/provide this information in the code or any of the config files in urtde client?
Thanks a lot!
I do notice that the fMe pose matrix is a bit different but since the robot is not physically moving I am not sure where this is coming from?