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

[ROS2] "no such command" for using "colcon build --merge-install" on Windows 10

asked 2020-04-29 05:29:17 -0500

songyuc gravatar image

updated 2020-04-29 05:30:45 -0500

Hi guys, I am learning about ROS2 on Windows 10 today. I tried using the command "colcon build --merge-install", as the tutorial said:

From the root of your workspace (~/dev_ws), you can now build your packages using the command:
Windows:
colcon build --merge-install
Windows doesn’t allow long paths, so merge-install will combine all the paths into the install directory.

But the terminal showed "no such command" for colcon.

Any answer or idea will be appreciated!

edit retag flag offensive close merge delete

Comments

3

Did you install colcon? e.g. pip install -U colcon-common-extensionsfrom here: https://index.ros.org/doc/ros2/Instal...

christophebedard gravatar image christophebedard  ( 2020-04-29 08:00:02 -0500 )edit

Hi @christophebedard, I didn't intstall colcon, because I followed Installing ROS 2 on Windows, which never mentioned about installing the colcon.

songyuc gravatar image songyuc  ( 2020-04-29 08:14:58 -0500 )edit
1

Well don't let that stop you from installing colcon. This section does say "If you would like to build your own packages, refer to the tutorial 'Using Colcon to build packages'." And the first step there is to install colcon! https://index.ros.org/doc/ros2/Tutori...

christophebedard gravatar image christophebedard  ( 2020-04-29 08:17:43 -0500 )edit
1

Thanks sincerely for your kind guide, and I have installed colcon, and this issue might be solved.

songyuc gravatar image songyuc  ( 2020-04-29 08:21:30 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-04-29 08:23:14 -0500

songyuc gravatar image

updated 2020-05-04 05:43:30 -0500

Just try installing the colcon as

pip install -U colcon-common-extensions

If you meet any error about "Visual Studio", you can run the command below to enter a Visual Studio (VS) environment as,

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64

Note: the exact path of the files or name of the application can be different on your computer.

edit flag offensive delete link more

Comments

If this worked for you, can you accept your answer by clicking on the check mark to the left?

christophebedard gravatar image christophebedard  ( 2020-04-29 12:48:12 -0500 )edit

OK; In fact, I try using the command above, but after running the colcon build --merge-install, there is an error which shows:

Starting >>> turtlesim
--- stderr: turtlesim
Traceback (most recent call last):
File "c:\python37\lib\site-packages\colcon_core\executor__init__.py", line 91, in __call__ rc = await self.task(args, *kwargs)
File "c:\python37\lib\site-packages\colcon_core\task__init__.py", line 93, in __call__ return await task_method(args, *kwargs)
File "c:\python37\lib\site-packages\colcon_ros\task\ament_cmake\build.py", line 72, in build additional_hooks=additional_hooks)
File "c:\python37\lib\site-packages\colcon_cmake\task\cmake\build.py", line 86, in build rc = await self._reconfigure(args, env)
File "c:\python37\lib\site-packages\colcon_cmake\task\cmake\build.py", line 153, in _reconfigure 'VisualStudioVersion is not set, '

songyuc gravatar image songyuc  ( 2020-04-30 03:30:00 -0500 )edit

RuntimeError: VisualStudioVersion is not set, please run within a Visual Studio Command Prompt.
---
Failed <<< turtlesim [ Exited with code 1 ]
Summary: 0 packages finished [1.17s]
1 package failed: turtlesim
1 package had stderr output: turtlesim
VisualStudioVersion is not set, please run within a Visual Studio Command Prompt.

And do you know how to solve this issue?

songyuc gravatar image songyuc  ( 2020-04-30 03:32:52 -0500 )edit

The error message is pretty clear. From a quick Google search, I found this: https://answers.ros.org/question/3174... Not sure why the Windows installation tutorials don't mention this though.

christophebedard gravatar image christophebedard  ( 2020-04-30 08:40:25 -0500 )edit
1

actually, it does mention it here: https://index.ros.org/doc/ros2/Tutori...

christophebedard gravatar image christophebedard  ( 2020-04-30 08:41:33 -0500 )edit

Thanks for your guide. It seems ROS2 building requires a VS code environment. So, I cannot use my falimilar PyCharm as my ROS IDE, am I right?

songyuc gravatar image songyuc  ( 2020-04-30 09:16:43 -0500 )edit
1

Visual Studio, not Visual Studio Code. You can use anything if you execute the command to setup the VS environment (in the solution I linked to above) before executing any colcon command.

christophebedard gravatar image christophebedard  ( 2020-04-30 09:23:11 -0500 )edit

Thanks! The command colcon can run normally now.

But I still met an error as,
Starting >>> turtlesim
[Processing: turtlesim]
Failed <<< turtlesim [ Exited with code 1 ]
Summary: 0 packages finished [35.5s]
1 package failed: turtlesim

And could you please provide me with more guide and help?

songyuc gravatar image songyuc  ( 2020-05-04 05:45:44 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-04-29 05:29:17 -0500

Seen: 15,288 times

Last updated: May 04 '20