The following message is displayed when I compiling the “nav2_project” package:
user:~/ros2_ws$ colcon build
Starting >>> nav2_course
Starting >>> nav2_project
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usageof dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usageof dash-separated 'install-scripts' will not be supported in future versions. Please use the underscore name 'install_scripts' instead
warnings.warn(
Finished <<< nav2_course [1.32s]
--- stderr: nav2_project
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usageof dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< nav2_project [2.05s]
Summary: 2 packages finished [4.32s]
1 package had stderr output: nav2_project
According to the SetuptoolsDeprecationWarning, I searched the internet and found a blog describing the warning. However, I cannot confirm whether the reasons in the blog are accurate. Please refer to this link: Why you shouldn't invoke setup.py directly.
To addressed the warning, I tried the following steps to help me compile successfully the nav2_project
- Downgrade the setuptools version to 58.2.0:
The following command can install setuptools with version 58.2.0
$ pip3 install setuptools==58.2.0
Defaulting to user installation because normal site-packages is not writeable
Collecting setuptools==58.2.0
Using cached setuptools-58.2.0-py3-none-any.whl (946 kB)
Installing collected packages: setuptools
Successfully installed setuptools-58.2.0
- Replace the notation “-” with “_” within the “setup.cfg” file
In this case, the “setup.cfg” file is within the “nav2_project” package.
|-- ros2_ws
| |-- src
| | |-- nav2_project
| | | |-- config
| | | |-- launch
| | | |-- nav2_project
| | | |-- resource
| | | |-- test
| | | |-- package.xml
| | | |-- setup.cfg
| | | `-- setup.py
The original contents within the “setup.py” file are shown below:
[develop]
script-dir=$base/lib/nav2_project
[install]
install-scripts=$base/lib/nav2_project
I replaced the notation “-” with “_”, the contents after editing are shown below:
[develop]
script_dir=$base/lib/nav2_project
[install]
install_scripts=$base/lib/nav2_project
After tring these steps, the “nav2_project” compiled successfully:
user:~/ros2_ws$ colcon build
Starting >>> nav2_course
Starting >>> nav2_project
Finished <<< nav2_course [1.07s]
Finished <<< nav2_project [1.85s]
Summary: 2 packages finished [3.69s]
I am not sure if these are the correct steps but they can helped me complete:
- Chapter 1: Introduction to ROS2 Navigation
If you have another views or solutions, please comment below to let me know
Thank you.