Ask Your Question
0

Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

asked 2021-05-13 13:45:22 -0500

Walter gravatar image

updated 2021-05-13 18:31:04 -0500

jayess gravatar image

Hello, i am trying to do colcon build --symlink-install but getting following error. Any idea what is happening here?

Starting >>> rosidl_generator_cpp                                               
[259.877s] ERROR:colcon.colcon_core.shell:Exception in shell extension 'sh': Expected ['.', '/home/saad/ros2_dashing/build/rosidl_generator_cpp/colcon_command_prefix_build.sh', '&&', 'env'] to pass: /bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_core/share/ament_cmake_core/environment/ament_prefix_path: not found
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_core/share/ament_cmake_core/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_export_definitions/share/ament_cmake_export_defi: not foundironment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_export_definitions/share/ament_cmake_export_definitions/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_export_include_directories/share/ament_cmake_exp: not found_directories/environment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_export_include_directories/share/ament_cmake_export_include_directories/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_export_libraries/share/ament_cmake_export_librar: not foundment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_export_libraries/share/ament_cmake_export_libraries/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_export_link_flags/share/ament_cmake_export_link_: not foundonment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_export_link_flags/share/ament_cmake_export_link_flags/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_include_directories/share/ament_cmake_include_di: not foundnvironment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_include_directories/share/ament_cmake_include_directories/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_libraries/share/ament_cmake_libraries/environmen: not foundfix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_libraries/share/ament_cmake_libraries/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_python/share/ament_cmake_python/environment/amen: not foundth.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_python/share/ament_cmake_python/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_export_dependencies/share/ament_cmake_export_dep: not foundnvironment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_export_dependencies/share/ament_cmake_export_dependencies/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_export_interfaces/share/ament_cmake_export_inter: not foundonment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_export_interfaces/share/ament_cmake_export_interfaces/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_target_dependencies/share/ament_cmake_target_dep: not foundnvironment/ament_prefix_path.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_target_dependencies/share/ament_cmake_target_dependencies/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_test/share/ament_cmake_test/environment/ament_pr: not foundh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_test/share/ament_cmake_test/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake/share/ament_cmake/environment/ament_prefix_path.: not found
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake/share/ament_cmake/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_cmake_gtest/share/ament_cmake_gtest/environment/ament_: not found.sh: 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_cmake_gtest/share/ament_cmake_gtest/environment/path.sh: copied: not found
/bin/sh: 3: /home/saad/ros2_dashing/install/ament_lint_auto/share/ament_lint_auto/environment/ament_pref: not found 
/bin/sh: 2: /home/saad/ros2_dashing/install/ament_lint_auto/share/ament_lint_auto/environment/path.sh: copied: not found
/bin/sh ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-05-13 15:40:31 -0500

Spectre gravatar image

That's quite a noisy output!

The words not found appear 120 times in that blurb. It looks like it's related specifically to /bin/sh which is just the basic Linux shell. The shell isn't finding most of that stuff which means this is probably related to a Linux PATH environment variable.

Did you source the ROS2 setup file beforehand? For Dashing I would expect it to be located somewhere like /opt/ros/dashing/setup.sh

I see a lot of references to your home directory. How have you installed ROS2? Do you have the /opt/ros2 directory? There is a separate archive of packages that the ROS2 "getting started" instructions tell everyone to install, but the intention for those, I think, is for you to install everything from that archive to /opt/ros2 using a few ROS2 and rosdep commands.

The main component which failed here, rosidl_generator_cpp, is for creating custom messages. By default you have access to things like std_msgs (these), but if you wish to create your own you need to work with rosidl. You can find more information on the ROS2 Dashing docs website, "Expanding on ROS 2 interfaces"

Another question: Is there a specific reason you're using Dashing rather than Foxy?

edit flag offensive delete link more

Comments

Clarification: I meant /opt/ros not /opt/ros2

Spectre gravatar image Spectre  ( 2021-05-13 17:17:07 -0500 )edit
0

answered 2021-05-13 16:56:10 -0500

Walter gravatar image

In /opt I have ros but because I am also using ros1, it has melodic in it, there is no ros2 in /opt. I was using ros2 eloquent but it didn't have a launch command to use with ros2.

edit flag offensive delete link more

Comments

I misspoke; I meant /opt/ros which would contain everything within distribution-specific subdirectories.

It sounds like you should be able to see /opt/ros/dashing, /opt/ros/eloquent, and /opt/ros/melodic. Is this correct?

For ROS2 the launch system has changed somewhat. Instead of an XML file, you must use a python script. For example, here is a link to ROS2 Foxy's launch file tutorial: https://docs.ros.org/en/foxy/Tutorial....

To run a launch file from a ROS2 package you must use this command:

ros2 launch <pkg_name> <launch_file.py>

Spectre gravatar image Spectre  ( 2021-05-13 17:22:55 -0500 )edit

No /opt/ros only contains melodic. Yes, I know about launch.py but the problem is in eloquent I don't have launch command with ros2. I have already uninstalled eloquent. I am following this link to build code for ROS2. https://docs.ros.org/en/dashing/Insta...

Walter gravatar image Walter  ( 2021-05-13 17:44:59 -0500 )edit

Ahh I see. I avoided that page altogether and instead followed the "Installing Ros 2 on Ubuntu Linux" instructions page instead :)

The instructions just before running colcon build --symlink-install actually say to not source setup.bash, and to run the build in a fresh terminal.

It also says that you can tell colcon to ignore packages that are preventing you from successfully building everything else. Have you tried to do as it says with touch COLCON_IGNORE?

Technically by doing this you're just skipping the build problem rather than fixing it, but this might at least let you proceed. You can, if you wish, try to build rosidl_generators_cpp by itself and hopefully get some more information about why its build is failing.

Spectre gravatar image Spectre  ( 2021-05-13 18:51:42 -0500 )edit

I tried to build in a new terminal, no success, and the same result. Also, I tried to build rosidl_generators_cpp individually which builds successfully. Yes by creating COLCON_IGNORE helps to ignore building rosidl_generators_cpp but again the same error comes up for rosidl_typesupport_introspection_c package. Is this package also for creating custom messages and can I ignore this one also? I feel isn't this error has to do something with AMENT_PREFIX_PATH.

Walter gravatar image Walter  ( 2021-05-14 05:48:03 -0500 )edit

Or what should I append to Linux PATH variable so that colcon can find shell extension for command environment?

Walter gravatar image Walter  ( 2021-05-14 06:06:05 -0500 )edit

(...) same error comes up for rosidl_typesupport_introspection_c package. Is this package also for creating custom messages and can I ignore this one also?

Yep! rosidl* anything will be related to those custom messages so for now you can probably ignore it too.

Or what should I append to Linux PATH variable so that colcon can find shell extension for command environment?

Honestly I'm not sure.

Spectre gravatar image Spectre  ( 2021-05-15 14:23:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2021-05-13 13:45:22 -0500

Seen: 57 times

Last updated: May 13