ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

simon-t4's profile - activity

2020-01-16 00:03:10 -0500 answered a question Vector Map drawn in Rviz with a vertical offset

I am not sure about the map builder tools, but perhaps when you create the point cloud map there is some offset from the

2019-11-29 02:44:50 -0500 answered a question Using Autoware in Matlab simulation

The latest version of Autoware.AI has pure pursuit implemented as a package (pure_pursuit) in the core_planning reposito

2019-11-29 02:44:50 -0500 received badge  Rapid Responder (source)
2019-09-17 02:53:38 -0500 commented answer Colcon build and source install/setup.bash not finding packages

Sorry for the late reply. Unfortunately there is still the same behavior. I am simply editing /opt/ros/bin/rosrun script

2019-08-30 10:13:03 -0500 received badge  Self-Learner (source)
2019-08-30 03:26:30 -0500 commented answer Colcon build and source install/setup.bash not finding packages

Thanks for your work. Unfortunately (if I have applied the patch correctly) the problem still persists with the new vers

2019-08-26 19:14:57 -0500 marked best answer Colcon build and source install/setup.bash not finding packages

Hi

after using colcon build to compile Autoware 1.12 on Ubuntu 16.04 with ros kinetic , some times when running the script

 source autoware_dir/install/setup.bash

I receive an error that the packages are not found, and of therefore roslaunch or rosrun fails to find any nodes in the packages. The error is:

 user@locahost:~/autoware.ai$ source install/setup.bash
 not found: "/home/user/autoware.ai/install/adi_driver
 autoware_bag_tools
 autoware_build_flags
 autoware_can_msgs
 ..."

It turns out the problem is the way bash script tokenizes string variables (see below). My question is regarding the likely cause of the problem.

Question

Is it a problem with my environment? I may have messed up some environment variable or installed the wrong version of something. I would think if it is a problem with the colcon scripts themselves many other people would have similar problems.

Does anyone have any suggestions about what might be wrong?

I List the out put of various version info below.

EDIT: bash IFS is being overwritten by rosrun autocomplete. See below.

Cause of Problem

The error occurs because the script file install/local_setup.bash generates a list of package names which is a string with package names separated by (I think) line breaks. When the script then tries to add a prefix (path) to each package name, it treats the list of names as one single string.and of course can't find the file named after all packages. The relevant part of the script (install/local_setup.bash, from line 93) is

# get all packages in topological order                                                            
_colcon_ordered_packages="$($_colcon_python_executable "$_colcon_prefix_bash_COLCON_CURRENT_PREFIX_local_setup_util.py")"                                                                           
unset _colcon_python_executable                                                                    

# source package specific scripts in topological order                                             
for _colcon_package_name in $_colcon_ordered_packages; do                                          
      # setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script    
     COLCON_CURRENT_PREFIX="${_colcon_prefix_bash_COLCON_CURRENT_PREFIX}/${_colcon_package_name}"     
     _colcon_prefix_bash_source_script "$COLCON_CURRENT_PREFIX/share/${_colcon_package_name}/package.bash"                                                                                              
done

The ordered package string generated by the python script is iterated over in the for loop. In this case the string _colcon_ordered_packages is not tokenised and only one giant string is processed within the loop.

Work Around

By using a while read -r _colcon_package_name; do .... done <<< "$_colcon_ordered_packages to iterate the string can be successfully tokenised and then sourced using the appropriate package.bash script

# source package specific scripts in topological order                                             
while read -r _colcon_package_name; do                                                                                                 
      # setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script    
      COLCON_CURRENT_PREFIX="${_colcon_prefix_bash_COLCON_CURRENT_PREFIX}/${_colcon_package_name}"     
      _colcon_prefix_bash_source_script "$COLCON_CURRENT_PREFIX/share/${_colcon_package_name}/package.bash"                                                                                              
done <<< "$_colcon_ordered_packages"

Edit: fixed quotation marks

Edit: add

Persistent Work Around

Using _colcon_pthon_executable variable in above script, to find out what version of python colcon is using (in my case python3), and depending on what shell you are using (bash) edit the file :

 /usr/lib/python3/dist-packages/colcon_bash/shell/template/prefix.bash.em

This file is used by the colcon python module to generate the relevant part of install/local_setup.bash. Making the same change to the string tokenizer as above results in a workaround that will be persistent between builds.

Note: line numbers are slightly different in the ... (more)

2019-08-26 19:14:57 -0500 received badge  Scholar (source)
2019-08-26 19:14:45 -0500 answered a question Colcon build and source install/setup.bash not finding packages

To officially answer: Cause of problem Thanks to Dirk Thomas's comment I think the problem is using rosrun autocomplet

2019-08-12 22:36:32 -0500 received badge  Teacher (source)
2019-08-09 03:39:31 -0500 received badge  Famous Question (source)
2019-08-08 20:55:31 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-08 20:38:15 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-08 20:31:22 -0500 commented question Colcon build and source install/setup.bash not finding packages

The auto-complete function on rosrun seems to overwriting the IFS value. See original question.

2019-08-08 20:19:06 -0500 commented question Colcon build and source install/setup.bash not finding packages

Thanks, you are right. Open new terminal: echo -n "$IFS" | od -abc 0000000 sp ht nl 040 011 01

2019-08-08 20:18:42 -0500 commented question Colcon build and source install/setup.bash not finding packages

Thanks, you are right. Open new terminal: echo -n "$IFS" | od -abc 0000000 sp ht nl 040 011 01

2019-08-08 20:09:10 -0500 commented question Colcon build and source install/setup.bash not finding packages

Thanks, you are right. Open new terminal: echo -n "$IFS" | od -abc 0000000 sp ht nl 040 011 01

2019-08-08 20:01:17 -0500 commented question Colcon build and source install/setup.bash not finding packages

Thanks, you are right. Open new terminal: cat -etv <<<"$IFS" ^I$ $ Run source install/setup.bash, giv

2019-08-08 02:05:31 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-08 00:20:10 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-08 00:18:45 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-08 00:16:27 -0500 commented question Colcon build and source install/setup.bash not finding packages

Added a persistent (between builds) work around

2019-08-08 00:15:50 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-08 00:07:26 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-08 00:07:26 -0500 received badge  Editor (source)
2019-08-07 23:14:50 -0500 answered a question Cannot install autoware successfully

Hi, I had a similar problem here: https://answers.ros.org/question/330128/colcon-build-and-source-installsetupbash-no

2019-08-07 23:14:50 -0500 received badge  Rapid Responder (source)
2019-08-07 20:07:33 -0500 received badge  Notable Question (source)
2019-08-07 16:56:43 -0500 received badge  Student (source)
2019-08-07 16:56:11 -0500 received badge  Popular Question (source)
2019-08-07 00:43:37 -0500 received badge  Enthusiast
2019-08-06 22:09:26 -0500 edited question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-08-06 22:06:48 -0500 asked a question Colcon build and source install/setup.bash not finding packages

Colcon build and source install/setup.bash not finding packages Hi after using colcon build to compile Autoware 1.12 on

2019-05-23 22:51:29 -0500 answered a question what is the meaning of tags in csv files from autoware semantic maps

Hi, If by semantic maps you mean the vector map format, unfortunately Vector Maps is a proprietary map format owned by