Initial commit

This commit is contained in:
2026-07-03 16:31:37 +07:00
commit 899c7c637d
1939 changed files with 641750 additions and 0 deletions

View File

@@ -0,0 +1,115 @@
using RobotNet10.Shared.Geometry;
namespace RobotNet10.RobotApp.SLAM.Cartographer;
/// <summary>
/// Sensor configuration
/// </summary>
public class SensorConfiguration
{
/// <summary>
/// Lidar sensor configurations (multiple lidars supported)
/// </summary>
public List<LidarSensorConfiguration> Lidars { get; set; } = [];
/// <summary>
/// IMU sensor configuration (only one IMU supported by CartographerSharp)
/// </summary>
public ImuSensorConfiguration Imu { get; set; } = new();
/// <summary>
/// Sampling ratio for sensor data (0.0 to 1.0)
/// - 1.0 = process all messages (default)
/// - 0.5 = process 50% of messages
/// - 0.0 = process no messages
/// Based on xloc flow: sampling ratio to reduce message overload
/// </summary>
public double? SamplingRatio { get; set; }
/// <summary>
/// Sampling ratio for Lidar data (overrides global SamplingRatio if set)
/// </summary>
public double? LidarSamplingRatio { get; set; }
/// <summary>
/// Sampling ratio for IMU data (overrides global SamplingRatio if set)
/// </summary>
public double? ImuSamplingRatio { get; set; }
/// <summary>
/// Sampling ratio for Odometry data (overrides global SamplingRatio if set)
/// </summary>
public double? OdometrySamplingRatio { get; set; }
/// <summary>
/// Odometry update interval in milliseconds.
/// Odometry is polled at this interval from the odometry estimator.
/// Default: 5ms (200Hz). Lower values = higher frequency, more CPU usage.
/// Recommended: 5-20ms (50-200Hz)
/// </summary>
public int OdometryUpdateIntervalMs { get; set; } = 5;
/// <summary>
/// IMU update interval in milliseconds.
/// IMU data is processed at this minimum interval (rate limiting).
/// Default: 5ms (200Hz). Set to 0 to process all IMU events without rate limiting.
/// Recommended: 0-10ms (100Hz-unlimited)
/// </summary>
public int ImuUpdateIntervalMs { get; set; } = 5;
}
/// <summary>
/// Lidar sensor configuration
/// </summary>
public class LidarSensorConfiguration
{
/// <summary>
/// Device ID from IDeviceProvider
/// </summary>
public string DeviceId { get; set; } = string.Empty;
/// <summary>
/// Enable or disable this lidar
/// </summary>
public bool Enabled { get; set; } = true;
/// <summary>
/// Transform from lidar frame to base_link frame
/// </summary>
public Transform Transform { get; set; }
/// <summary>
/// Minimum angle for filtering point cloud (degrees).
/// Points with angle less than this will be filtered out.
/// If null, no minimum angle filtering is applied.
/// </summary>
public double? AngleMin { get; set; }
/// <summary>
/// Maximum angle for filtering point cloud (degrees).
/// Points with angle greater than this will be filtered out.
/// If null, no maximum angle filtering is applied.
/// </summary>
public double? AngleMax { get; set; }
}
/// <summary>
/// IMU sensor configuration
/// </summary>
public class ImuSensorConfiguration
{
/// <summary>
/// Device ID from IDeviceProvider
/// </summary>
public string DeviceId { get; set; } = string.Empty;
/// <summary>
/// Enable or disable this IMU
/// </summary>
public bool Enabled { get; set; } = false;
/// <summary>
/// Transform from IMU frame to base_link frame
/// </summary>
public Transform Transform { get; set; }
}