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

[ROS2] "colon" building turtlesim package failed

asked 2020-05-06 07:06:26 -0500

songyuc gravatar image

Hi, guys,
I am learning about ROS2 on Windows 10 today.
The "colon" building turtlesim package failed as the tutorial, 5 Build the workspace with colcon. Specifically, in the step 5 -- 5 Build the workspace with colcon,
run the command colcon build --merge-install, then an error appeared as,

Starting >>> turtlesim
[Processing: turtlesim]
Failed <<< turtlesim [ Exited with code 1 ]
Summary: 0 packages finished [35.5s]
1 package failed: turtlesim

In order to get the error information,
I run the command colcon build --event-handlers console_cohesion+ --merge-install, and got the information,

Starting >>> turtlesim
[31.534s] colcon.colcon_core.event_reactor ERROR Exception in event handler extension 'console_cohesion': 'utf-8' codec can't decode byte 0xd3 in position 2253: invalid continuation byte
Traceback (most recent call last):
File "c:\python37\lib\site-packages\colcon_core\event_reactor.py", line 78, in _notify_observers retval = observer(event)
File "c:\python37\lib\site-packages\colcon_output\event_handler\console_cohesion.py", line 53, in __call__ self._lines[job]).decode() + \
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 2253: invalid continuation byte

Failed <<< turtlesim [ Exited with code 1 ]

Summary: 0 packages finished [29.4s]
1 package failed: turtlesim

Could you please tell me how to fix this?
You answer and idea will be appreciated!

edit retag flag offensive close merge delete

Comments

Hi @christophebedard, here is the new question.

songyuc gravatar image songyuc  ( 2020-05-06 07:18:38 -0500 )edit

does it work if you run the command without --event-handlers console_cohesion+?

christophebedard gravatar image christophebedard  ( 2020-05-06 07:54:35 -0500 )edit

and did you do call C:\dev\ros2\local_setup.bat?

christophebedard gravatar image christophebedard  ( 2020-05-06 07:55:27 -0500 )edit

No, it doesn't.
In the first information, I have shown the result as: run the command colcon build --merge-install, then an error appeared as,

Starting >>> turtlesim
[Processing: turtlesim]
Failed <<< turtlesim [ Exited with code 1 ]
Summary: 0 packages finished [35.5s]
1 package failed: turtlesim

songyuc gravatar image songyuc  ( 2020-05-06 08:01:57 -0500 )edit

oh, I see.

christophebedard gravatar image christophebedard  ( 2020-05-06 08:02:49 -0500 )edit

And yes, I have done the call command.

songyuc gravatar image songyuc  ( 2020-05-06 08:03:02 -0500 )edit

I infer it, from my previous experience, that Windows CMD script doesn't accept the '' symbol for string, but the "" symbol. Such as,
ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 1.8}}" works right,
instead of ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist '{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 1.8}}'.

songyuc gravatar image songyuc  ( 2020-05-06 08:07:24 -0500 )edit
2

the error points to this line which doesn't seem to specify any encoding, so perhaps that's why it fails on Windows (encoding/decoding is a very platform-dependant thing as far as I understand)

christophebedard gravatar image christophebedard  ( 2020-05-06 09:02:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-10 06:19:34 -0500

anion0278 gravatar image

Regarding the colcon.colcon_core.event_reactor: You can use the following pull request in the official colcon-ouput repo: Fix missing encoding for Windows with non-utf-8 code page, it solves the specified issue.

Alternatively, you can change the code page on your machine by navigating to Control Panel - Region - Administrative (tab) - Language for non-Unicode programs and setting it to English (United States). (This option, however, may cause some character displaying problems in other applications).

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-05-06 07:06:26 -0500

Seen: 1,410 times

Last updated: May 06 '20