ros2genmsg folder path validation error line 197

8 views (last 30 days)
Going through the tutorials for both examples for custom ROS2 generation ROS2CustomMessagesExample and CreateShareableROS2CustomMessageExample yield this same error on 2 different computers.
Both are running MSVS 2019, one used python 3.8, the other 3.9 and the python environment was setup from the Matlab preferences. Matlab\Simulink Coders are installed. Microsoft Windows 10 Enterprise Version 10.0 (Build 19044), Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
It looks like a Linux/Windows mishap based on the / vs \
ros2genmsg(folderPath)
Identifying message files in folder 'C:/Users/223/Documents/MATLAB/Examples/R2023a/ros/ROS2CustomMessagesExample/custom'..Validating message files in folder 'C:/Users/223/Documents/MATLAB/Examples/R2023a/ros/ROS2CustomMessagesExample/custom'..Done.
Done.
Error using ros.ros2.internal.validateMsg
Invalid message format, package, or structure found during validation.
Error in ros2genmsg (line 197)
ros.ros2.internal.validateMsg(folderPath);
Caused by:
/usr/bin/bash: C:/Program: No such file or directory
  1 Comment
CB
CB on 15 Sep 2023
Edited: CB on 15 Sep 2023
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.14.0.2254940 (R2023a) Update 2
MATLAB License Number: 99999999
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 19044)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.14 (R2023a)
Simulink Version 10.7 (R2023a)
Aerospace Blockset Version 6.0 (R2023a)
Aerospace Toolbox Version 4.4 (R2023a)
Automated Driving Toolbox Version 3.7 (R2023a)
Computer Vision Toolbox Version 10.4 (R2023a)
Control System Toolbox Version 10.13 (R2023a)
Curve Fitting Toolbox Version 3.9 (R2023a)
DDS Blockset Version 1.4 (R2023a)
DSP System Toolbox Version 9.16 (R2023a)
Data Acquisition Toolbox Version 4.7 (R2023a)
Deep Learning Toolbox Version 14.6 (R2023a)
Embedded Coder Version 7.10 (R2023a)
Fixed-Point Designer Version 7.6 (R2023a)
Fuzzy Logic Toolbox Version 3.1 (R2023a)
GPU Coder Version 2.5 (R2023a)
Global Optimization Toolbox Version 4.8.1 (R2023a)
Image Acquisition Toolbox Version 6.7.1 (R2023a)
Image Processing Toolbox Version 11.7 (R2023a)
Industrial Communication Toolbox Version 6.2 (R2023a)
Instrument Control Toolbox Version 4.8 (R2023a)
Lidar Toolbox Version 2.3 (R2023a)
MATLAB Coder Version 5.6 (R2023a)
MATLAB Compiler Version 8.6 (R2023a)
MATLAB Compiler SDK Version 7.2 (R2023a)
MATLAB Report Generator Version 5.14 (R2023a)
MATLAB Test Version 1.0 (R2023a)
Machine Vision Toolbox Version 4.3.0
Model Predictive Control Toolbox Version 8.1 (R2023a)
Model-Based Calibration Toolbox Version 5.14 (R2023a)
Motor Control Blockset Version 2.0 (R2023a)
Navigation Toolbox Version 2.4 (R2023a)
Optimization Toolbox Version 9.5 (R2023a)
Parallel Computing Toolbox Version 7.8 (R2023a)
Partial Differential Equation Toolbox Version 3.10 (R2023a)
Powertrain Blockset Version 2.0 (R2023a)
Predictive Maintenance Toolbox Version 2.7 (R2023a)
ROS Toolbox Version 2.0 (R2023a)
Reinforcement Learning Toolbox Version 2.4 (R2023a)
Requirements Toolbox Version 2.2 (R2023a)
Robotics System Toolbox Version 4.2 (R2023a)
Robotics Toolbox for MATLAB Version 10.4
Robust Control Toolbox Version 6.11.3 (R2023a)
Sensor Fusion and Tracking Toolbox Version 2.5 (R2023a)
Signal Processing Toolbox Version 9.2 (R2023a)
SimEvents Version 5.14 (R2023a)
Simscape Version 5.5 (R2023a)
Simscape Driveline Version 3.7 (R2023a)
Simscape Electrical Version 7.9 (R2023a)
Simscape Multibody Version 7.7 (R2023a)
Simulink 3D Animation Version 9.6 (R2023a)
Simulink Check Version 6.2 (R2023a)
Simulink Code Inspector Version 4.3 (R2023a)
Simulink Coder Version 9.9 (R2023a)
Simulink Compiler Version 1.6 (R2023a)
Simulink Control Design Version 7.0 (R2023a)
Simulink Coverage Version 5.6 (R2023a)
Simulink Design Optimization Version 3.13 (R2023a)
Simulink Design Verifier Version 4.9 (R2023a)
Simulink Report Generator Version 5.14 (R2023a)
Simulink Test Version 3.8 (R2023a)
Stateflow Version 10.8 (R2023a)
Statistics and Machine Learning Toolbox Version 12.5 (R2023a)
Symbolic Math Toolbox Version 9.3 (R2023a)
System Composer Version 2.4 (R2023a)
System Identification Toolbox Version 10.1 (R2023a)
UAV Toolbox Version 1.5 (R2023a)
Vehicle Dynamics Blockset Version 2.0 (R2023a)
Wavelet Toolbox Version 6.3 (R2023a)
----------DATE/TIME----------
15-Sep-2023 03:44:48
----------ROS-SPECIFIC ENVIRONMENT VARIABLES----------
ROS_MASTER_URI =
ROS_HOSTNAME =
ROS_IP =
ROS_NAMESPACE =
ROS_DEFAULT_CORE_PORT =
ROS_DEFAULT_NODE_PORT =
ROS_DOMAIN_ID = 0
RMW_IMPLEMENTATION = rmw_fastrtps_cpp
FASTRTPS_DEFAULT_PROFILES_FILE =
----------GENERATED MASTER URI AND NODEHOST----------
Generated Master URI: http://localhost:11311
Generated Node Host: G
----------ROS Connectivity----------
Global core is not running.
Global node is not running.
----------PYTHON AND CODEGEN INFORMATION----------
BOOST_ROOT =
CATKIN_PREFIX_PATH =
MY_PYTHON2_VENV =
PYTHONHOME =
Mex Compiler Configuration:
<a href="matlab:helpPopup mex.CompilerConfiguration" style="font-weight:bold">CompilerConfiguration</a> with properties:
Name: 'Microsoft Visual C++ 2019'
Manufacturer: 'Microsoft'
Language: 'C++'
Version: '16.0'
Location: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\'
ShortName: 'MSVCPP160'
Priority: 'A'
Details: [1×1 mex.CompilerConfigurationDetails]
LinkerName: 'link'
LinkerVersion: ''
MexOpt: 'C:\Users\223\AppData\Roaming\MathWorks\MATLAB\R2023a\mex_C++_win64.xml'
Using catkin prefix path: C:\Program Files\MATLAB\R2023a\sys\ros1\win64\ros1
Using boost root: C:\Program Files\MATLAB\R2023a\sys\ros1\win64\ros1\boost
pyenv:
<a href="matlab:helpPopup matlab.pyclient.PythonEnvironment" style="font-weight:bold">PythonEnvironment</a> with properties:
Version: "3.8"
Executable: "C:\Python38\python.EXE"
Library: "C:\Python38\python38.dll"
Home: "C:\Python38"
Status: NotLoaded
ExecutionMode: InProcess
where python =
C:\Python38\python.exe
C:\Users\223\AppData\Local\Microsoft\WindowsApps\python.exe
where python2 =
INFO: Could not find files for the given pattern(s).
python --version = Python 3.8.10
python2 --version = 'python2' is not recognized as an internal or external command,
operable program or batch file.
where cmake =
C:\CMake\bin\cmake.exe
cmake --version = cmake version 3.20.6
CMake suite maintained and supported by Kitware (kitware.com/cmake).
----------CUSTOM MESSAGE INFORMATION----------
Custom Messages:
Custom Services:
----------ALL ENVIRONMENT VARIABLES----------
ALLUSERSPROFILE = C:\ProgramData
APPDATA = C:\Users\223\AppData\Roaming
CHOCOLATEYINSTALL = C:\ProgramData\chocolatey
CHOCOLATEYLASTPATHUPDATE = 133084179200956881
COMMONPROGRAMFILES = C:\Program Files\Common Files
COMMONPROGRAMFILES(X86) = C:\Program Files (x86)\Common Files
COMMONPROGRAMW6432 = C:\Program Files\Common Files
COMPUTERNAME = G
COMSPEC = C:\Windows\system32\cmd.exe
CYGWIN = nodosfilewarning upcaseenv winsymlinks
DRIVERDATA = C:\Windows\System32\Drivers\DriverData
FLEXLM_TIMEOUT = 40000000
GROFF_FONT_PATH = /usr/share/groff/font
GROFF_TMAC_PATH = /usr/share/groff/tmac
HOMEDIR = D:\Users\223
HOMEDRIVE = C:
HOMEPATH = \Users\223
ICU_TIMEZONE_FILES_DIR = C:\Program Files\MATLAB\R2023a/bin/icutzdata
IMAGE_GROUP = Engineering
KMP_BLOCKTIME = 1
KMP_HANDLE_SIGNALS = 0
KMP_STACKSIZE = 512k
LANG = en_US.UTF-8
LOCALAPPDATA = C:\Users\223\AppData\Local
LOGONSERVER = \\DCCINOHP0105
MATLAB_ARCH = win64
MODEL = Precision 7760
MSMPI_BENCHMARKS = C:\Program Files\Microsoft MPI\Benchmarks\
MSMPI_BIN = C:\Program Files\Microsoft MPI\Bin\
MW_MINGW64_LOC = C:\ProgramData\MATLAB\SupportPackages\R2023a\3P.instrset\mingw_w64.instrset
NUMBER_OF_PROCESSORS = 12
OLD_FLEXLM_TIMEOUT = 40000000
OMP_NUM_THREADS = 12
OPENCV_DIR = C:\opencv
OPENSSL_CONF = C:\Program Files\OpenSSL-Win64\bin\openssl.cfg
OS = Windows_NT
PATH = C:\Program Files\MATLAB\R2023a\bin\win64;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft MPI\Bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Apps\perl\bin;C:\Apps\Tcl\bin;C:\Apps\cygwin\bin;c:\apps\bin;c:\apps\lib;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\MATLAB\R2023a\runtime\win64;C:\Program Files\MATLAB\R2023a\bin;C:\Program Files\MATLAB\R2020b\runtime\win64;C:\Program Files\MATLAB\R2020b\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\dotnet\;C:\ProgramData\chocolatey\bin;C:\ProgramData\chocolatey\lib\cunit\lib;C:\ProgramData\chocolatey\lib\tinyxml2\lib;C:\ProgramData\chocolatey\lib\bullet\lib;C:\Program Files (x86)\Pololu\Tic\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\TortoiseGit\bin;C:\CMake\bin;C:\Python38\Scripts\;C:\Python38\;C:\Users\223\AppData\Local\Microsoft\WindowsApps;C:\Users\223\AppData\Local\GitHubDesktop\bin;C:\Users\223\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\OpenSSL-Win64\bin\;C:\opencv\x64\vc16\bin;C:\Python38\Tools\scripts\;C:\Users\223\AppData\Local\Box\Box Edit\;
PATHEXT = .sh;.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.tcl;.lnk;.PY;.PYW
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 141 Stepping 1, GenuineIntel
PROCESSOR_LEVEL = 6
PROCESSOR_REVISION = 8d01
PROGRAMDATA = C:\ProgramData
PROGRAMFILES = C:\Program Files
PROGRAMFILES(X86) = C:\Program Files (x86)
PROGRAMW6432 = C:\Program Files
PROMPT = $P$G
PSMODULEPATH = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft Azure Information Protection\Powershell;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\PowerShell\Modules\
PUBLIC = C:\Users\Public
PYTHONPATH = C:\Python38
RMW_IMPLEMENTATION = rmw_fastrtps_cpp
ROS_DOMAIN_ID = 0
SESSIONNAME = Console
SHELLOPTS = igncr
SITECODE = nsk
SYSTEMDRIVE = C:
SYSTEMOS = W1064
SYSTEMROOT = C:\Windows
TEMP = C:\Users\223\AppData\Local\Temp
TMP = C:\Users\223\AppData\Local\Temp
UGII_MAIN_VERSION = 1965
USERDNSDOMAIN = LOGON.DS.COM
USERDOMAIN = LOGON
USERDOMAIN_ROAMINGPROFILE = LOGON
USERNAME = 223
USERPROFILE = C:\Users\223
WINDIR = C:\Windows
----------MATLAB ROOT DIRECTORY----------
C:\Program Files\MATLAB\R2023a
----------PREFERENCES----------
Preferences Directory:
C:\Users\223\AppData\Roaming\MathWorks\MATLAB\R2023a
ROS_Toolbox Preferences:
CustomMessageMap: [0×1 containers.Map]
CustomMessageMapVersion: '1.0'
CustomServiceMap: [0×1 containers.Map]
CustomActionMap: [0×1 containers.Map]
ROS_NetworkAddress_Profiles: {[1×1 struct]}
CustomMessageMapROS1: [0×1 containers.Map]
CustomServiceMapROS1: [0×1 containers.Map]
CustomActionMapROS1: [0×1 containers.Map]
ROS_NetworkAddress_Profiles 1:
MasterUseDefault: 1
MasterHost: 'localhost'
MasterPort: 11311
NodeUseDefault: 1
NodeHost: '162.155.77.153'
DomainID: 0
RMWImplementation: 'rmw_fastrtps_cpp'
ProfileName: 'Standard'

Sign in to comment.

Accepted Answer

CB
CB on 3 Oct 2023
I had Cygwin installed and the ROS2 build function in Matlab has files with mlutple extensions for different operating systems and doesn't explicitly specify which one to use and one is a .sh file.
  • The default program for .sh was Cygwin once I uninstalled it the build process continued.
  • Then the build failed because the file path was too long and I moved it up the path from the example default.
  • Then I tried with a custom message named Feedback.msg which is a Matlab keyword, so I had to update that. It didn't actually fail until I tried colcon build on the Linux machine.
  • Then I renamed the message to FeedbackMtr.msg which build, but ROS2 auto-renames messages. It turns out to use the custom mesage in your C++ code you have to:
#include "<ros2_package>/msg/feedback_mtr.hpp" // FeedbackMtr.msg becomes feedback_mtr.hpp in you node include/<ros2_package>/<node>.hpp

More Answers (1)

Josh Chen
Josh Chen on 14 Sep 2023
Hi CB,
Which location are you trying to generate these messages to? It seems somewhere under "C:/Program Files/..."? Would it work if you change it to somewhere else?
When this happened, is there any "log" folder got generated? If yes, please share it with us. Please also attach the support file generated by the following command:
ros.internal.generateSupportFile
This will help us to understand the system setup on your machine and better trouble this issue.
Once you are ready with these files, please reach out to our technical support department.
Thanks,
Josh
  1 Comment
CB
CB on 15 Sep 2023
No logs as far as I can tell.
Generating in the automatic Examples folder in the Matlab folder.

Sign in to comment.

Categories

Find more on Application Deployment in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!