rosgenmsg fails with encoding error
4 views (last 30 days)
Show older comments
Hello,
However, when executing rosgenmsg, I run into the error described below. The issue occurs with my own custom message package, as well as with two other custom message packages that are published on github (radar_msgs and kobuki_msgs).
According to the log, there seems to be some encoding issue with utf-8.
How can I fix the issue and build the custom messages?
rosgenmsg("C:\MATLAB\custom_messages")
Identifying message files in folder 'C:/MATLAB/custom_messages'..Done.
Validating message files in folder 'C:/MATLAB/custom_messages'..Done.
[1/1] Generating MATLAB interfaces for custom message packages... Done.
Running catkin build in folder 'C:/Matlab/custom_messages/matlab_msg_gen_ros1/win64'.
Build in progress. This may take several minutes...Error using ros.internal.ROSProjectBuilder/buildPackage
Error building package: build log.
Error in rosgenmsg (line 480)
buildPackage(builder, [], 'install', catkinMakeArgs); %other messages might need to be present in the same directory
The build log is given below:
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.12
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86_x64'
-- The C compiler identification is MSVC 19.29.30142.1
-- The CXX compiler identification is MSVC 19.29.30142.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: C:/Matlab/custom_messages/matlab_msg_gen_ros1/win64/devel
-- Using CMAKE_PREFIX_PATH: C:\Program Files\MATLAB\R2022a\sys\ros1\win64\ros1;C:/Program Files/MATLAB/R2022a/toolbox/ros/mlroscpp/custom_messages
-- This workspace overlays: C:/Program Files/MATLAB/R2022a/sys/ros1/win64/ros1;C:/Program Files/MATLAB/R2022a/toolbox/ros/mlroscpp/custom_messages
-- Found PythonInterp: C:/Users/Franz/AppData/Roaming/MathWorks/MATLAB/R2022a/ros1/win64/venv/Scripts/python.exe (found suitable version "3.9.12", minimum required is "3")
-- Using PYTHON_EXECUTABLE: C:/Users/Franz/AppData/Roaming/MathWorks/MATLAB/R2022a/ros1/win64/venv/Scripts/python.exe
-- Using default Python package layout
-- Found PY_em: C:\Users\Franz\AppData\Roaming\MATHWO~1\MATLAB\R2022a\ros1\win64\venv\lib\site-packages\em.py
-- Using empy: C:/Users/Franz/AppData/Roaming/MATHWO~1/MATLAB/R2022a/ros1/win64/venv/lib/site-packages/em.py
-- Using CATKIN_ENABLE_TESTING: off
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
Das Sprungziel - GenerateTempFilename wurde nicht gefunden.
Traceback (most recent call last):
File "C:\Matlab\custom_messages\matlab_msg_gen_ros1\win64\build\catkin_generated\generate_cached_setup.py", line 22, in <module>
code = generate_environment_script('C:/Matlab/custom_messages/matlab_msg_gen_ros1/win64/devel/env.bat')
File "C:\PROGRA~1\MATLAB\R2022a\sys\ros1\win64\ros1\lib\site-packages\catkin\environment_cache.py", line 63, in generate_environment_script
env_after = ast.literal_eval(output.decode('utf-8'))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 3940: invalid continuation byte
CMake Error at C:/Program Files/MATLAB/R2022a/sys/ros1/win64/ros1/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(C:/Users/Franz/AppData/Roaming/MathWorks/MATLAB/R2022a/ros1/win64/venv/Scripts/python.exe
"C:/Matlab/custom_messages/matlab_msg_gen_ros1/win64/build/catkin_generated/generate_cached_setup.py")
returned error code 1
Call Stack (most recent call first):
C:/Program Files/MATLAB/R2022a/sys/ros1/win64/ros1/share/catkin/cmake/all.cmake:208 (safe_execute_process)
C:/Program Files/MATLAB/R2022a/sys/ros1/win64/ros1/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:58 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Matlab/custom_messages/matlab_msg_gen_ros1/win64/build/CMakeFiles/CMakeOutput.log".
Base path: C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64
Source space: C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\src
Build space: C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\build
Devel space: C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\devel
Install space: C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\install
Copying file from "C:\PROGRA~1\MATLAB\R2022a\sys\ros1\win64\ros1\share\catkin\cmake\toplevel.cmake" to "C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\src\CMakeLists.txt"
####
#### Running command: "cmake C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\src -DALIAS_ROS1_CLASS_LOADER=1 -DBoost_NAMESPACE=mwboost -DCATKIN_ENABLE_TESTING=off -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_C_COMPILER=cl.exe -DCMAKE_LINKER=link.exe -DMSVC_TOOLSET_VERSION=141 -DCMAKE_PREFIX_PATH=C:\Program Files\MATLAB\R2022a\sys\ros1\win64\ros1;C:/Program Files/MATLAB/R2022a/toolbox/ros/mlroscpp/custom_messages -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE=/MD /Od /Ob2 /DNDEBUG -DCATKIN_DEVEL_PREFIX=C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\devel -DCMAKE_INSTALL_PREFIX=C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\install -G Ninja" in "C:\MATLAB\custom_messages\matlab_msg_gen_ros1\win64\build"
####
Invoking "cmake" failed
3 Comments
Soulaimane Berkane
on 16 Mar 2023
Hello Franz,
I am facing a similar problem to yours. Did you figure out a solution? Thank you in advance.
Answers (1)
Jagadeesh Konakalla
on 21 Nov 2022
Looks issue is with the environment as mentioned by Franz.
0 Comments
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!