LaserSafetyFilter: scan-based emergency brake + evasive turn before cmd publish

This commit is contained in:
cyy
2026-07-03 08:17:16 +00:00
parent 14809af5f6
commit e0aa66dff8
4 changed files with 83 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
#pragma once
#include "car_nav_lite/types.hpp"
namespace car_nav_lite {
// Fast scan-based safety filter. Runs every frame before publishing cmd_vel.
// Checks if the planned command would hit anything in the latest scan.
struct LaserSafetyFilter {
bool enable = true;
double front_width = 0.30; // half-width of front safety zone (m)
double stop_dist = 0.35; // brake distance (m)
double slow_dist = 0.70; // slow-down distance (m)
double turn_wz = 0.8; // evasive turn rate (rad/s)
double max_range = 2.0; // max lookahead (m)
Twist filter(const Twist& cmd, const LaserScan& scan) const;
};
} // namespace car_nav_lite