Robotics StackExchange | Archived questions

Sourcing setup in ROS2 slow

Hi, I had no problems with the time of sourcing setups in ardent, it was almost instantaneous so I have put the sourcing into /etc/bash.bashrc. But with ROS2, it has become very slow, there is a resulting long pause before any bash session:

$ time source /home/art/ros2_ws/install/setup.bash
real    0m6.734s
user    0m5.344s
sys 0m0.340s

Can the execution time be improved?

Asked by uthinu on 2018-09-06 10:09:37 UTC

Comments

Did you try sourcing ~art/ros2_ws/install/local_setup.bash? In general, I would avoid adding that line to /etc/bash.bashrc and instead add it to ~art/.bashrc (so you don't make other users suffer).

Asked by allenh1 on 2018-09-06 15:12:42 UTC

Times are comparable for these two scripts. I did a simple check and I guess that something slow called package.bash is called many times (for each package?)

Asked by uthinu on 2018-09-06 16:08:45 UTC

You can set the env vars AMENT_TRACE_SETUP_FILES=1 / COLCON_TRACE=1 to see which files are being sourced. There is certainly some overlap in them at the moment.

Asked by Dirk Thomas on 2018-09-06 16:47:42 UTC

Could it be that your Ardent ws was using a merged install while your Bouncy ws is using an isolated install? The isolated install certainly takes longer to setup due to its numerous separate paths.

Asked by Dirk Thomas on 2018-09-06 16:48:41 UTC

More than 1800 scripts are run in total by local-setup. I will try sourcing in /etc/rc.local instead.

Asked by uthinu on 2018-09-07 05:35:13 UTC

https://github.com/ros2/ros2/issues/573

Asked by Dirk Thomas on 2018-09-13 15:24:43 UTC

Answers