[ROS2] "colon" building turtlesim package failed
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 byteFailed <<< 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!
Hi @christophebedard, here is the new question.
does it work if you run the command without
--event-handlers console_cohesion+
?and did you do
call C:\dev\ros2\local_setup.bat
?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,oh, I see.
And yes, I have done the
call
command.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}}'
.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)