cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

ROS2 Foxy Snap - Performance issue

Thomas_SF
Member

ROS2 Foxy Snap - Performance issue

Hi together,
I have developed a ROS2 snap with included UR driver and Datalayer interface for the ctrlX Core and installed it on the controller successfully.

When I trigger the command to start ROS2 and connect to the robot, everything works fine at the beginning. After the UR driver has been initialised and ROS is ready, I start the robot's External Control program with the configured ctrlX-IP and the robot connects to ROS successfully:

 

[ros2_control_node-1] [INFO] [UR_Client_Library]: Robot connected to reverse interface. Ready to receive control commands.

 

However, the connection breaks off again after a few seconds:

 

[ros2_control_node-1] [INFO] [UR_Client_Library]: Connection to reverse interface dropped.

 

In my experience, this problem occurs when ROS does not have enough computing power.

In addition, I noticed the following message by starting ROS2 on the control:

 

[ros2_control_node-1] [WARN] [UR_Client_Library]: No realtime capabilities found. Consider using a realtime system for better performance

 

As far as I know the ctrlX Core is realtime capable.


Question:
Is there a possibility to provide more
computing power to my snap or to increase the priority of the process, or is the computing power of the controller not sufficient?
Is it possible to achieve realtime capabilities with a custom snap ?


Hardware:

  • ctrlX-Core with Ubuntu 20.04
  • UniversalRobot CB3

Thanks in advance

5 REPLIES 5
CodeShepherd
Community Moderator

Re: ROS2 Foxy Snap - Performance issue

Our system is Ubuntu Core20 with PREEMPT patch to achieve realtime capabilities. I do not now if and how you can attach your ROS package to this. We a using a celix framework for the Rexroth specific RT parts with an integrated scheduler there customers can write their own bundles using our SDK for ctrlX AUTOMATION.

You can get information about the utilisation via the web UI:web UI informationweb UI information

web UI performance and processesweb UI performance and processes

Thomas_SF
Member

Re: ROS2 Foxy Snap - Performance issue

Thanks for the quick reply.

It doesn't look like my ROS2 snap is using too much processing power, after ROS is booted the CPU load of core 0 and 1 stabilises at around 55%.
It seems to me that the cycle time with which the snap is processed is too slow for the ROS communication.

Screenshot 2022-05-18 142812.pngScreenshot 2022-05-18 143901.png

Via the scheduler I found out that core 0&1 do not handle real time tasks. Core 2&3 seem to be defined for real-time tasks.

Screenshot 2022-05-18 144003.pngScreenshot 2022-05-18 144039.png

However, only callable functions can be assigned to the task and I'm not seeing my ROS Process or Snap there.

Screenshot 2022-05-18 144322.png

Would it be possible to define my ROS application as callable in order to achieve a higher cycle time and real-time functionality?

CodeShepherd
Community Moderator

Re: ROS2 Foxy Snap - Performance issue

Own created apps always run free running in the system. So without any speed restrictions.

The scheduler like I mentioned is part of a CELIX framework written in C++. To be part of this you have to create a CELIX bundle and in this a callable can be created.

Could you check your RAM? Should be fine but just to be sure.

I already created some ROS(1) snaps that were running fine and could control a six axes articulated robot arm.

CodeShepherd
Community Moderator

Re: ROS2 Foxy Snap - Performance issue

Any news here or can this topic be closed?

Thomas_SF
Member

Re: ROS2 Foxy Snap - Performance issue

Hi sorry for the late reply I have tried a few things.


It seems that all apps get by default a CPU affinity for the first two cores 0 and 1.
The ROS2-UR driver consists of several processes each reflecting a specific node. In this case the node "ros2_control_node" causes problems, because due to the CPU load of the two standard cores it comes to the fact that the connection breaks.
To solve this problem I assigned the node to another CPU, in my case core 3. This works with the Python "os-commands", using 

os.sched_setaffinity(0, {3})

, I can assign my current Python Skipr to the not heavily used CPU 3 and then start my launch file as a subprocess in it. The subprocess is then automatically assigned to the respective CPU of the Python script. The not so time critical nodes like a trajectory planner e.g. "move_group" can be executed on the busy CPUs.

This has significantly improved the stability of my application but not completely fixed it.

For a complete solution it would have to be assigned to a realtime priority, but as far as I found out there is no plug&play solution for this. (only possible via root access and SSH).

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist