GithubHelp home page GithubHelp logo

robotecai / ros2cs Goto Github PK

View Code? Open in Web Editor NEW
88.0 4.0 22.0 309 KB

A C# (.Net) implementation of ros2 client library (rcl), enabling communication between ros2 ecosystem and C#/.Net applications such as Unity3D

License: Apache License 2.0

PowerShell 0.54% Shell 0.49% C# 59.62% CMake 11.78% C 2.10% Python 2.37% EmberScript 23.10%
ros2 csharp dotnet rcl unity3d ros

ros2cs's Introduction

Ros2cs

A C# .NET library for ROS2, including C# implementation of rcl APIs, message generation, tests and examples.

Ros2cs is also an independent part of Ros2 For Unity, which enables high-performance communication between simulation and ROS2 robot packages. Follow instructions there instead if you are intending to use ros2cs with Unity3D.

Features

  • A set of core abstractions such as Node, Publisher, Subscription, QoS, Clock
  • Comes with support for all standard ros2 messages
  • Custom messages can be easily generated from unmodified ROS2 packages
  • A logger that can be hooked to your application callbacks (e.g. in Unity3D)

Platforms

Supported OSes:

  • Ubuntu 22.04 (bash)
  • Ubuntu 20.04 (bash)
  • Windows 10 (powershell)
  • Windows 11* (powershel)

* ROS2 Galactic and Humble support only Windows 10 (ROS 2 Windows system requirements), but it is proven that it also works fine on Windows 11.

Supported ROS2 distributions:

  • Galactic
  • Humble

Flavours

ros2cs libraries can be built in two flavors:

  • standalone (no ROS2 installation required on the target machine, e.g., your Unity3D simulation server). All required dependencies are installed and can be used e.g., as a complete set of Unity3D plugins.
  • overlay (assuming existing (supported) ROS2 installation on the target machine). Only ros2cs libraries and generated messages are installed.

Building

Generating custom messages

After cloning the project and importing .repos, you can simply put your message package next to other packages in the src/ros2 sub-folder. Then, build your project, and you have all messages generated. You can also modify and use the custom_message.repos template to automate the process with the get_repos script.

Build instructions

Please follow the OS-specific instructions for your build:

Testing

Make sure your NuGet repositories can resolve xUnit dependency. You can call dotnet nuget list source to see your current sources for NuGet packages. Please note that Microsoft Visual Studio Offline Packages are usually insufficient. You can fix it by adding nuget.org repository: dotnet nuget add source --name nuget.org https://api.nuget.org/v3/index.json.

  • Make sure you built tests ( OS-specific build script with --with-tests flag).
  • Run OS-specific test script:
    • ubuntu:
    ./test.sh
    • windows:
    test.sp1
  • Run a manual test with basic listener/publisher examples (you have to source your ROS2 first):
    • ubuntu
    ros2 run ros2cs_examples ros2cs_talker
    ros2 run ros2cs_examples ros2cs_listener
    • windows
    ros2 run ros2cs_examples ros2cs_talker.exe
    ros2 run ros2cs_examples ros2cs_listener.exe
    
  • Run a manual performance test (you have to source your ROS2 first):
    • ubuntu
    ros2 run ros2cs_examples ros2cs_performance_talker
    ros2 run ros2cs_examples ros2cs_performance_listener
    • windows
    ros2 run ros2cs_examples ros2cs_performance_talker.exe
    ros2 run ros2cs_examples ros2cs_performance_listener.exe
    

Acknowledgements

The project started as a fork of ros2_dotnet but moved away from its root through new features and design choices. Nevertheless, ros2cs is built on foundation of open-source efforts of Esteve Fernandez (esteve), Lennart Nachtigall (firesurfer), Samuel Lindgren (samiamlabs) and other contributors to ros2_dotnet project.

Open-source release of ros2cs was made possible through cooperation with Tier IV. Thanks to encouragement, support and requirements driven by Tier IV the project was significantly improved in terms of portability, stability, core structure and user-friendliness.

ros2cs's People

Contributors

adamdbrw avatar algoryxjosef avatar deric-w avatar jaroszekpiotr avatar kielczykowski-rai avatar miyakoshi-dev avatar msz-rai avatar pijaro avatar prybicki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ros2cs's Issues

Reading an empty basic type array crashes

When reading data from NestedTypes of BasicTypes (for example, a float64 array such as in sensor_msgs/msg/joint_state), ros2cs crashes while reading the data.

This is due to a lack of check for a zero sized array before passing it to Marshal.Copy.

Allow non-blocking spinOnce

Passing 0 or even negative numbers to the final rcl_wait is well defined and there is no reason to impose any limitation in this wrapper code, that I know of.

See: https://docs.ros2.org/beta1/api/rcl/wait_8h.html#a732278988c802fe2c9d8ec24752f9dd9

The unit of timeout is nanoseconds. If the timeout is negative then this function will block indefinitely until something in the wait set is valid or it is interrupted. If the timeout is 0 then this function will be non-blocking; checking what's ready now, but not waiting if nothing is ready yet. If the timeout is greater than 0 then this function will return after that period of time has elapsed or the wait set becomes ready, which ever comes first.

My suggestion is to simply pull: #16 which removes the lower-bound checking of timeoutSec in spinOnce.

This has been tested and we noticed a big performance boost when running in a high-frequency application.

Improve lifecycle

Hello,
I noticed that nodes, publishers, services and clients expose a void Dispose() method which is used for disposing resources while also having methods like bool RemovePublisher(IPublisherBase) which should be called on other objects to remove them and as implemented in #37 call Dispose().

While users should call this remove methods it is possible that they just call Dispose() (for example when using using ) which can lead to disposed objects being kept around until the object containing their remove method is disposed.

Furthermore, most disposable objects call Dispose() in their finalizers to account for users forgetting to call it.
Since accessing other managed objects in finalizers is tricky it should not be done, which means that for example accessing the collection of publishers associated with a Node during finalization is risky (the collection and its managed internals having no finalizers is an implementation detail and should not be relied on as far as I know).

Possible Solution

The remove methods should be removed and the Dispose() method of the objects to be removed should handle all cleanup, which allows users to use using and prevents a node for example from being collected by the GC while a publisher exists.

Furthermore, the Ros2cs class should be replaced by an non-static class to prevent confusion which code is responsible for calling Ros2cs.Shutdown() and allows implementing IExtendedDisposable.

The problem of accessing managed objects during finalization can be solved by allowing some resources to leak if Dispose() was not called, which may be acceptable since node and context finalization typically happen on application shutdown.
Resources leaked include context and node handles, since we can not assure that associated resources are disposed (the context can however be shut down).
Handles of resources like publishers can be finalized during finalization.

Unity integration can be accomplished by calling Dispose() in ROS2UnityComponent but finalizing ROS2UnityCore and ROS2Node by GC would be difficult, which could be solved by removing them.

This is a class diagram containing the new methods used for lifecycle management (Publisher as an example of the other resources):
Lifecycle drawio

I could implement these changes if you agree with my ideas.

ROS2 version in 'ros2cs' metadata doesn't match currently sourced version. This is caused by mixing versions/builds. Plugin might not work correctly.

https://github.com/RobotecAI/ros2-for-unity

I followed the official tutorial ,after achieving topics
''Add ROS2TalkerExample.cs script to the very same game object.
Add ROS2ListenerExample.cs script to the very same game object.''

I started the project in Unity, Unity reported several errors as follows,i didn't see two nodes talking with each other in Unity Editor's console 。
微信图片_20230516172400

the main error is
''ROS2 version in 'ros2cs' metadata doesn't match currently sourced version. This is caused by mixing versions/builds. Plugin might not work correctly.''

My ROS2 is humble ,Linux is Ubuntu 22.04.Unity is 2021.6.24f1 personal

Support use_sim_time (equivalent) in ros2cs

The implementation should be rather straightforward.

In ros2, point of interest is time_source.cpp. It involves adding a "/clock" subscription that runs in it's own executor and using it as a time source if the parameter is set (with rcl_set_ros_time_override). This is preceded by resetting clocks and calling rcl_enable_ros_time_override. Since we interface with rcl, we need to replicate the behavior around calling these.

The work is as follows:

  1. Expose API to set use_sim_time (on Ros2cs level)
  2. Make this setting control whether we add a subscriber to "/clock" topic which in callback calls the *ros_time_override api. We would do this internally within Ros2cs. The subscription is best effort, keep last 1.

The current api for getting time should then just work (give system or "/clock" time depending on the parameter).

Unable to build standalone on 22.04 / humble

ros2cs_core fails with the error shown below regarding CycloneDDS.
I've followed the instructions from README-UBUNTU.md, I've installed all possible cyclone related package.

I'm able to build the overlay version & run the tests. I also tried to build the standalone version from the humble22 branch (same issue).

Apologies if this is just user error and/or not related to ros2cs. Any pointers would be appreciated.

--- stderr: ros2cs_core
'patchelf' found in /usr/bin/patchelf
CMake Error at CMakeLists.txt:191 (find_package):
  By not providing "FindCycloneDDS.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "CycloneDDS", but CMake did not find one.

  Could not find a package configuration file provided by "CycloneDDS" with
  any of the following names:

    CycloneDDSConfig.cmake
    cyclonedds-config.cmake

  Add the installation prefix of "CycloneDDS" to CMAKE_PREFIX_PATH or set
  "CycloneDDS_DIR" to a directory containing one of the above files.  If
  "CycloneDDS" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:370 (get_standalone_dependencies)


---
Failed   <<< ros2cs_core [0.39s, exited with code 1]

Unity hangs when client is waiting for service being debugged

Hi,

By calling the desired service with Call(request) from a Unity client, the service implemented on another C++ process executes its callback and builds the response, so that Unity can receive and process it. Under normal conditions the Unity client is always able to process the response, even when the C++ service callback takes time to complete the callback.

If the C++ service callback hits a debugger breakpoint and then gets resumed after some time (20secs), then the Unity client never receives the response and hangs, unable to recover. If the callback gets resumed very early then the Unity client is more likely to receive the response.

This behavior is not observed when calling the service from a C++ or Python client (ex. with rqt).

All ROS2 binaries are built for Windows x64 from ROS2 Humble sources. The connector binaries are also compiled in the same way. Debugging is done with cdb.

This problem is reproduced on multiple machines, with both Windows 10 and Windows 11.

Implement ROS2 actions

Title says it all: it would be cool to support ROS2 actions.

Potentially duplicates RobotecAI/ros2-for-unity#48

I'm currently trying to write this, PR will hopefully follow.

An overview on how the different APIs look so far:

Langague Publisher Service Action
Python
from std_msgs.msg import String

self.create_publisher(String, 'topic', 10)
from example_interfaces.srv import AddTwoInts

self.create_service(AddTwoInts, 'add_two_ints', self.add_two_ints_callback)
from action_tutorials_interfaces.action import Fibonacci

ActionServer(
            self,
            Fibonacci,
            'fibonacci',
            self.execute_callback)
C++
#include "std_msgs/msg/string.hpp"

this->create_publisher<std_msgs::msg::String>("topic", 10);
#include "example_interfaces/srv/add_two_ints.hpp"

this->create_service<example_interfaces::srv::AddTwoInts>("add_two_ints", &add);
#include "action_tutorials_interfaces/action/fibonacci.hpp"

rclcpp_action::create_server<Fibonacci>(
      this,
      "fibonacci",
      std::bind(&FibonacciActionServer::handle_goal, this, _1, _2),
      std::bind(&FibonacciActionServer::handle_cancel, this, _1),
      std::bind(&FibonacciActionServer::handle_accepted, this, _1));
C#
using std_msgs.msg;

node.CreatePublisher<String>("chatter");
using example_interfaces.srv;

node.CreateService<AddTwoInts_Request, AddTwoInts_Response>("add_two_ints", recv_callback);
Missing

Custom message package osn't adding std_msg reference into csproj

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:
... <depend>ros_environment</depend> <depend>std_msgs</depend> ...

But in the output after running colcon in test_assembly_dotnetcore.csproj I get this:
... <ItemGroup> <Reference Include="/home/andrew/ros2cs/install/lib/dotnet/ros2cs_common.dll" /> </ItemGroup> ...

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.

Python libs shouldn't be installed for a standalone build

I have noticed that python libs are installed for Windows and ROS humble standalone build. Based on a comment from CMakeLists, all python libs should be skipped.

I have checked for which path redex for searching python libs doesn't work. It was: C:/opt/ros/humble/x64/Lib/python310.lib. It seems that redex should be changed to .*(libs|Lib)\/python[0-9]*\.lib.

How to compile with NuGet installed packages?

Thank you for releasing this great package, and I look forward to your help with compilation issues.
I have been able to run the ROS2Talker and ROS2Listener examples in win10, and now I need to read the serial port, here is a simple example.

Use dotnet new console to create a project.

C:\dev\KneeBO

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       2021/9/9  下午 10:18           1492 CMakeLists.txt
-a----       2021/9/9  下午 10:24            171 KneeBO.csproj
-a----       2021/9/9  下午 07:16           1163 package.xml
-a----       2021/9/9  下午 08:28            668 Program.cs
  • Program.cs
using System;
using System.IO;
using System.IO.Ports;
using ROS2;

namespace KneeBO
{
    class Program{
        static void Main(string[] args){
            foreach (string portname in SerialPort.GetPortNames()) {
                Console.WriteLine(portname);
            }
        }
    }
}

Where System.IO.Ports is installed through nuget.
To add System.IO.Ports installed with nuget to the project, I modified CMakeLists.txt from the solution given by squareskittles to the following:

  • CMakeLists.txt
cmake_minimum_required(VERSION 3.5)

project(kneebo C)

find_package(ament_cmake REQUIRED)
find_package(ros2cs_common REQUIRED)
find_package(ros2cs_core REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(dotnet_cmake_module REQUIRED)
find_package(rosidl_generator_cs REQUIRED)

set(CSHARP_TARGET_FRAMEWORK "netcoreapp3.1")
find_package(DotNETExtra REQUIRED)

set(_assemblies_dep_dlls
    ${ros2cs_common_ASSEMBLIES_DLL}
    ${ros2cs_core_ASSEMBLIES_DLL}
    ${std_msgs_ASSEMBLIES_DLL}
    ${sensor_msgs_ASSEMBLIES_DLL}
    ${builtin_interfaces_ASSEMBLIES_DLL}
)

add_dotnet_executable(kneebo_talker
  Program.cs
  INCLUDE_DLLS
  ${_assemblies_dep_dlls}
)

set_property(TARGET kneebo_talker
    PROPERTY VS_PACKAGE_REFERENCES
       "System.IO.Ports_5.0.1"
)

ament_package()

My Compilation Steps

mkdir build
cd build
cmake ..
cmake --build . --target INSTALL --config Release

But the following message will appear: a.

C:\dev\KneeBO\Program.cs(12,41): error CS0103: name 'SerialPort' does not exist in the current content [C:\dev\KneeBO\build\kneebo_talker\kneebo_talker_dotnetcore. csproj] [C:\dev\KneeBO\build\kneebo_talker.vcxproj]

I am new to dotnet compilation, and I look forward to your help. Many thanks.

Build script doesn't compile tests

Issue

Calling ./build.sh with --with-tests flag doesn't actually build tests.

Setup

OS: Ubuntu 20.04
ROS2: Foxy

Steps to reproduce

Follow prerequisites and building steps and call ./build.sh --with-tests.

Current behavior

Build process doesn't compile ros2cs_tests package.

Expected behavior

Build process compiles ros2cs_tests package.

Possible soultions

As I came across this issue it seems that calling ./build.sh --with-tests 1 sets tests flag. I find this issue can be changed in at least two ways - changing ./build.sh script or changing instruction (first option preferable).

Build errors on Windows

I originally posted an issue when trying to build ros2-for-unity (that uses ros2cs) here:
RobotecAI/ros2-for-unity#30

But since then, I have realized that that issue should perhaps be added to this repo instead, so I'm posting it here. Sorry for the mix-up in that case. Depending on where it belongs, I can close this or the other issue and we can keep everything in one of them. The issue detailed below:

I have attemted to build from source, carefully following the instructions. I have tried both with a pre-built ROS2 (Foxy) that I installed from: https://ms-iot.github.io/ROSOnWindows/GettingStarted/SetupRos2.html and also with a ROS2 (Galactic) that I built from source myself. Both versions work fine as-is. I use Windows.

When I try to build the ros2-for-unity project, I get the same error message regardless of which ROS2 installation I source prior to starting the build. It seems to be related to generate_cs not beeing found. I get the following error message:

Traceback (most recent call last):
    File "C:\Users\Admin\git\ros2-for-unity\install\lib\rosidl_generator_cs\rosidl_generator_cs", line 23, in <module>
      from rosidl_generator_cs import generate_cs
  ImportError: cannot import name 'generate_cs' from 'rosidl_generator_cs' (unknown location)

I have attached the complete build log, if it helps.
ROS-for-Unity-build-err-ros2algoryx.md

I have done a little bit of digging my self, and noticed that the path in rosidl_generator_cs_module inside src/ros2cs/src/ros2cs/rosidl_generator_cs/bin/rosidl_generator_cs points to a file that does not exists. It points to something like ros2-for-unity\install\lib\rosidl_generator_cs/init.py but the file actually seems to be located at ros2-for-unity\install\lib\site-packages\rosidl_generator_cs/init.py

I tried manually patching this path, and the build now continued a little while longer, but now I get a new error saying :

C:\Users\Admin\git\ros2-for-unity\build\rosgraph_msgs\rosidl_generator_cs\rosgraph_msgs\msg\clock.cs(31,10): error CS0246: The type or namespace name 'builtin_interfaces' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\Admin\git\ros2-for-unity\build\rosgraph_msgs\rosgraph_msgs_assembly\rosgraph_msgs_assembly_dotnetcore.csproj] [C:\Users\Admin\git\ros2-for-unity\build\rosgraph_msgs\rosgraph_msgs_assembly.vcxproj]

  Build FAILED.

So I'm guessing that there may be some other issues as well. I hope this info helps, I would be really exited being able to use ros2-for-unity with custom messages. Let me know if I can help out, I can test certain things here locally for example if it helps.

Best regards,
Josef

support hex format

msg file:

int32 FAULT_OVER_TEMP=0x00000001
...
int32 FAULT_LAST=0x8000000

works fine for c++ but not working in c#. here's the message I get:

Unable to parse field defined as 'FieldDeclaration { Type = uint32, Identifier = FAULT_OVER_TEMP, Value = 0x00000001, IsArray = False, ArrayLength = , InlineComment = , IsUpperBounded = False }': The input string '0x00000001' was not in a correct format.

Rework README

READMEs in ros2cs and ros2-for-unity are highly redundant plus ros2cs one is lagging behind with few changes.

Failed to build on Windows11

Hi.

When I was trying to build ros2cs, I got the following error.

C:\dev\ros2cs>powershell -ExecutionPolicy Bypass ./build.ps1
Build started.
Starting >>> rosidl_default_runtime
Starting >>> dotnet_cmake_module
Starting >>> ament_cmake_export_assemblies
Starting >>> test_interface_files
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22631.
Not searching for unused variables given on the command line.
-- Found ament_cmake: 1.3.6 (C:/humble/install/share/ament_cmake/cmake)
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22631.
-- Found ament_cmake_core: 1.3.6 (C:/humble/install/share/ament_cmake_core/cmake)
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22631.
-- Found ament_cmake: 1.3.6 (C:/humble/install/share/ament_cmake/cmake)
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22631.
-- Found ament_cmake_core: 1.3.6 (C:/humble/install/share/ament_cmake_core/cmake)
-- Configuring done (0.5s)
-- Configuring done (0.5s)
-- Generating done (0.1s)
-- Configuring done (0.5s)
-- Build files have been written to: C:/dev/ros2cs/build/ament_cmake_export_assemblies
-- Generating done (0.1s)
-- Build files have been written to: C:/dev/ros2cs/build/dotnet_cmake_module
-- Generating done (0.1s)
-- Build files have been written to: C:/dev/ros2cs/build/rosidl_default_runtime
-- Configuring done (0.5s)
-- Generating done (0.1s)
.NET Framework ���� Microsoft (R) Build Engine �o�[�W���� 16.11.2+f32259642
Copyright (C) Microsoft Corporation.All rights reserved.

-- Build files have been written to: C:/dev/ros2cs/build/test_interface_files
.NET Framework ���� Microsoft (R) Build Engine �o�[�W���� 16.11.2+f32259642
Copyright (C) Microsoft Corporation.All rights reserved.

.NET Framework ���� Microsoft (R) Build Engine �o�[�W���� 16.11.2+f32259642
Copyright (C) Microsoft Corporation.All rights reserved.

.NET Framework ���� Microsoft (R) Build Engine �o�[�W���� 16.11.2+f32259642
Copyright (C) Microsoft Corporation.All rights reserved.

-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/package_run_dependencies/ament_cmake_export_assemblies
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/parent_prefix_path/ament_cmake_export_assemblies
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/environment/ament_prefix_path.bat
-- Installing: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/environment/ament_prefix_path.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/environment/path.bat
-- Installing: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/environment/path.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/package_run_dependencies/dotnet_cmake_module
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/parent_prefix_path/dotnet_cmake_module
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/local_setup.bat
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/environment/ament_prefix_path.bat
-- Installing: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/local_setup.dsv
-- Installing: C:/dev/ros2cs/install/share/dotnet_cmake_module/environment/ament_prefix_path.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/environment/path.bat
-- Installing: C:/dev/ros2cs/install/share/dotnet_cmake_module/environment/path.dsv
-- Installing: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/package.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/local_setup.bat
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/packages/ament_cmake_export_assemblies
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake/ament_cmake_export_assemblies-extras.cmake
-- Installing: C:/dev/ros2cs/install/share/dotnet_cmake_module/local_setup.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake/ament_cmake_export_assembliesConfig.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake/ament_cmake_export_assembliesConfig-version.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/package.xml
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake/ament_cmake_export_assemblies-extras.cmake.in
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake/ament_cmake_export_assemblies_package_hook.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake/ament_export_assemblies.cmake
-- Installing: C:/dev/ros2cs/install/share/dotnet_cmake_module/package.dsv
Finished <<< ament_cmake_export_assemblies [2.50s]
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/packages/dotnet_cmake_module
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/dotnet_cmake_module-extras.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/dotnet_cmake_moduleConfig.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/dotnet_cmake_moduleConfig-version.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/package.xml
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/ConfigureFile.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/Directory.Build.props.in
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/dotnetcore.csproj.in
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/entry_point.unix.in
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/entry_point.windows.in
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/FindDotNetCore.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/FindMono.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/msbuild.csproj.in
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/packages.config.in
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/UseCSharpProjectBuilder.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/FindCSBuild.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/FindDotNETExtra.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/package_run_dependencies/rosidl_default_runtime
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/parent_prefix_path/rosidl_default_runtime
-- Up-to-date: C:/dev/ros2cs/install/share/rosidl_default_runtime/environment/ament_prefix_path.bat
-- Installing: C:/dev/ros2cs/install/share/rosidl_default_runtime/environment/ament_prefix_path.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/rosidl_default_runtime/environment/path.bat
-- Installing: C:/dev/ros2cs/install/share/rosidl_default_runtime/environment/path.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/rosidl_default_runtime/local_setup.bat
-- Installing: C:/dev/ros2cs/install/share/rosidl_default_runtime/local_setup.dsv
-- Installing: C:/dev/ros2cs/install/share/rosidl_default_runtime/package.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/packages/rosidl_default_runtime
-- Up-to-date: C:/dev/ros2cs/install/share/rosidl_default_runtime/cmake/rosidl_default_runtime-extras.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/rosidl_default_runtime/cmake/rosidl_default_runtimeConfig.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/rosidl_default_runtime/cmake/rosidl_default_runtimeConfig-version.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/rosidl_default_runtime/package.xml
Finished <<< dotnet_cmake_module [3.38s]
Finished <<< rosidl_default_runtime [4.17s]
Starting >>> ros2cs_common
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/Arrays.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/BasicTypes.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/BoundedPlainSequences.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/BoundedSequences.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/Constants.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/Defaults.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/Empty.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/MultiNested.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/Nested.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/Strings.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/UnboundedSequences.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/msg/WStrings.msg
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/srv/Arrays.srv
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/srv/BasicTypes.srv
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/srv/Empty.srv
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/action/Fibonacci.action
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/package_run_dependencies/test_interface_files
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/parent_prefix_path/test_interface_files
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/environment/ament_prefix_path.bat
-- Installing: C:/dev/ros2cs/install/share/test_interface_files/environment/ament_prefix_path.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/environment/path.bat
-- Installing: C:/dev/ros2cs/install/share/test_interface_files/environment/path.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/local_setup.bat
-- Installing: C:/dev/ros2cs/install/share/test_interface_files/local_setup.dsv
-- Installing: C:/dev/ros2cs/install/share/test_interface_files/package.dsv
-- Up-to-date: C:/dev/ros2cs/install/share/ament_index/resource_index/packages/test_interface_files
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/cmake/test_interface_files-extras.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/cmake/test_interface_filesConfig.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/cmake/test_interface_filesConfig-version.cmake
-- Up-to-date: C:/dev/ros2cs/install/share/test_interface_files/package.xml
Finished <<< test_interface_files [3.98s]
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22631.
-- Found ament_cmake: 1.3.6 (C:/humble/install/share/ament_cmake/cmake)
-- Found ament_cmake_export_assemblies: 0.0.0 (C:/dev/ros2cs/install/share/ament_cmake_export_assemblies/cmake)
-- Found dotnet_cmake_module: 0.0.0 (C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake)
CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find DotNetCore (missing: DotNetCore_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/FindDotNetCore.cmake:36 (find_package_handle_standard_args)
  C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/FindCSBuild.cmake:15 (find_package)
  C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/FindDotNETExtra.cmake:16 (find_package)
  CMakeLists.txt:26 (find_package)


-- Configuring incomplete, errors occurred!
--- stderr: ros2cs_common
CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find DotNetCore (missing: DotNetCore_EXECUTABLE)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/dotnet/FindDotNetCore.cmake:36 (find_package_handle_standard_args)
  C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/FindCSBuild.cmake:15 (find_package)
  C:/dev/ros2cs/install/share/dotnet_cmake_module/cmake/Modules/FindDotNETExtra.cmake:16 (find_package)
  CMakeLists.txt:26 (find_package)


---
Failed   <<< ros2cs_common [1.67s, exited with code 1]

Summary: 4 packages finished [9.75s]
  1 package failed: ros2cs_common
  1 package had stderr output: ros2cs_common
  43 packages not processed
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)

I'd be happy to know what to do next.

Thank you.

Possible memory allocation optimization at Utils.cs.

Thank you for this great project.

I see that there is an error string that is being created even when we have RCL_RET_OK at:

string errorString = PtrToString(errorStringPtr);

A small change in a fork of the repo helped me get 0 allocations in ROS2ForUnity dependent code.
It could go upto 0.9 KBs per class per frame which was very high. (Unity Profiler)

The change looks like this:

    internal static string GetRclErrorString(int ret)
    {
      ...
      string errorString = ret > 0 ? PtrToString(errorStringPtr) : String.Empty;
      ...
    }

I haven't looked much inside the codebase but I assume there is some sort of error message stack in the C side that gets
converted to C# string. If I am correct the message needs to be popped otherwise it won't be coherent.
So, this change shouldn't cause any issues? 🤔

Am I correct in my assessment?

Support for NetFramework WPF application

Hi,

Thank you for this tool. I am building the client library to use in Windows 10 OS platform for ROS2 Foxy. I noticed the build is using netcore and not netstandard for building. Is it possible to build the libraries using netstandard and use the dll's in my WPF project?

I tried changing the target framework to netstandart2.0 instead of netcoreapp3.1 and build

set(CSHARP_TARGET_FRAMEWORK "netstandard2.0")
find_package(DotNETExtra REQUIRED)

But when I refer the ros2cs_core, ros2cs_common, std_msgs_assembly in my C# project, I get the following exception

Unhandled exception occurred:System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I think the System.Runtime, Version=4.2.2.0 is a referring to .NETCoreApp.

During the client library build process, is it possible to refer the System.XXXX dll's targeting to netstandard? If yes, could could give a suggestion.

Thanks.

Br,
Visi

The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?

I am building with Ubunutu 22.04 and ROS 2 Humble.
I get the error below and can't build tests. Everything else is fine.

I have had no problems with Ubuntu 20.04 and ROS 2 Galactic before.

nuget package setup looks fine:
~/ros2cs$ dotnet nuget list source
Registered Sources:

  1. nuget.org [Enabled]
    https://api.nuget.org/v3/index.json

Build FAILED.
Errors:

/home/andrew/ros2cs/build/ros2cs_tests/ros2cs_tests/ros2cs_tests_msbuild.csproj (default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->

	/home/andrew/ros2cs/src/ros2cs/ros2cs_tests/src/ClockTest.cs(16,7): error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?
	/home/andrew/ros2cs/src/ros2cs/ros2cs_tests/src/CreateNodeTest.cs(16,7): error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?

Tests fail to build

Hello world,
I tried building with tests on Windows 10 and ROS2 Humble by running build.ps1 -with_tests but it fails with error CS0246: The type or namespace name 'std_msgs' could not be found.
Building without tests works fine.

System.AccessViolationException when calling map_server service

The Issue

I'm trying to make a service call to the nav2 map_server, (calling /map_server/map with nav_msgs/srv/GetMap) to retrieve the current map. This call sometimes works, and sometimes crashes with the log below.

As far as I understand, there is an issue with allocating memory for the OccupancyGrid data field in the GetMap Response. The issue occurs more often/reliably when there is more data to allocate (i.e. when the maps are larger), and if calls are made with higher frequency.

Reproducing

I created an example client on this branch, including instructions and resources on how to reproduce the issue (i.e. how to start the map_server).

On a side note, I also noticed strange behavior when using .Call() instead of .CallAsync(), with .Call() never returning the response and just hanging (irrespectable of the map size) - not sure if/how this is related.

Background

I've originally encountered this issue with Ros2ForUnity (where the issue causes the entire Editor to segfault), but found that it can also be reproduced in ros2cs.

I noticed that the issue reproduces faster when the maps are larger (512x512 immediately kills it on Ubuntu, while 32x32 can be called up to 200 times before crashing). I also noticed that it depends on the calling frequency (calling at 1 Hz seems to work more reliably with 32x32 than 10 Hz, where it crashes sooner). Finally, the issue is a little harder to reproduce on Windows 10, but reliably reproduces when using maps of size 512x512, even at 1 Hz.

System/Setup

I have tried many combinations of using overlay/standalone versions of ros2cs and Ros2ForUnity, both the binary releases from github and my own builds (from current develop branch), but the issue always occurs.

As mentioned - it occurs both on Ubuntu 22.04 and Windows 10 (with the caveat that on Windows, I've only tested inside Unity, not vanilla ros2cs). The windows system is a desktop PC with an AMD Ryzen 5950X and 64GB Memory. The Ubuntu system is a ThinkPad P15v with an Intel Core i7-12700H and 32GB Memory. Both running humble.

Next Steps

I will try to see if I can set up a unit test for this, as it seems to be related to allocating large int arrays (in my current test case, the data field on nav_msgs/OccupancyGrid). Please let me know if there is anything else I can try/do.

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Buffer.Memmove(Byte ByRef, Byte ByRef, UIntPtr)
   at System.Runtime.InteropServices.Marshal.CopyToManaged[[System.Char, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](IntPtr, Char[], Int32, Int32)
   at nav_msgs.msg.OccupancyGrid.ReadNativeMessage(IntPtr)
   at nav_msgs.srv.GetMap_Response.ReadNativeMessage(IntPtr)
   at nav_msgs.srv.GetMap_Response.ReadNativeMessage()
   at ROS2.Client`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ProcessResponse(Int64, ROS2.Internal.MessageInternals)
   at ROS2.Client`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TakeMessage()
   at ROS2.Ros2cs+<>c.<SpinOnce>b__18_1(ROS2.IClientBase)
   at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ForEach(System.Action`1<System.__Canon>)
   at ROS2.Ros2cs.SpinOnce(System.Collections.Generic.List`1<ROS2.INode>, Double)
   at Examples.ROS2MMapServerClient.Main(System.String[])
/home/jan/ros2cs/install/lib/ros2cs_examples/ros2cs_mapserverclient: line 5: 65035 Aborted                 (core dumped) dotnet ${SCRIPTDIR}/dotnet/ros2cs_mapserverclient.dll
[ros2run]: Process exited with failure 134

Automatic tests

Hello,
since this project supports two platforms and two Ros2 Distributions I think it would be beneficial to run the tests automatically when pushing to master to prevent some combinations from being left out and decrease the amount of work required to verify contributions.

I thougt about using Github Actions for this purpose, what do you think?

Windows 11 build with stderr

I wanted to build ros2cs on Windows 11 and it finished but with the following sterr:
Screenshot 2023-09-27 180047
Is there a way to resolve the errors?

Set ros2cs_tests CSHARP_TARGET_FRAMEWORK

Currently the package ros2cs_tests does not set CSHARP_TARGET_FRAMEWORK in cmake leading to the default version being used which can cause unexpected build failures in case of upgrades.

The latest commit in the cmake module for C# changed the default version from netcoreapp3.1 to netstandard2.0 causing the following build failure on Ubuntu 22.04 and Windows 10 with ROS2 Humble:

C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
    All projects are up-to-date for restore.
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
CSC : warning CS1668: Invalid search path 'lib\um\x64' specified in 'LIB environment variable' -- 'directory does not exist' [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(66,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(81,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(101,17): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(123,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(148,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(184,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
  
  Build FAILED.
  
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'NUnit3TestAdapter 3.11.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
CSC : warning CS1668: Invalid search path 'lib\um\x64' specified in 'LIB environment variable' -- 'directory does not exist' [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(66,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(81,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(101,17): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(123,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(148,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
C:\dev\ros2-for-unity\src\ros2cs\src\ros2cs\ros2cs_tests\src\ClientTest.cs(184,13): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests\ros2cs_tests_dotnetcore.csproj] [C:\dev\ros2-for-unity\src\ros2cs\build\ros2cs_tests\ros2cs_tests.vcxproj]
      5 Warning(s)
      6 Error(s)

I suggest setting it to netcoreapp6.0 since the the tests are not distributed as far as I know and netcoreapp3.1 requires dotnet 3.1 which is not available on ubuntu 22.04.

If you agree I could make a PR and update the Windows / Ubuntu Readme.

support constant string

msg file:

string NAME0="string value 0"

works fine for c++ but not working in c#. here's the message I get:

Unable to parse field defined as 'FieldDeclaration { Type = string, Identifier = NAME0, Value = "string value 0", IsArray = False, ArrayLength = , InlineComment = , IsUpperBounded = False }': Invalid constant value type 'string'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.