Hi,
I need to update the build in ROS msgs of the package controller_manager_msgs in Matlab21b to the newest version available at https://github.com/ros-controls/ros_control/tree/melodic-devel/controller_manager_msgs since my robot is working with the newer msgs definitions. Main difference can be found in the definition of the ControllerState.msg which uses the HardwareInterfaceResources.msg in the newer version, which is not used in the build in msgs. Unfortunately the build fails with the error found below. Can someone help me on how to fix this? (I tried this on Windows and on a Linux Ubuntu 18.04 computer)
Identifying message files in folder 'M:/80_WN_Roboter/30_ROS_Simulink/01_Custom_Msgs_Srvs_Actions/01_Laptop'..Done.
Validating message files in folder 'M:/80_WN_Roboter/30_ROS_Simulink/01_Custom_Msgs_Srvs_Actions/01_Laptop'..Done.
[4/4] Generating MATLAB interfaces for custom message packages... Done.
Running catkin build in folder 'M:/80_WN_Roboter/30_ROS_Simulink/01_Custom_Msgs_Srvs_Actions/01_Laptop/matlab_msg_gen_ros1/win64'.
Build in progress. This may take several minutes...Error using ros.internal.ROSProjectBuilder/buildPackage (line 552)
Error building package: build log.
Error in rosgenmsg (line 483)
buildPackage(builder, [], 'install', catkinMakeArgs); %other messages might need to be present in the same directory
Error in createCustomMsgsSrvsActions (line 13)
rosgenmsg(folderpath)
With the following errors in the log file:
Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_ControllerState_message.cpp.obj
FAILED: controller_manager_msgs/CMakeFiles/controller_manager_msgs_matlab.dir/src/controller_manager_msgs_ControllerState_message.cpp.obj
C:\PROGRA~2\MICROS~2\2017\ENTERP~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x64\cl.exe /nologo /TP -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DCONTROLLER_MANAGER_MSGS_BUILDING_LIBRARY -DNOMINMAX -DNO_STRICT -DQ_NOWINSTRICT -DROS1_USES_ROS2_CLASS_LOADER -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"controller_manager_msgs\" -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -Dcontroller_manager_msgs_matlab_EXPORTS -IM:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\devel\include -IM:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\include -IM:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs -I"C:\Program Files\MATLAB\R2021b\sys\ros1\win64\ros1\include" -I"C:\Program Files\MATLAB\R2021b\sys\ros1\win64\ros1\boost\include\boost-1_72" -I"C:\Program Files\MATLAB\R2021b\sys\ros1\win64\ros1\console_bridge\include" -I"C:\Program Files\MATLAB\R2021b\sys\ros1\win64\ros1\share\xmlrpcpp\cmake\..\..\..\include\xmlrpcpp" -I"C:\Program Files\MATLAB\R2021b\extern\include" -I"C:\Program Files\MATLAB\R2021b\extern\include\MatlabDataArray" -I"C:\Program Files\MATLAB\R2021b\toolbox\ros\include\ros1" -I"C:\Program Files\MATLAB\R2021b\sys\ros2\win64\ros2\include\class_loader" -I"C:\Program Files\MATLAB\R2021b\toolbox\ros\mlroscpp\custom_messages\include" -I"C:\Program Files\MATLAB\R2021b\sys\ros1\win64\ros1\bzip2\include" -I"C:\Program Files\MATLAB\R2021b\sys\ros1\win64\ros1\lz4\include" -IM:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\include\controller_manager_msgs /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Od /Ob2 /DNDEBUG -std:c++14 /Zc:__cplusplus /showIncludes /Focontroller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_ControllerState_message.cpp.obj /Fdcontroller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\ /FS -c M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(70): error C2039: "hardware_interface": Ist kein Element von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\devel\include\controller_manager_msgs/ControllerState.h(64): note: Siehe Deklaration von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(82): error C2039: "resources": Ist kein Element von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\devel\include\controller_manager_msgs/ControllerState.h(64): note: Siehe Deklaration von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(106): error C2039: "hardware_interface": Ist kein Element von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\devel\include\controller_manager_msgs/ControllerState.h(64): note: Siehe Deklaration von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(107): error C3536: "currentElement_hardware_interface": Kann nicht verwendet werden, bevor es initialisiert wurde.
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(107): error C2664: "matlab::data::CharArray matlab::data::ArrayFactory::createCharArray(const std::string &)" : Konvertierung von Argument 1 von "int" in "matlab::data::String" nicht m”glich
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(107): note: Quelltyp konnte von keinem Konstruktor angenommen werden, oder die šberladungsaufl”sung des Konstruktors ist mehrdeutig
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(109): error C2039: "resources": Ist kein Element von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\devel\include\controller_manager_msgs/ControllerState.h(64): note: Siehe Deklaration von "controller_manager_msgs::ControllerState_<std::allocator<void>>"
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(110): error C3536: "currentElement_resources": Kann nicht verwendet werden, bevor es initialisiert wurde.
M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src\controller_manager_msgs\src\controller_manager_msgs_ControllerState_message.cpp(112): error C2109: Index erfordert ein Array oder einen Zeigertyp
[83/117] Generating C++ code from ur_dashboard_msgs/SetModeGoal.msg
[84/117] Generating C++ code from ur_dashboard_msgs/SetModeFeedback.msg
[85/117] Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_HardwareInterfaceResources_message.cpp.obj
[86/117] Building CXX object ur_msgs\CMakeFiles\ur_msgs_matlab.dir\src\ur_msgs_SetSpeedSliderFraction_service.cpp.obj
[87/117] Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_UnloadController_service.cpp.obj
[88/117] Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_LoadController_service.cpp.obj
[89/117] Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_ReloadControllerLibraries_service.cpp.obj
[90/117] Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_SwitchController_service.cpp.obj
[91/117] Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_ListControllerTypes_service.cpp.obj
[92/117] Building CXX object myown_msgs\CMakeFiles\myown_msgs_matlab.dir\src\myown_msgs_getOCP_service.cpp.obj
[93/117] Building CXX object controller_manager_msgs\CMakeFiles\controller_manager_msgs_matlab.dir\src\controller_manager_msgs_ListControllers_service.cpp.obj
ninja: build stopped: subcommand failed.
Base path: M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64
Source space: M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\src
Build space: M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\build
Devel space: M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\devel
Install space: M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\install
####
#### Running command: "ninja build.ninja" in "M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\build"
####
####
#### Running command: "ninja install install -j12 -l12" in "M:\80_WN_Roboter\30_ROS_Simulink\01_Custom_Msgs_Srvs_Actions\01_Laptop\matlab_msg_gen_ros1\win64\build"
####
Invoking "ninja install install -j12 -l12" failed