필터 지우기
필터 지우기

Setup ROS custom messages, problems with compiling

조회 수: 17 (최근 30일)
Tristan Sinnecker
Tristan Sinnecker 2022년 2월 3일
댓글: Cam Salzberger 2022년 2월 7일
Dear all,
I am struggling with an issue for a while now and would be really thankful for some help. I am trying to implement my cumstomized ROS messages into Matlab. As I am trying to import the ROS messages I run the following code:
mex -setup cpp
folderpath = 'C:\Users\sampleuser\Documents\MATLAB\R2021b\custom_msgs\tristan_thesis_hil';
rosgenmsg('C:\Users\sampleuser\Documents\MATLAB\R2021b\custom_msgs')
Running this code gives me the following output:
Error using ros.internal.ROSProjectBuilder (line 419)
Current compiler MinGW64 Compiler (C++) is not supported for ROS build. To choose a compiler, run 'mex -setup cpp'.
Error in ros.internal.CatkinBuilder (line 25)
h@ros.internal.ROSProjectBuilder(varargin{:});
Error in rosgenmsg (line 287)
builder = ros.internal.CatkinBuilder(genDir, pkgInfos{iPkg});
Could anybody help me with this issue?
Thank you all!

답변 (1개)

Cam Salzberger
Cam Salzberger 2022년 2월 3일
편집: Cam Salzberger 2022년 2월 3일
Hello Tristan,
ROS custom message compilation requires Visual Studio 2017 or 2019. The MinGW C++ compiler will not work for creating the libraries necessary to use ROS. Run "mex -setup cpp" and use the prompts to select Visual Studio (once installed).
See here for general information on system requirements to use various ROS Toolbox functionality.
-Cam
  댓글 수: 2
Tristan Sinnecker
Tristan Sinnecker 2022년 2월 3일
Hi Cam,
Thank you very much for your quick response. I installed MinGW because the error output suggested me to do so. Anyway, if it should work with VS 2017 or 2019 I will install right now. Do I have to consider anything to implement Visual Studio into Matlab or can I just simply consider the following post?
Thank you very much for your help!
Tristan
Cam Salzberger
Cam Salzberger 2022년 2월 7일
That post should be fine. There's nothing particular that ROS Toolbox needs out of Visual Studio beyond that which MATLAB already requires for codegen.
-Cam

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Specialized Messages에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by