ros2-dotnet / ros2_dotnet

.NET bindings for ROS2
Apache License 2.0
136 stars 54 forks source link

Add support for guard conditions #103

Closed hoffmann-stefan closed 1 year ago

hoffmann-stefan commented 1 year ago

extracted from https://github.com/ros2-dotnet/ros2_dotnet/pull/94

This adds support for GuardConditons.

Added public API

namespace ROS2
{
    public sealed class GuardCondition
    {
        public void Trigger();
    }

    public sealed partial class Node
    {
    public GuardCondition CreateGuardCondition(Action callback);
    }
}
hoffmann-stefan commented 1 year ago

This has some problems with Fast DDS, sometimes the GuardCondition doesn't get triggered, see issue #105.

Merging this as at least Cyclone DDS works reliably as far as I can tell. Fixing this for Fast DDS, either in ros2_dotnet or by hunting down the bug in rmw_fastrtps_cpp can be done later on.