0
$\begingroup$

Rosanswers logo

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 ?


Originally posted by aks on ROS Answers with karma: 667 on 2018-07-03

Post score: 1


Original comments

Comment by marguedas on 2018-07-03:
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.

Comment by marguedas on 2018-07-03:
Can you confirm that if you delete the install folder and run ament build again (without symlink-install) you can run the node successfully?

Comment by aks on 2018-07-04:
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 ?

Comment by marguedas on 2018-07-04:
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?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by aks with karma: 667 on 2018-07-04

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.