wip(env_monitor): raw scan sampling for intrusion detector, env brake blocks controller only
- CostmapEnvironment::sampleScans: raw LaserScan + fixed-frame poses for detectors that need scans (EnvNeeds.scans); recovery deps carry SensorReader for EvadeRecovery - EnvMonitor brake now blocks only VelocitySource::kController; a latched kContact brake no longer zeroes the evade back-up command in RECOVERING (sim 27/11 14:21) - test: LatchedBrakeDoesNotZeroTheRecoveryVelocity - config/runtime: env_monitor, recovery_behaviors, priest_mpcc, lane_route, global costmap plugin keys in progress Not built or tested yet.
This commit is contained in:
@@ -472,6 +472,9 @@ private:
|
||||
bool has_last_plan_applied_ = false;
|
||||
|
||||
// --- EnvMonitor -------------------------------------------------------------------------------
|
||||
env_monitor_core::EnvNeeds env_needs_;
|
||||
std::vector<env_monitor_core::EnvScan> env_scan_scratch_;
|
||||
std::vector<std::pair<double, double>> env_footprint_scratch_;
|
||||
env_monitor_core::EnvVerdict env_verdict_; ///< verdict của cycle này (vào state machine + trọng tài).
|
||||
EnvGeometry env_geometry_; ///< mẫu nặng gần nhất (giữ giữa hai tick 5 Hz để log/ghi).
|
||||
robot::Time last_env_heavy_;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define MOVE_BASE2_NAVIGATION_RUNTIME_H_
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -107,6 +108,8 @@ public:
|
||||
tf_ = tf;
|
||||
}
|
||||
|
||||
void setSensorReader(const robot_sensor_ports::SensorReader* reader) { sensors_ = reader; }
|
||||
bool sampleScans(const std::vector<std::string>& topics, env_monitor_core::EnvSample& out) override;
|
||||
void refresh() override;
|
||||
bool sampleGeometry(const EnvGeometryRequest& request, EnvGeometry& out) override;
|
||||
bool sweepTrajectory(const EnvTrajectoryRequest& request, SweepResult& out,
|
||||
@@ -119,6 +122,8 @@ private:
|
||||
|
||||
robot_costmap_2d::Costmap2DROBOT* costmap_ = nullptr;
|
||||
std::shared_ptr<tf3::BufferCore> tf_;
|
||||
const robot_sensor_ports::SensorReader* sensors_ = nullptr; ///< Non-owning.
|
||||
std::map<std::string, bool> scan_failed_;
|
||||
GridScratch scratch_; ///< chỉ control thread dùng
|
||||
std::vector<robot_geometry_msgs::PoseStamped> traj_scratch_; ///< quỹ đạo đã quy về frame lưới
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <robot_geometry_msgs/PoseStamped.h>
|
||||
#include <robot_nav_2d_msgs/Path2D.h>
|
||||
|
||||
#include <env_monitor_core/env_types.h>
|
||||
#include <move_base2/core/grid_analysis.h>
|
||||
#include <move_base2/core/navigation_request.h>
|
||||
|
||||
@@ -132,6 +133,14 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Raw scans and fixed-frame poses; false means footprint or base pose unavailable.
|
||||
virtual bool sampleScans(const std::vector<std::string>& topics, env_monitor_core::EnvSample& out)
|
||||
{
|
||||
(void)topics;
|
||||
(void)out;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// @brief Thân robot từ footprint KHÔNG đệm của costmap. false = không có.
|
||||
virtual bool robotBodyExtents(double& front, double& rear, double& side) const
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
namespace robot_costmap_2d { class Costmap2DROBOT; }
|
||||
namespace tf3 { class BufferCore; }
|
||||
namespace robot_sensor_ports { class SensorReader; }
|
||||
|
||||
namespace move_base2
|
||||
{
|
||||
@@ -71,6 +72,9 @@ public:
|
||||
|
||||
/// TF buffer dùng chung của runtime, cho behavior cần đổi frame (họ path). Có thể null.
|
||||
tf3::BufferCore* tf = nullptr;
|
||||
|
||||
/// Kho sensor dùng chung, cho behavior đọc scan thô (EvadeRecovery). Có thể null.
|
||||
const robot_sensor_ports::SensorReader* sensors = nullptr;
|
||||
};
|
||||
|
||||
RecoveryRunner() = default;
|
||||
|
||||
Reference in New Issue
Block a user