Really long time for compiling using ROS project simulation

I’ve been experiencing really long times for using colcon build in a workspace with just one package. I’m following the guides of ROS2 Jazzy, and sometimes the compilation even breaks, and force me to use the flag --executor sequential.

Are there any tips or guidance in how to improve this process?

Hi @AngelLoGa, welcome back to the community!

I’m assuming the package you are trying to compile is the default turtlesim?

If that’s the case, can I ask why are you compiling it from source? Are you making changes to it?

There is an apt package that is already installed in your rosject for the turtlesim. If you can’t run it with ros2 run turtlesim turtlesim_node, then that means that it’s not installed or the distro is not sourced. So you can do that with this:

sudo apt update
sudo apt install ros-[DISTRIBUTION]-turtlesim
source /opt/[DISTRIBUTION]/setup.bash

Now to address your question, compilation time depends on two things:

  1. How powerful the machine compiling is.
  2. What is inside the package to be compiled.

I don’t think turtlesim would have that many things to link and compile, but I’m not certain of this. So, some questions to help you debug:

  • Have you tried compiling another package?
  • Have you tried compiling wihout the --symlink-install tag?
  • Have you tried removing the compilation folders before attempting colcon build again?

Thanks for the reply @roalgoal. As I said, I was following the guidelines of ROS2 Tutorials (the originals from docs.ros.org), so one of the steps was to install a package and make a modification, in order to see how it differs from the version installed using apt.

I did compile another one, like rclcpp and rclpy examples and did last a long time as well. Althought, creating a new package and compiling it with a simple node was almost instant.

Yes, the results were pretty much the same

I did, same results

Regards

Then this is normal behavior. The rosject can only do so much while compiling. If it was a big, powerful computer, then it would take little time.

If the compilation breaks with a c++ related error, then most likely the rosject ran out of memory.

To completely rule it out, you might want to compile the package locally.

1 Like

I see, thanks a lot for explaining it. I guess I will try to work with small packages from now on using rosjects.

Regards!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.