Closed hoffmann-stefan closed 1 year ago
Hi @hoffmann-stefan!
Great to see that someone is finally adding actions!
I tried to build this in humble with Ubuntu 22.04 and got this:
Starting >>> rcldotnet
Starting >>> rosidl_generator_dotnet
Finished <<< rosidl_generator_dotnet [0.60s]
--- stderr: rcldotnet
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args`
(DOTNET_CORE) does not match the name of the calling package (DotNetCore).
This can lead to problems in calling code that expects `find_package`
result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
/opt/dependencies_ws/install/share/dotnet_cmake_module/cmake/Modules/dotnet/FindDotNetCore.cmake:37 (find_package_handle_standard_args)
/opt/dependencies_ws/install/share/dotnet_cmake_module/cmake/Modules/FindCSBuild.cmake:20 (find_package)
/opt/dependencies_ws/install/share/dotnet_cmake_module/cmake/Modules/FindDotNETExtra.cmake:15 (find_package)
CMakeLists.txt:20 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
gmake[2]: *** [CMakeFiles/test_messages.dir/build.make:110: CMakeFiles/test_messages] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:193: CMakeFiles/test_messages.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< rcldotnet [5.47s, exited with code 2]
Any idea what the issue could be?
(edit) Commenting out the tests for rcldotnet made the build pass but I still get:
Finished <<< rcldotnet [1.75s]
Starting >>> rcldotnet_examples
--- stderr: rcldotnet_examples
gmake[2]: *** [CMakeFiles/rcldotnet_example_action_server.dir/build.make:76: CMakeFiles/rcldotnet_example_action_server] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:279: CMakeFiles/rcldotnet_example_action_server.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/rcldotnet_example_action_client.dir/build.make:76: CMakeFiles/rcldotnet_example_action_client] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:305: CMakeFiles/rcldotnet_example_action_client.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< rcldotnet_examples [4.51s, exited with code 2]
(edit)
Haha, ok. I was missing that you need to rebuild the messages also. Still getting this error though....
Starting >>> lifecycle_msgs
--- stderr: builtin_interfaces
/bin/sh: 1: /home/ros/install/share/rosidl_generator_dotnet/cmake/../../../lib/rosidl_generator_dotnet/rosidl_generator_dotnet: Permission denied
gmake[2]: *** [CMakeFiles/builtin_interfaces__dotnet.dir/build.make:93: rosidl_generator_dotnet/builtin_interfaces/msg/duration.cs] Error 126
gmake[1]: *** [CMakeFiles/Makefile2:426: CMakeFiles/builtin_interfaces__dotnet.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< builtin_interfaces [0.19s, exited with code 2]
(edit) This seemed to fix the problem:
ros@sam-blade:~/src/src/ros2_dotnet/rosidl_generator_dotnet/bin$ ll
total 12
drwxr-xr-x 2 ros ros 4096 Jun 15 16:32 ./
drwxr-xr-x 6 ros ros 4096 Jun 15 15:50 ../
-rw-r--r-- 1 ros ros 1390 Jun 15 15:50 rosidl_generator_dotnet
ros@sam-blade:~/src/src/ros2_dotnet/rosidl_generator_dotnet/bin$ sudo chmod u+x rosidl_generator_dotnet
ros@sam-blade:~/src/src/ros2_dotnet/rosidl_generator_dotnet/bin$ ./rosidl_generator_dotnet
usage: rosidl_generator_dotnet [-h] --generator-arguments-file GENERATOR_ARGUMENTS_FILE --typesupport-impls TYPESUPPORT_IMPLS
rosidl_generator_dotnet: error: the following arguments are required: --generator-arguments-file, --typesupport-impls
Still getting some errors when building rcldotnet_examples
though :/
^[[39;49m^[[39;49m^[[91m/home/ros/src/src/ros2_dotnet/rcldotnet_examples/RCLDotnetActionClient.cs(5,17): error CS0234: The type or namespace name 'action' does not exist in the namespace 'test_msgs' (are you missing an assembly reference?) [/home/ros/build/rcldotnet_examples/rcldotnet_example_action_client/rcldotnet_example_action_client_dotnetcore.csproj]
^[[39;49m^[[39;49m^[[91m/home/ros/src/src/ros2_dotnet/rcldotnet_examples/RCLDotnetActionClient.cs(46,26): error CS0246: The type or namespace name 'Fibonacci' could not be found (are you missing a using directive or an assembly reference?) [/home/ros/build/rcldotnet_examples/rcldotnet_example_action_client/rcldotnet_example_action_client_dotnetcore.csproj]
^[[39;49m^[[39;49m^[[91m/home/ros/src/src/ros2_dotnet/rcldotnet_examples/RCLDotnetActionClient.cs(5,17): error CS0234: The type or namespace name 'action' does not exist in the namespace 'test_msgs' (are you missing an assembly reference?) [/home/ros/build/rcldotnet_examples/rcldotnet_example_action_client/rcldotnet_example_action_client_dotnetcore.csproj]
^[[39;49m^[[39;49m^[[91m/home/ros/src/src/ros2_dotnet/rcldotnet_examples/RCLDotnetActionClient.cs(46,26): error CS0246: The type or namespace name 'Fibonacci' could not be found (are you missing a using directive or an assembly reference?) [/home/ros/build/rcldotnet_examples/rcldotnet_example_action_client/rcldotnet_example_action_client_dotnetcore.csproj]
Hi @samiamlabs
Thanks for checking this out and testing :)
Could you try to build this with colcon build --event-handlers console_cohesion+
, as otherwise the dotnet build errors don't show up in the output? (dotnet build dosn't print errors to stderr, colcon only displays stderr by default)
Also, could you try to delete the build and install folder as well to make a absolutely clean build? Most of those erros tend to go away if you do a complete rebuild. There seem to be some situations where things don't get rebuilt by cmake correclty, haven't figured this out yet though.
... ~/src/src/ros2_dotnet/rosidl_generator_dotnet/bin$ ./rosidl_generator_dotnet ...
I wouldn't try to run this script manually, it is intended to be called from the "IDL pipline" in ament.
I wouldn't try to run this script manually, it is intended to be called from the "IDL pipline" in ament.
I did not run it manually, it was run by colcon and somehow got a permissions error.
I restarted the docker container I was using, and now it seems to work... strange. I can run the rcldotnet_examples action server and client at least. Great work!
I'm hoping to be able to use this with Behavior Designer in Unity 3D and finally get a proper behavior tree implementation to use for our robots.
A bit of topic, but I made this script for creating a standalone Unity plugin from ros2_dotnet from my fork of the project a while back: https://github.com/samiamlabs/ros2_dotnet/blob/cyclone/rcldotnet_utils/rcldotnet_utils/create_unity_plugin.py Do you know if there is something like that for the official ros2_dotnet that is up to date? Figuring out every file that needs to be copied over manually is very time-consuming and I'm guessing you still need to do a couple of rpath hacks to get around the LD_LIBRARY_PATH issues etc...
I restarted the docker container I was using, and now it seems to work... strange. I can run the rcldotnet_examples action server and client at least. Great work!
Thanks!
A bit of topic, but I made this script for creating a standalone Unity plugin from ros2_dotnet from my fork of the project a while back: https://github.com/samiamlabs/ros2_dotnet/blob/cyclone/rcldotnet_utils/rcldotnet_utils/create_unity_plugin.py Do you know if there is something like that for the official ros2_dotnet that is up to date? Figuring out every file that needs to be copied over manually is very time-consuming and I'm guessing you still need to do a couple of rpath hacks to get around the LD_LIBRARY_PATH issues etc...
Haven't done anything with Unity so far, I come from another background. So I'm not aware of it, there is only the section in the README as far as I know: https://github.com/ros2-dotnet/ros2_dotnet#using-generated-dlls-in-your-uwp-application-from-unity
As you said, having some sort of script for this would be nice. I would welcome this contribution :) Could you open a PR for this? Thanks in advance :)
extracted from https://github.com/ros2-dotnet/ros2_dotnet/pull/94 implements: https://github.com/ros2-dotnet/ros2_dotnet/issues/49
This PR adds support for action services and clients.
Example
ActionClient
Note: For this example to work there needs to be an
Thread
/Task
that runsRCLDotnet.Spin()
.ActionServer
Added public API
Interfaces for message generation