Closed tank104 closed 2 years ago
I have the same problem (with geometry_msgs) while building a part of the package created here. My ROS2 version is humble and the output is riddled with the following warning:
SC : warning CS1668: Invalid search path 'lib\um\x64' specified in 'LIB environment variable' -- 'directory does not exist' [C:\dev\ros2-for-unity\build\ros2_custom_msgs\ros2_custom_msgs_assembly\ros2_custom_msgs_assembly_dotnetcore.csproj] [C:\dev\ros2-for-unity\build\ros2_custom_msgs\ros2_custom_msgs_assembly.vcxproj]
followed by:
C:\dev\ros2-for-unity\build\ros2_custom_msgs\rosidl_generator_cs\ros2_custom_msgs\msg\sphere.cs(31,10): error CS0246: The type or namespace name 'geometry_msgs' could not be found (are you missing a using directive or an assembly reference?) [C:\dev\ros2-for-unity\build\ros2_custom_msgs\ros2_custom_msgs_assembly\ros2_custom_msgs_assembly_dotnetcore.csproj] [C:\dev\ros2-for-unity\build\ros2_custom_msgs\ros2_custom_msgs_assembly.vcxproj]
I tried copying parts of the CMakeLists.txt of geometry_msgs, but it did not help.
I managed to make the build succeed, it seems to be related to ros2-for-unity. I created an Issue there.
I've also tried to reproduce it on my machine but without success. I tested the tutorial packages as described here, and I'm ending up with a correctly filled csproj
file.
build/tutorial_interfaces/tutorial_interfaces_assembly/tutorial_interfaces_assembly_dotnetcore.csproj
:
...
<ItemGroup>
<Reference Include="/home/pj/ros2cs/install/lib/dotnet/ros2cs_common.dll" /> <Reference Include="/home/pj/ros2cs/install/lib/dotnet/geometry_msgs_assembly.dll" /> <Reference Include="/home/pj/ros2cs/install/lib/dotnet/std_msgs_assembly.dll" /> <Reference Include="/home/pj/ros2cs/install/lib/dotnet/builtin_interfaces_assembly.dll" />
</ItemGroup>
...
Therefore, could you post a full build log and tell me which versions of ros2cs
, Ubuntu, and ROS2 you are using?
Unfortunately I moved on from ROS2 and just went direct with MAVSDK because it had what I needed.
Sorry!
Ok, closing then.
Hi, I am having real troubles getting std_msgs_assembly.dll referenced in the csproj that is built for my custom_message package.
My setup is this: CMakeLists.txt:
... find_package(ament_cmake REQUIRED) find_package(std_msgs REQUIRED) find_package(rosidl_default_generators REQUIRED) ... rosidl_generate_interfaces(${PROJECT_NAME} ${ANDREW_TEST_MSGS} DEPENDENCIES std_msgs ADD_LINTER_TESTS) ...
package.xml is this: `...
...`
But in the output after running colcon in test_assembly_dotnetcore.csproj I get this: `...
...`
I would expect to see std_msgs dll reference there. As right now I get build errors when the csproj is built because std_msg could not be found.
Hopefully I am really not understanding how to set up new custom_messages, and its a quick fix, but I have spent hours trying to understand and get it working.