Initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using CartographerSharp.Mapping;
|
||||
using RobotNet10.RobotApp.SLAM.Cartographer;
|
||||
|
||||
namespace RobotNet10.RobotApp.SLAM.Cartographer;
|
||||
|
||||
public static class CartographerExtensions
|
||||
{
|
||||
extension(IServiceCollection services)
|
||||
{
|
||||
public IServiceCollection AddCartographer(IConfigurationSection configuration)
|
||||
{
|
||||
// Cartographer / Localization services
|
||||
services.Configure<CartographerConfiguration>(configuration);
|
||||
|
||||
// Core Cartographer service (singleton - manages state machine, MapBuilder, sensor pipeline, localization, and occupancy grid)
|
||||
// Also implements IHostedService to start automatically
|
||||
services.AddSingleton<CartographerService>();
|
||||
services.AddSingleton<ISLAMService>(sp => sp.GetRequiredService<CartographerService>());
|
||||
services.AddHostedService(sp => sp.GetRequiredService<CartographerService>());
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user