0
$\begingroup$

Im getting an error for downloading the ur robot driver. its a line inside a c++ file causing the issue, i cant find the right command to use. Heres the error, please help!

/home/morgan/workspace/ros_ur_driver/src/Universal_Robots_ROS2_Driver/ur_robot_driver/src/hardware_interface.cpp: In member function ‘virtual hardware_interface::CallbackReturn ur_robot_driver::URPositionHardwareInterface::on_activate(const rclcpp_lifecycle::State&)’:
/home/morgan/workspace/ros_ur_driver/src/Universal_Robots_ROS2_Driver/ur_robot_driver/src/hardware_interface.cpp:432:35: error: invalid conversion from ‘const char*’ to ‘uint32_t’ {aka ‘unsigned int’} [-fpermissive]
  432 |     ur_driver_->setKeepaliveCount("keep_alive_count");
      |                                   ^~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   const char*
In file included from /home/morgan/workspace/ros_ur_driver/src/Universal_Robots_ROS2_Driver/ur_robot_driver/include/ur_robot_driver/hardware_interface.hpp:55,
                 from /home/morgan/workspace/ros_ur_driver/src/Universal_Robots_ROS2_Driver/ur_robot_driver/src/hardware_interface.cpp:50:
/opt/ros/humble/include/ur_client_library/ur/ur_driver.h:461:36: note:   initializing argument 1 of ‘void urcl::UrDriver::setKeepaliveCount(uint32_t)’
  461 |   setKeepaliveCount(const uint32_t count);
      |                     ~~~~~~~~~~~~~~~^~~~~
/home/morgan/workspace/ros_ur_driver/src/Universal_Robots_ROS2_Driver/ur_robot_driver/src/hardware_interface.cpp:432:34: warning: ‘void urcl::UrDriver::setKeepaliveCount(uint32_t)’ is deprecated: Set keepaliveCount is deprecated, instead set the robot receive timeout directly in the write commands. [-Wdeprecated-declarations]
  432 |     ur_driver_->setKeepaliveCount("keep_alive_count");
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /home/morgan/workspace/ros_ur_driver/src/Universal_Robots_ROS2_Driver/ur_robot_driver/include/ur_robot_driver/hardware_interface.hpp:55,
                 from /home/morgan/workspace/ros_ur_driver/src/Universal_Robots_ROS2_Driver/ur_robot_driver/src/hardware_interface.cpp:50:
/opt/ros/humble/include/ur_client_library/ur/ur_driver.h:461:3: note: declared here
  461 |   setKeepaliveCount(const uint32_t count);
      |   ^~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/ur_robot_driver_plugin.dir/build.make:90: CMakeFiles/ur_robot_driver_plugin.dir/src/hardware_interface.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:148: CMakeFiles/ur_robot_driver_plugin.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< ur_robot_driver [4.52s, exited with code 2]

$\endgroup$

1 Answer 1

0
$\begingroup$

It seems that this is not the latest version of humble branch.

The error message indicates that the input is a const char*, but if you look at this latest code, it is a const int variable defined in line 418.

Download the latest version from Gitchub should be able to resolve this issue.

$\endgroup$
2
  • $\begingroup$ That worked for the line 418, thank you! but for line 432, even with the latest github, the setkeepalivecount still is wrong, I still cant find the correct command for it $\endgroup$ Feb 21 at 19:29
  • $\begingroup$ Can you elaborate a bit about why it is still wrong? With the latest change, I assume the data type is now const int right? $\endgroup$
    – jc_sysu
    Feb 21 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.