{"id":23661418,"url":"https://github.com/stephenhidem/godot-ant-grpc","last_synced_at":"2026-05-04T08:34:12.345Z","repository":{"id":273757585,"uuid":"909168800","full_name":"StephenHidem/GODOT-ANT-GRPC","owner":"StephenHidem","description":"Example that demonstrates integration of ANT and gRPC with Godot game development.","archived":false,"fork":false,"pushed_at":"2025-01-22T19:04:45.000Z","size":10485,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T18:17:43.779Z","etag":null,"topics":["ant","godot","grpc"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StephenHidem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-27T23:08:17.000Z","updated_at":"2025-01-22T19:04:49.000Z","dependencies_parsed_at":"2025-01-22T20:29:49.666Z","dependency_job_id":null,"html_url":"https://github.com/StephenHidem/GODOT-ANT-GRPC","commit_stats":null,"previous_names":["stephenhidem/godot-ant-grpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StephenHidem/GODOT-ANT-GRPC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenHidem%2FGODOT-ANT-GRPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenHidem%2FGODOT-ANT-GRPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenHidem%2FGODOT-ANT-GRPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenHidem%2FGODOT-ANT-GRPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StephenHidem","download_url":"https://codeload.github.com/StephenHidem/GODOT-ANT-GRPC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephenHidem%2FGODOT-ANT-GRPC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265175523,"owners_count":23722657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant","godot","grpc"],"created_at":"2024-12-29T04:57:49.100Z","updated_at":"2025-10-31T16:01:59.875Z","avatar_url":"https://github.com/StephenHidem.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Godot ANT gRPC Demo\nThe demo project uses the ANT+ gRPC service to connect to ANT devices and\ndisplay the data in the Godot project. Logging is output to the Godot editor\nconsole for debugging purposes.\n## Prerequisites\n- Godot v4.3.stable.mono.official\n- Visual Studio Community 2022\n- Clone this demo project\n- Clone the [ANT+ repo](https://github.com/StephenHidem/AntPlus)\n### Optional for Simulating ANT Devices\n- 2 ANT+ USB Sticks. The second stick is used to simulate ANT devices.\n- [SimulANT+](https://www.thisisant.com/developer/resources/downloads/) for simulating ANT devices\n## Setup\n1. Install the ANT+ USB sticks and drivers if needed\n1. Build the ANT+ solution in Visual Studio\n1. Run the ANT+ project AntGrpcService\n    -  Select the HTTPS option\n1. Run SimulANT+ and select one of the supported ANT devices, e.g., Heart Rate Monitor or Bike Power\n1. Run the demo project in Godot\n# New Project Setup\n1. Create a new Godot project\n1. Add a top-level node to the scene and name it `Main`\n1. Add a new C# script to the `Main` node\n1. Open the solution in Visual Studio\n1. Add the following NuGet packages to the project:\n\t- `SmallEarthTech.AntPlus.Extensions.Hosting`\n\t- `Grpc.Net.Client`\n\t- `Google.Protobuf`\n\t- `Godot.DependencyInjection` - This package adds support for logging and dependency injection\n1. Right-click Dependencies in the Solution Explorer and select Add Reference.\n1. Click browse and select AntGrpcShared.dll (netstandard2.1\\debug or netstandard2.1\\release build) from the cloned AntPlus solution.\n1. Add the following code to the Main.cs script constructor:\n```csharp\npublic Main()\n{\n    // create the host\n    _host = Host.CreateDefaultBuilder(_options).\n        UseAntPlus().   // add ANT libraries and hosting extensions to services\n        ConfigureServices(services =\u003e\n        {\n            // add the ANT radio service and cancellation token to signal app termination\n            services.AddSingleton\u003cIAntRadio, AntRadioService\u003e();\n            services.AddSingleton(_cancellationTokenSource);\n\n            // add Godot services\n            services.AddGodotServices();\n        }).\n        Build();\n\n    // get the ANT radio service\n    _antRadioService = _host.Services.GetRequiredService\u003cIAntRadio\u003e() as AntRadioService;\n\n    // get the ANT device collection\n    _antDevices = _host.Services.GetRequiredService\u003cAntCollection\u003e();\n\n    // get the _logger\n    _logger = _host.Services.GetRequiredService\u003cILogger\u003cMain\u003e\u003e();\n}\n```\n9. Add the following code to the Main.cs script `_Ready` method:\n```csharp\npublic override void _Ready()\n{\n    // SETUP ANY GODOT NODES HERE\n\n    // search for an ANT radio server on the local network\n    _ = Task.Run(async () =\u003e\n    {\n        try\n        {\n            await _antRadioService.FindAntRadioServerAsync();\n\n            _antDevices.CollectionChanged += AntDevices_CollectionChanged;\n\n            // IMPORTANT: Initiate scanning on a background thread.\n            await _antDevices.StartScanning();\n        }\n        catch (OperationCanceledException)\n        {\n            _logger.LogInformation(\"OperationCanceledException: Exiting game.\");\n        }\n    });\n}\n```\n10. Add a CollectionChanged event handler to the Main.cs script:\n```csharp\nprivate void AntDevices_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)\n{\n    // handle the ANT device collection changes\n    switch (e.Action)\n    {\n        case NotifyCollectionChangedAction.Add:\n            foreach (var device in e.NewItems)\n            {\n                // handle the new device\n                _logger.LogInformation($\"New device: {device}\");\n            }\n            break;\n        case NotifyCollectionChangedAction.Remove:\n            foreach (var device in e.OldItems)\n            {\n                // handle the removed device\n                _logger.LogInformation($\"Removed device: {device}\");\n            }\n            break;\n        case NotifyCollectionChangedAction.Reset:\n            // handle the reset\n            _logger.LogInformation(\"Device collection reset.\");\n            break;\n    }\n}\n```\nProvide methods to manage collection changes, such as adding or removing devices.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhidem%2Fgodot-ant-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenhidem%2Fgodot-ant-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhidem%2Fgodot-ant-grpc/lists"}