UniversalRobots / Universal_Robots_ROS2_Driver

Universal Robots ROS2 driver supporting CB3 and e-Series
BSD 3-Clause "New" or "Revised" License
439 stars 229 forks source link

source build fails - ur_controllers #938

Closed Rudresh172 closed 9 months ago

Rudresh172 commented 9 months ago

Affected ROS2 Driver version(s)

2.4.3

Used ROS distribution.

Humble

Which combination of platform is the ROS driver running on.

Ubuntu Linux with standard kernel

How is the UR ROS2 Driver installed.

Build both the ROS driver and UR Client Library from source

Which robot platform is the driver connected to.

Real robot

Robot SW / URSim version(s)

5.12.0 / 5.12.2 / 5.14.6

How is the ROS driver used.

Through the robot teach pendant using External Control URCap

Issue details

Summary

Source build of the ur_robot_driver fails

Issue details

The warning states some packages are already built in the underlay, but when I uninstall all the packages and run rosdep install --ignore-src --from-paths src -y it downloads those packages again

Steps to Reproduce

git clone https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver.git src/Universal_Robots_ROS2_Driver
vcs import src --skip-existing --input src/Universal_Robots_ROS2_Driver/Universal_Robots_ROS2_Driver-not-released.${ROS_DISTRO}.repos
rosdep update
rosdep install --ignore-src --from-paths src -y
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

P.S. I AM UNABLE TO POST THE WHOLE LOG BECAUSE OF MAXIMUM CHARACTERS LIMIT ISSUE

Relevant log output

colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
[1.171s] colcon.colcon_core.package_selection WARNING Some selected packages are already built in one or more underlay workspaces:
    'gripper_controllers' is in: /opt/ros/humble
    'control_msgs' is in: /opt/ros/humble
    'joint_state_broadcaster' is in: /opt/ros/humble
    'joint_trajectory_controller' is in: /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
    --allow-overriding control_msgs gripper_controllers joint_state_broadcaster joint_trajectory_controller

This may be promoted to an error in a future release of colcon-override-check.
Starting >>> control_msgs
.
.
.
.
.
.
Finished <<< ros2_control [31.6s]             
Finished <<< mir_robot [1.31s]                
Finished <<< forward_command_controller [38.5s]
Starting >>> position_controllers            
Starting >>> velocity_controllers
Starting >>> effort_controllers
Finished <<< range_sensor_broadcaster [40.4s] 
Finished <<< imu_sensor_broadcaster [40.6s]   
Finished <<< force_torque_sensor_broadcaster [41.1s]
Finished <<< tricycle_controller [47.1s]     
Finished <<< steering_controllers_library [48.6s]
Starting >>> ackermann_steering_controller
Starting >>> bicycle_steering_controller     
Starting >>> tricycle_steering_controller
Finished <<< joint_state_broadcaster [48.8s] 
Finished <<< diff_drive_controller [50.2s]   
Finished <<< position_controllers [21.5s]    
Finished <<< effort_controllers [22.5s]      
Finished <<< velocity_controllers [22.9s]    
Finished <<< joint_trajectory_controller [1min 9s]
Starting >>> ur_controllers
Starting >>> admittance_controller
Finished <<< ackermann_steering_controller [25.1s]
Finished <<< tricycle_steering_controller [26.9s]
Finished <<< bicycle_steering_controller [27.2s]
--- stderr: ur_controllers                                                     
/home/not_windows/Downloads/relffok_mir/src/Universal_Robots_ROS2_Driver/ur_controllers/src/scaled_joint_trajectory_controller.cpp: In member function ‘virtual controller_interface::return_type ur_controllers::ScaledJointTrajectoryController::update(const rclcpp::Time&, const rclcpp::Duration&)’:
/home/not_windows/Downloads/relffok_mir/src/Universal_Robots_ROS2_Driver/ur_controllers/src/scaled_joint_trajectory_controller.cpp:319:16: error: no matching function for call to ‘ur_controllers::ScaledJointTrajectoryController::publish_state(const rclcpp::Time&, trajectory_msgs::msg::JointTrajectoryPoint&, trajectory_msgs::msg::JointTrajectoryPoint&, trajectory_msgs::msg::JointTrajectoryPoint&)’
  319 |   publish_state(time, state_desired_, state_current_, state_error_);
      |   ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/not_windows/Downloads/relffok_mir/src/Universal_Robots_ROS2_Driver/ur_controllers/include/ur_controllers/scaled_joint_trajectory_controller.hpp:41,
                 from /home/not_windows/Downloads/relffok_mir/src/Universal_Robots_ROS2_Driver/ur_controllers/src/scaled_joint_trajectory_controller.cpp:41:
/home/not_windows/Downloads/relffok_mir/install/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller/joint_trajectory_controller.hpp:260:8: note: candidate: ‘void joint_trajectory_controller::JointTrajectoryController::publish_state(const JointTrajectoryPoint&, const JointTrajectoryPoint&, const JointTrajectoryPoint&)’
  260 |   void publish_state(
      |        ^~~~~~~~~~~~~
/home/not_windows/Downloads/relffok_mir/install/joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller/joint_trajectory_controller.hpp:260:8: note:   candidate expects 3 arguments, 4 provided
gmake[2]: *** [CMakeFiles/ur_controllers.dir/build.make:76: CMakeFiles/ur_controllers.dir/src/scaled_joint_trajectory_controller.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:223: CMakeFiles/ur_controllers.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< ur_controllers [11.6s, exited with code 2]
Aborted  <<< admittance_controller [35.1s]  

Summary: 51 packages finished [3min 33s]
  1 package failed: ur_controllers
  1 package aborted: admittance_controller
  20 packages had stderr output: control_msgs controller_manager controller_manager_msgs ira_laser_tools joint_limits mir_description mir_driver mir_gazebo mir_msgs mir_restapi ros2_controllers_test_nodes ros2_laser_scan_merger ros2controlcli rqt_controller_manager rqt_joint_trajectory_controller twist_stamper ur_client_library ur_controllers ur_dashboard_msgs ur_msgs
  4 packages not processed

Accept Public visibility

Rudresh172 commented 9 months ago

I realised that I had been following instructions for the latest build and not humble. After following humble specific instructions, I still had errors with ur_controllers. I reinstalled ROS and then attempted the humble instructions again. Now the issue is solved!