PickNikRobotics / abb_ros2

Apache License 2.0
82 stars 34 forks source link

Controller manager not available #68

Closed joedavid-tuni closed 2 months ago

joedavid-tuni commented 4 months ago

While working with a real irc5 controller, with ros humble on Ubuntu 22.04, I get the following error

ros2 launch abb_bringup abb_control.launch.py description_package:=abb_irb4600_support description_file:=irb4600_40_255.xacro launch_rviz:=false use_fake_hardware:=false rws_ip:=192.168.125.1
[INFO] [launch]: All log files can be found below /home/joe/.ros/log/2024-05-14-19-48-35-357869-Joes-Laptop-11653
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [ros2_control_node-1]: process started with pid [11656]
[INFO] [robot_state_publisher-2]: process started with pid [11658]
[INFO] [spawner-3]: process started with pid [11660]
[INFO] [spawner-4]: process started with pid [11662]
[robot_state_publisher-2] [INFO] [1715705316.022090081] [robot_state_publisher]: got segment base
[robot_state_publisher-2] [INFO] [1715705316.022208014] [robot_state_publisher]: got segment base_link
[robot_state_publisher-2] [INFO] [1715705316.022231582] [robot_state_publisher]: got segment flange
[robot_state_publisher-2] [INFO] [1715705316.022247671] [robot_state_publisher]: got segment link_1
[robot_state_publisher-2] [INFO] [1715705316.022262872] [robot_state_publisher]: got segment link_2
[robot_state_publisher-2] [INFO] [1715705316.022278014] [robot_state_publisher]: got segment link_3
[robot_state_publisher-2] [INFO] [1715705316.022292829] [robot_state_publisher]: got segment link_4
[robot_state_publisher-2] [INFO] [1715705316.022307619] [robot_state_publisher]: got segment link_5
[robot_state_publisher-2] [INFO] [1715705316.022322419] [robot_state_publisher]: got segment link_6
[robot_state_publisher-2] [INFO] [1715705316.022337230] [robot_state_publisher]: got segment tool0
[ros2_control_node-1] [WARN] [1715705316.059856176] [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.
[ros2_control_node-1] [INFO] [1715705316.060123085] [resource_manager]: Loading hardware 'ABBMultiInterfaceHardware' 
[ros2_control_node-1] [INFO] [1715705316.071688895] [resource_manager]: Initialize hardware 'ABBMultiInterfaceHardware' 
[ros2_control_node-1] [INFO] [1715705316.238318865] [ABBSystemHardware]: Robot controller description:
[ros2_control_node-1] ============================================================
[ros2_control_node-1] = Summary of robot controller at '192.168.125.1:80'
[ros2_control_node-1] ============================================================
[ros2_control_node-1] # General Information:
[ros2_control_node-1]   |- RobotWare version: 6.14.01.00
[ros2_control_node-1]   |- System name: 4600-103339-KemppiAX
[ros2_control_node-1]   |- System type: Real Controller
[ros2_control_node-1]   |- Options:
[ros2_control_node-1]      |- UDPUC Driver
[ros2_control_node-1]      |- 651-2 Two Additional Arc Systems
[ros2_control_node-1]      |- 652-1 BullsEye
[ros2_control_node-1]      |- 659-1 Production Monitoring
[ros2_control_node-1]      |- 653-3 ABB TSC 2013
[ros2_control_node-1]      |- DeviceNet
[ros2_control_node-1]      |- 812-1 Production Manager
[ros2_control_node-1]      |- English
[ros2_control_node-1]      |- 603-1 Absolute Accuracy
[ros2_control_node-1]      |- 624-1 Continuous Application Platform
[ros2_control_node-1]      |- 613-1 Collision Detection
[ros2_control_node-1]      |- 709-1 DeviceNet Master/Slave
[ros2_control_node-1]      |- 841-1 EtherNet/IP Scanner/Adapter
[ros2_control_node-1]      |- 689-1 Externally Guided Motion (EGM)
[ros2_control_node-1]      |- 617-1 FlexPendant Interface
[ros2_control_node-1]      |- 614-1 FTP SFTP and NFS client
[ros2_control_node-1]      |- 610-1 Independent Axis
[ros2_control_node-1]      |- 623-1 Multitasking
[ros2_control_node-1]      |- 612-1 Path Offset
[ros2_control_node-1]      |- 611-1 Path Recovery
[ros2_control_node-1]      |- 616-1 PC Interface
[ros2_control_node-1]      |- 688-1 RobotStudio App Connect
[ros2_control_node-1]      |- 628-1 Sensor Interface
[ros2_control_node-1]      |- 608-1 World Zones
[ros2_control_node-1]      |- RobotWare Base
[ros2_control_node-1]      |- Axis Calibration
[ros2_control_node-1]      |- Pendelum Calibration
[ros2_control_node-1]      |- Motor Commutation
[ros2_control_node-1]      |- Service Info System
[ros2_control_node-1]      |- 633-4 Arc
[ros2_control_node-1]      |- RW Add-In loaded Welder
[ros2_control_node-1]      |- 657-1 SmarTac IO version
[ros2_control_node-1]      |- Drive System IRB 460/640/660/760/4600/66xx/6700
[ros2_control_node-1]      |- ADU-790A in position X3
[ros2_control_node-1]      |- ADU-790A in position Y3
[ros2_control_node-1]      |- 810-2 SafeMove
[ros2_control_node-1]      |- IRB 4600-40/2.55 Type C
[ros2_control_node-1]      |- IRBP A750 D1450 Type A
[ros2_control_node-1]      |- Ethernet IP
[ros2_control_node-1]      |- Install Power Supply
[ros2_control_node-1]      |- Include SmarTac Config
[ros2_control_node-1]      |- Install  SeamTracking Option
[ros2_control_node-1]      |- Install Multipass instructions
[ros2_control_node-1]      |- StateMachine Core
[ros2_control_node-1] 
[ros2_control_node-1] # Mechanical Units:
[ros2_control_node-1]   |- Unit: ROB_1
[ros2_control_node-1]   |- Unit: STN1 (currently deactivated)
[ros2_control_node-1] 
[ros2_control_node-1] # Mechanical Unit Groups:
[ros2_control_node-1]   |- N/A (only for MultiMove systems)
[ros2_control_node-1] ============================================================
[ros2_control_node-1] [INFO] [1715705316.238406683] [ABBSystemHardware]: Configuring EGM interface...
[ros2_control_node-1] [INFO] [1715705316.238652377] [ABBSystemHardware]: Configuring EGM for mechanical unit group  on port 6511
[ros2_control_node-1] [INFO] [1715705316.244493526] [resource_manager]: Successful initialization of hardware 'ABBMultiInterfaceHardware'
[ros2_control_node-1] [INFO] [1715705316.244897536] [resource_manager]: 'configure' hardware 'ABBMultiInterfaceHardware' 
[ros2_control_node-1] [INFO] [1715705316.244922074] [resource_manager]: Successful 'configure' of hardware 'ABBMultiInterfaceHardware'
[ros2_control_node-1] [WARN] [1715705316.244943580] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_1/position' state interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [WARN] [1715705316.244958447] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_1/velocity' state interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [WARN] [1715705316.244970284] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_2/position' state interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [WARN] [1715705316.244982119] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_2/velocity' state interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [WARN] [1715705316.245000686] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_1/position' command interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [WARN] [1715705316.245012713] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_1/velocity' command interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [WARN] [1715705316.245052107] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_2/position' command interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [WARN] [1715705316.245066051] [resource_manager]: (hardware 'ABBMultiInterfaceHardware'): 'joint_2/velocity' command interface already in available list. This can happen due to multiple calls to 'configure'
[ros2_control_node-1] [INFO] [1715705316.245078506] [resource_manager]: 'activate' hardware 'ABBMultiInterfaceHardware' 
[ros2_control_node-1] [INFO] [1715705316.245092097] [ABBSystemHardware]: Connecting to robot...
[ros2_control_node-1] [INFO] [1715705316.745365966] [ABBSystemHardware]: Not connected to robot...
[ros2_control_node-1] [INFO] [1715705317.746023071] [ABBSystemHardware]: Not connected to robot...
[spawner-3] [INFO] [1715705318.461879111] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1715705318.487614200] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available
[ros2_control_node-1] [INFO] [1715705318.746351446] [ABBSystemHardware]: Not connected to robot...
[ros2_control_node-1] [INFO] [1715705319.746838288] [ABBSystemHardware]: Not connected to robot...
[spawner-3] [INFO] [1715705320.472841084] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1715705320.498031594] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available
[ros2_control_node-1] [INFO] [1715705320.747615711] [ABBSystemHardware]: Not connected to robot...
[ros2_control_node-1] [INFO] [1715705321.747956034] [ABBSystemHardware]: Not connected to robot...
[spawner-3] [INFO] [1715705322.482740694] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1715705322.509417691] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available
[ros2_control_node-1] [INFO] [1715705322.748393005] [ABBSystemHardware]: Not connected to robot...
[ros2_control_node-1] [INFO] [1715705323.749031318] [ABBSystemHardware]: Not connected to robot...
[spawner-3] [INFO] [1715705324.494107915] [spawner_joint_state_broadcaster]: Waiting for '/controller_manager' services to be available
[spawner-4] [INFO] [1715705324.520241105] [spawner_joint_trajectory_controller]: Waiting for '/controller_manager' services to be available
[ros2_control_node-1] [INFO] [1715705324.749396701] [ABBSystemHardware]: Not connected to robot...
[ros2_control_node-1] [INFO] [1715705325.749766848] [ABBSystemHardware]: Not connected to robot...
[spawner-3] [ERROR] [1715705326.504605452] [spawner_joint_state_broadcaster]: Controller manager not available
[spawner-4] [ERROR] [1715705326.530829622] [spawner_joint_trajectory_controller]: Controller manager not available
[ERROR] [spawner-3]: process has died [pid 11660, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager /controller_manager --ros-args'].
[ERROR] [spawner-4]: process has died [pid 11662, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_trajectory_controller -c /controller_manager --ros-args'].
[ros2_control_node-1] [INFO] [1715705326.750339597] [ABBSystemHardware]: Not connected to robot...
[ros2_control_node-1] [INFO] [1715705327.750905300] [ABBSystemHardware]: Not connected to robot...
SagarJoshi73249 commented 2 months ago

Did you get this working?

joedavid-tuni commented 2 months ago

Yes, I did. This happened because the RAPID program didn't setup the egm correctly from the controller end when I used the bloated code from the state machine add-in. I wrote a minimal code with the help of the abb egm manual and it worked well.

SagarJoshi73249 commented 2 months ago

Okay got it. I am currently facing the same issue, do you mind sharing the code please, would be a huge help. Thanks for answering!

SagarJoshi73249 commented 2 months ago

I figured it out myself, thanks!

Yadunund commented 2 months ago

@SagarJoshi73249 you should share your solution here so that other people who run into the issue later can benefit from your fix.

SyZbidi commented 2 months ago

@SagarJoshi73249 @joedavid-tuni Hey, could one of you post a solution so that just like @Yadunund said we all benefit from your fix?

joedavid-tuni commented 2 months ago

I am on holidays since a month and I don't have access to my computer. I can put my code here in a week if nobody else does it sooner. Please feel free to remind me then if I haven't done so.

gavanderhoorn commented 1 month ago

I've looked into this together with @SyZbidi.

For those of you trying to use this driver with the State Machine add-in that was used with abb_robot_driver (ie: the ROS 1 version), the issue is that the README of abb_ros2 doesn't document the fact you need to instruct the State Machine add-in to start an EGM session for you.

If you don't, it will simply just sit there, idling away.

This will cause ABBSystemHardware to keep waiting on an EGM connection from the ABB controller (here), while the ABB controller / State Machine keeps waiting for 'someone' or 'something' to ask it to start an EGM session. Basically a catch 22 (both sides waiting on each other).

In the ROS 1 version of the driver, you'd use the services offered by the abb_rws_service_provider to coordinate the State Machine add-in. Specifically, you'd call start_egm_joint service which would instruct the State Machine to (in the end) activate the EGM session, causing it to try to connect to the UDP port the driver is listening on.

Technically this is of course not dependant on the State Machine add-in, and I assume the maintainers/developers of abb_ros2 instead used a 'simple' RAPID program which just configures and starts an EGM session directly (this one fi). For that to work, you need to make sure to start that on the ABB controller after you've started the ABBSystemHardware, and you can't use the State Machine add-in (nor the abb_rws_service_provider).

So tl;dr:

Regardless of whether you use the State Machine add-in or not, after starting the EGM session (and assuming all other configuration on the ABB controller and on the abb_ros2 side is correct) you should see ABBSystemHardware reporting:

https://github.com/PickNikRobotics/abb_ros2/blob/42b3209017257a3d4e37d5d963727aca928f5ac3/abb_hardware_interface/src/abb_hardware_interface.cpp#L281

(note that even if it didn't successfully connected, it still printed that for me/us, so I'm not sure how reliable those log lines are)

At this point the Controller Manager should also be available and it should be able to spawn controllers.


In both cases you'll probably need to update the EGM settings, as otherwise maximum motion speed will be very low (1 deg/s IIRC) and it will appear the robot is not moving at all. Maximum convergence time might also be something to change, as it will make EGM sessions time-out relatively quickly.

With the State Machine add-in, you can do that using /rws_client/get_egm_settings and /rws_client/set_egm_settings.

If you're using a stand-alone RAPID program, you'll likely have to configure EGM using RobotStudio, or as part of the RAPID program.

For the ROS 1 driver, you could automate all this using something like sam-xl/abb_robot_driver_state_machine. Unfortunately this isn't compatible with abb_ros2.


Finally:

@joedavid-tuni wrote:

This happened because the RAPID program didn't setup the egm correctly from the controller end when I used the bloated code from the state machine add-in. I wrote a minimal code with the help of the abb egm manual and it worked well.

I don't dismiss your experience, but AFAICT, there's nothing wrong with the State Machine add-in, and it's definitely usable with abb_ros2. It might be bloated compared to the (very minimal) .mod provided here in this repository, but it also offers much more functionality (such as retrieving and updating EGM settings).

What you just need to remember is to start the RWS client and use the appropriate services to coordinate the State Machine in order for it to 'play nice' with abb_ros2.

You absolutely don't have to use the State Machine add-in of course.