Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for guard conditions #103

Merged

Conversation

hoffmann-stefan
Copy link
Member

@hoffmann-stefan hoffmann-stefan commented May 15, 2023

extracted from #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);
    }
}

This avoids doing unnecessary allocations of native ROS messages only to check
that there is no new data. This might be a good thing to do right now as with
guard_conditions there could be probably more times the waitset is ready to fire
some callbacks, so work should be minimized here especially.
@hoffmann-stefan
Copy link
Member Author

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.

@hoffmann-stefan hoffmann-stefan merged commit b512c24 into ros2-dotnet:main May 19, 2023
@hoffmann-stefan hoffmann-stefan deleted the feature/guard-conditions branch May 19, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant