UniversalRobots / Universal_Robots_ROS2_Driver

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

scaled_joint_trajectory_controller starts as inactive #1090

Closed pep248 closed 2 months ago

pep248 commented 2 months ago

Affected ROS2 Driver version(s)

latest

Used ROS distribution.

Humble

Which combination of platform is the ROS driver running on.

Ubuntu Linux with realtime patch

How is the UR ROS2 Driver installed.

From binary packets

Which robot platform is the driver connected to.

UR E-series robot

Robot SW / URSim version(s)

latest

How is the ROS driver used.

Through the robot teach pendant using External Control URCap

Issue details

Summary

scaled_joint_trajectory_controller starts as inactive

Issue details

i ran the following commands in two different windows: ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur10e robot_ip:=172.16.7.75 launch_rviz:=false ros2 launch ur_moveit_config ur_moveit.launch.py ur_type:=ur10e launch_rviz:=true

and, by default I was unable to move the robot using the rviz MotionPlanning interface.

Then, on a 3rd terminal, i ran the following command:

ros2 control list_controllers

and the output was the following:

io_and_status_controller[ur_controllers/GPIOController] active    
scaled_joint_trajectory_controller[ur_controllers/ScaledJointTrajectoryController] inactive  
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active    
forward_position_controller[position_controllers/JointGroupPositionController] inactive  
force_torque_sensor_broadcaster[force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster] active    
speed_scaling_state_broadcaster[ur_controllers/SpeedScalingStateBroadcaster] active

I don't know why said controller is automatically set to inactive.

if I manually set it to active, it works like a charm: ros2 control set_controller_state scaled_joint_trajectory_controller active but I don't want to be doing this by hand.

I will share the output of the controller launch.

Steps to Reproduce

I simply downloaded the ros-humble-ur-* packages and launched as described.

Expected Behavior

I expected the scaled_joint_trajectory_controller to start as "active"

Actual Behavior

The scaled_joint_trajectory_controller to start as "inactive"

Workaround Suggestion

ros2 control set_controller_state scaled_joint_trajectory_controller active

Relevant log output

ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur10e robot_ip:=172.16.7.75 launch_rviz:=false
[INFO] [launch]: All log files can be found below /root/.ros/log/2024-08-29-09-33-13-852673-IK-21310-1079-178
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [dashboard_client-2]: process started with pid [183]
[INFO] [controller_stopper_node-3]: process started with pid [185]
[INFO] [ur_ros2_control_node-1]: process started with pid [181]
[INFO] [urscript_interface-4]: process started with pid [187]
[INFO] [robot_state_publisher-5]: process started with pid [189]
[INFO] [spawner-6]: process started with pid [191]
[INFO] [spawner-7]: process started with pid [193]
[INFO] [spawner-8]: process started with pid [195]
[INFO] [spawner-9]: process started with pid [197]
[INFO] [spawner-10]: process started with pid [199]
[INFO] [spawner-11]: process started with pid [201]
[dashboard_client-2] [INFO] [1724923994.462498542] [UR_Client_Library:]: Connected: Universal Robots Dashboard Server
[dashboard_client-2] 
[controller_stopper_node-3] [INFO] [1724923994.463351962] [Controller stopper]: Waiting for switch controller service to come up on controller_manager/switch_controller
[ur_ros2_control_node-1] [WARN] [1724923994.488768061] [controller_manager]: [Deprecated] Passing the robot description parameter directly to the control_manager node is deprecated. Use '~/robot_description' topic from 'robot_state_publisher' instead.
[ur_ros2_control_node-1] text not specified in the tf_prefix tag
[ur_ros2_control_node-1] [INFO] [1724923994.489077497] [resource_manager]: Loading hardware 'ur10e' 
[ur_ros2_control_node-1] [INFO] [1724923994.492547272] [resource_manager]: Initialize hardware 'ur10e' 
[ur_ros2_control_node-1] [INFO] [1724923994.492594821] [resource_manager]: Successful initialization of hardware 'ur10e'
[ur_ros2_control_node-1] [INFO] [1724923994.492719874] [resource_manager]: 'configure' hardware 'ur10e' 
[ur_ros2_control_node-1] [INFO] [1724923994.492726747] [URPositionHardwareInterface]: Starting ...please wait...
[ur_ros2_control_node-1] [INFO] [1724923994.492739410] [URPositionHardwareInterface]: Initializing driver...
[ur_ros2_control_node-1] [WARN] [1724923994.493731609] [UR_Client_Library:]: Your system/user seems not to be setup for FIFO scheduling. We recommend using a lowlatency kernel with FIFO scheduling. See https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/master/ur_robot_driver/doc/real_time.md for details.
[robot_state_publisher-5] [INFO] [1724923994.507242655] [robot_state_publisher]: got segment base
[robot_state_publisher-5] [INFO] [1724923994.507330949] [robot_state_publisher]: got segment base_link
[robot_state_publisher-5] [INFO] [1724923994.507339255] [robot_state_publisher]: got segment base_link_inertia
[robot_state_publisher-5] [INFO] [1724923994.507344715] [robot_state_publisher]: got segment flange
[robot_state_publisher-5] [INFO] [1724923994.507349754] [robot_state_publisher]: got segment forearm_link
[robot_state_publisher-5] [INFO] [1724923994.507354733] [robot_state_publisher]: got segment ft_frame
[robot_state_publisher-5] [INFO] [1724923994.507359603] [robot_state_publisher]: got segment shoulder_link
[robot_state_publisher-5] [INFO] [1724923994.507364401] [robot_state_publisher]: got segment tool0
[robot_state_publisher-5] [INFO] [1724923994.507369281] [robot_state_publisher]: got segment upper_arm_link
[robot_state_publisher-5] [INFO] [1724923994.507374160] [robot_state_publisher]: got segment world
[robot_state_publisher-5] [INFO] [1724923994.507378748] [robot_state_publisher]: got segment wrist_1_link
[robot_state_publisher-5] [INFO] [1724923994.507383617] [robot_state_publisher]: got segment wrist_2_link
[robot_state_publisher-5] [INFO] [1724923994.507388386] [robot_state_publisher]: got segment wrist_3_link
[ur_ros2_control_node-1] [INFO] [1724923994.641421974] [UR_Client_Library:]: Negotiated RTDE protocol version to 2.
[ur_ros2_control_node-1] [INFO] [1724923994.641617940] [UR_Client_Library:]: Setting up RTDE communication with frequency 500.000000
[ur_ros2_control_node-1] [WARN] [1724923995.702574323] [UR_Client_Library:]: DEPRECATION NOTICE: Setting the keepalive count has been deprecated. Instead use the RobotReceiveTimeout, to set the timeout directly in the write commands. Please change your code to set the read timeout in the write commands directly. This keepalive count will overwrite the timeout passed to the write functions.
[ur_ros2_control_node-1] [WARN] [1724923995.702596615] [UR_Client_Library:]: DEPRECATION NOTICE: Setting the keepalive count has been deprecated. Instead you should set the timeout directly in the write commands. Please change your code to set the read timeout in the write commands directly. This keepalive count will overwrite the timeout passed to the write functions.
[ur_ros2_control_node-1] [INFO] [1724923995.702602235] [URPositionHardwareInterface]: Calibration checksum: 'calib_5119701370761913513'.
[ur_ros2_control_node-1] [ERROR] [1724923996.735330260] [URPositionHardwareInterface]: The calibration parameters of the connected robot don't match the ones from the given kinematics config file. Please be aware that this can lead to critical inaccuracies of tcp positions. Use the ur_calibration tool to extract the correct calibration from the robot and pass that into the description. See [https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/blob/main/ur_calibration/README.md] for details.
[ur_ros2_control_node-1] [INFO] [1724923996.735386625] [URPositionHardwareInterface]: System successfully started!
[ur_ros2_control_node-1] [INFO] [1724923996.735399369] [resource_manager]: Successful 'configure' of hardware 'ur10e'
[ur_ros2_control_node-1] [INFO] [1724923996.735419787] [resource_manager]: 'activate' hardware 'ur10e' 
[ur_ros2_control_node-1] [INFO] [1724923996.735423814] [URPositionHardwareInterface]: Activating HW interface
[ur_ros2_control_node-1] [INFO] [1724923996.735427091] [resource_manager]: Successful 'activate' of hardware 'ur10e'
[controller_stopper_node-3] [INFO] [1724923996.738764179] [Controller stopper]: Service available
[controller_stopper_node-3] [INFO] [1724923996.738783585] [Controller stopper]: Waiting for list controllers service to come up on controller_manager/list_controllers
[controller_stopper_node-3] [INFO] [1724923996.738793573] [Controller stopper]: Service available
[ur_ros2_control_node-1] [WARN] [1724923996.740583869] [controller_manager]: Could not enable FIFO RT scheduling policy
[ur_ros2_control_node-1] [WARN] [1724923996.740716567] [UR_Client_Library:]: Your system/user seems not to be setup for FIFO scheduling. We recommend using a lowlatency kernel with FIFO scheduling. See https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/master/ur_robot_driver/doc/real_time.md for details.
[ur_ros2_control_node-1] [INFO] [1724923996.765623136] [controller_manager]: Loading controller 'io_and_status_controller'
[spawner-8] [INFO] [1724923996.785364251] [spawner_io_and_status_controller]: Loaded io_and_status_controller
[ur_ros2_control_node-1] [INFO] [1724923996.785906882] [controller_manager]: Loading controller 'scaled_joint_trajectory_controller'
[ur_ros2_control_node-1] [WARN] [1724923996.792772485] [scaled_joint_trajectory_controller]: [Deprecated]: "allow_nonzero_velocity_at_trajectory_end" is set to true. The default behavior will change to false.
[spawner-6] [INFO] [1724923996.795604542] [spawner_scaled_joint_trajectory_controller]: Loaded scaled_joint_trajectory_controller
[ur_ros2_control_node-1] [INFO] [1724923996.796454896] [controller_manager]: Loading controller 'joint_state_broadcaster'
[ur_ros2_control_node-1] [INFO] [1724923996.805299727] [controller_manager]: Loading controller 'forward_position_controller'
[spawner-7] [INFO] [1724923996.805860983] [spawner_joint_state_broadcaster]: Loaded joint_state_broadcaster
[spawner-11] [INFO] [1724923996.815862670] [spawner_forward_position_controller]: Loaded forward_position_controller
[ur_ros2_control_node-1] [INFO] [1724923996.834363413] [controller_manager]: Loading controller 'force_torque_sensor_broadcaster'
[spawner-10] [INFO] [1724923996.843389442] [spawner_force_torque_sensor_broadcaster]: Loaded force_torque_sensor_broadcaster
[ur_ros2_control_node-1] [INFO] [1724923996.844984183] [controller_manager]: Loading controller 'speed_scaling_state_broadcaster'
[ur_ros2_control_node-1] [INFO] [1724923996.850075019] [speed_scaling_state_broadcaster]: Loading UR SpeedScalingStateBroadcaster with tf_prefix: 
[ur_ros2_control_node-1] [INFO] [1724923996.851045888] [controller_manager]: Configuring controller 'io_and_status_controller'
[spawner-9] [INFO] [1724923996.851439401] [spawner_speed_scaling_state_broadcaster]: Loaded speed_scaling_state_broadcaster
[ur_ros2_control_node-1] [INFO] [1724923996.853901930] [controller_manager]: Configuring controller 'scaled_joint_trajectory_controller'
[ur_ros2_control_node-1] [INFO] [1724923996.853987970] [scaled_joint_trajectory_controller]: No specific joint names are used for command interfaces. Using 'joints' parameter.
[ur_ros2_control_node-1] [INFO] [1724923996.854001145] [scaled_joint_trajectory_controller]: Command interfaces are [position] and state interfaces are [position velocity].
[ur_ros2_control_node-1] [INFO] [1724923996.854007877] [scaled_joint_trajectory_controller]: Using 'splines' interpolation method.
[ur_ros2_control_node-1] [INFO] [1724923996.856469714] [scaled_joint_trajectory_controller]: Controller state will be published at 100.00 Hz.
[ur_ros2_control_node-1] [INFO] [1724923996.860019028] [scaled_joint_trajectory_controller]: Action status changes will be monitored at 20.00 Hz.
[ur_ros2_control_node-1] [INFO] [1724923996.864997104] [controller_manager]: Configuring controller 'joint_state_broadcaster'
[ur_ros2_control_node-1] [INFO] [1724923996.865045334] [joint_state_broadcaster]: 'joints' or 'interfaces' parameter is empty. All available state interfaces will be published
[ur_ros2_control_node-1] [INFO] [1724923996.867232910] [controller_manager]: Configuring controller 'forward_position_controller'
[ur_ros2_control_node-1] [INFO] [1724923996.867892209] [forward_position_controller]: configure successful
[ur_ros2_control_node-1] [INFO] [1724923996.869152246] [controller_manager]: Configuring controller 'force_torque_sensor_broadcaster'
[ur_ros2_control_node-1] [INFO] [1724923996.871160008] [controller_manager]: Configuring controller 'speed_scaling_state_broadcaster'
[ur_ros2_control_node-1] [INFO] [1724923996.871195454] [speed_scaling_state_broadcaster]: Publisher rate set to : 100.0 Hz
[spawner-8] [INFO] [1724923996.885431360] [spawner_io_and_status_controller]: Configured and activated io_and_status_controller
[spawner-6] [INFO] [1724923996.889335615] [spawner_scaled_joint_trajectory_controller]: Configured and activated scaled_joint_trajectory_controller
[spawner-7] [INFO] [1724923996.893659342] [spawner_joint_state_broadcaster]: Configured and activated joint_state_broadcaster
[spawner-10] [INFO] [1724923996.897505679] [spawner_force_torque_sensor_broadcaster]: Configured and activated force_torque_sensor_broadcaster
[spawner-9] [INFO] [1724923996.901391720] [spawner_speed_scaling_state_broadcaster]: Configured and activated speed_scaling_state_broadcaster
[INFO] [spawner-11]: process has finished cleanly [pid 201]
[INFO] [spawner-8]: process has finished cleanly [pid 195]
[INFO] [spawner-6]: process has finished cleanly [pid 191]
[INFO] [spawner-9]: process has finished cleanly [pid 197]
[INFO] [spawner-7]: process has finished cleanly [pid 193]
[INFO] [spawner-10]: process has finished cleanly [pid 199]

Accept Public visibility

VinDp commented 2 months ago

Hey @pep248, do you start the External Control program on the robot? Because without that the controller will stay inactive. If you want, you can start it also from the terminal, using the headless_mode option: ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur10e robot_ip:=172.16.7.75 launch_rviz:=false headless_mode:=true

For further reference: you can also find the step in our documentation .

pep248 commented 2 months ago

Thanks a lot! That did the trick!