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

Difference in build between ament build and ament build --symlink install

asked 2018-07-03 07:42:50 -0600

aks gravatar image

Hi, I have an overlay workspace. Once I built it with ament build and ran the corresponding node, it worked fine. Then I removed the build and install directory and built it again with ament build --symlink-install. Now whenever I run the same node there is a Tab and indentation error.

  File "/home/aakash/ros2_overlay_ws/build/openadx_demo/openadx_demo/topics/sender.py", line 63
  self.pub.publish(msg)
                      ^
  TabError: inconsistent use of tabs and spaces in indentation

This shouldnt be the case as I did not edit anything in the source code. What could be the problem ?

edit retag flag offensive close merge delete

Comments

The difference between ament build and ament build --symlink-install is the fact that in the first case the python file is copied to the install space, in the second case a symbolic link is created. If the file in the source space uses only spaces the problem should not happen.

marguedas gravatar image marguedas  ( 2018-07-03 23:26:53 -0600 )edit

Can you confirm that if you delete the install folder and run ament build again (without symlink-install) you can run the node successfully?

marguedas gravatar image marguedas  ( 2018-07-03 23:29:11 -0600 )edit

No, now i cannot run with ament build as well. Strange. I already figured out that there were Tabs in my code but I cannot understand how and why ?

aks gravatar image aks  ( 2018-07-04 08:49:30 -0600 )edit

it may be due to the editor you are using. Many developers force their text editors to convert all tabs to space automatically to avoid this type of issue.

Can this question be marked as closed as the problem is not due to ament or the use of the --symlink-install flag?

marguedas gravatar image marguedas  ( 2018-07-04 10:35:45 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-07-04 10:58:23 -0600

aks gravatar image

As @marguedas mentioned, for python, which does not need to be compiled, ament build --symlink-install creates a symbolic link in the build directory where in the changes made in the source code (src directory) are automatically reflected.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-07-03 07:42:50 -0600

Seen: 588 times

Last updated: Jul 04 '18