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

Revision history [back]

click to hide/show revision 1
initial version

To officially answer:

Cause of problem

Thanks to Dirk Thomas's comment I think the problem is using rosrun autocompletion is causing the bash shell IFS to be overwritten. If I start a new terminal:

 user@locahost:~$ echo -n "$IFS" | od -abc
  0000000  sp  ht  nl
           040 011 012
                         \t  \n
   0000003
   user@localhost:~$ rosrun m
   map_msgs            message_generation  move_base_msgs
  ...
  user@localhost:~$ echo -n "$IFS" | od -abc
  0000000
  user@localhost:~$

Persistent Work Around

Using _colcon_pthon_executable variable in local_setup.bash 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. When IFS is overwritten the loop to construct package names fails because string is not tokensied properly.

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"