ros2genmsg: ERROR building package

I want to create ROS2 custum message(px4_msgs).
>> ros2genmsg("C:\ros2pkg\custom_msgs",'BuildConfiguration','fasterruns')
フォルダー 'C:/ros2pkg/custom_msgs' のメッセージ ファイルを識別しています。.完了。
フォルダー 'C:/ros2pkg/custom_msgs' のメッセージ ファイルを検証しています。..完了。
[1/1] カスタム メッセージ パッケージ用の MATLAB インターフェイスを生成しています... 完了。
フォルダー 'C:/ros2pkg/custom_msgs/matlab_msg_gen/win64' の colcon ビルドを実行しています。
ビルドが進行中です。これには数分かかることがあります...エラー: ros.internal.ROSProjectBuilder/buildPackage (行 534)
Error building package: **********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.36
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86_x64'
.
エラー: ros2genmsg (241)
buildPackage(builder, [], ' --merge-install', colconMakeArgs); %other messages might need to
be present in the same directory
I recieved these errors above.
I updated MATLAB2021a and using python 2.7.
I'm also using visual studio 2017.
How can I do ?

댓글 수: 6

Jagadeesh Konakalla
Jagadeesh Konakalla 2021년 6월 1일
Hi Kenta Okamoto,
I have downloaded px4_msgs from the following and able to build successfully on my end.
It could be related to some enviorment (CMAKE, Python 3.7 and message dependencies) issue. Please note that you need python 3.7 for ros2 custom message generation. In your message, i see you set it to 2.7. This could be the root cause. Please see the ros2 requirements section in the following link.
In the custom message folder, you will see a folder named with matlab_msg_gen. Please see the following snapshot. Can you please check for the stdout.log file for more information on the error and let me know ?
Thanks,
Jagadeesh K
Kenta Okamoto
Kenta Okamoto 2021년 6월 2일
Thank you for replying.
I checked I have python 3.7 and set pyenv. and I downloaded px4_msgs from above link,
but I had same error message.
Checking matlab_msg_gen, but i couldn't find stderr.log.
I may have something error on clolcon ?
Kenta Okamoto
Kenta Okamoto 2021년 6월 3일
I tried re-install all required tolls and MATLAB. Then I could build messages.
I had python 3.8, 3.9, 3.7 and 2.7 . I think that uninstalling python might be solving this problem.
Thank you .
Jagadeesh Konakalla
Jagadeesh Konakalla 2021년 6월 4일
It is good to know that problem is solved. Yes, it is always good to have one required version of Python in Path.
Steven Lord
Steven Lord 2021년 6월 29일
Kenta Okamoto had flagged this "This solved problem". Please use flags to bring a problem with the answer to the attention of the administrators and the MVPs. Use comments or marking an answer as the Accepted answer to indicate that it has answered the question.
Rik
Rik 2022년 1월 11일
@Jagadeesh Konakalla Please post your comment as answer so Kenta (or someone else) can mark it as accepted answer.

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

답변 (1개)

Jagadeesh Konakalla
Jagadeesh Konakalla 2022년 1월 11일

0 개 추천

Uninstalling different versions of python solved the problem.

카테고리

도움말 센터File Exchange에서 Publishers and Subscribers에 대해 자세히 알아보기

제품

릴리스

R2021a

태그

질문:

2021년 6월 1일

답변:

2022년 1월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by