File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ namespace controller {
42
42
namespace events {
43
43
44
44
DEFINE_NIL_EVENT (Failure, " failure" , " assertion failure in simulation" )
45
- DEFINE_NIL_EVENT (Collision, " collision" , " collision detected in simulation" )
46
45
DEFINE_NIL_EVENT (Irrational, " irrational" , " irrational behavior in simulation" )
46
+ DEFINE_NIL_EVENT (Unsafe, " unsafe" , " safety critical behavior in simulation" )
47
47
48
48
} // namespace events
49
49
@@ -166,6 +166,13 @@ class SafetyChecker : public Checker {
166
166
prev_step_ = s.step ();
167
167
}
168
168
169
+ void enroll (Registrar& r) override { callback_ = r.register_event <events::UnsafeFactory>(); }
170
+
171
+ void fail (const Sync& s, std::string&& name, Json&& j) override {
172
+ callback_->trigger (s);
173
+ Checker::fail (s, std::move (name), std::move (j));
174
+ }
175
+
169
176
void check (const Sync& s, const Vehicle& v) override {
170
177
auto ego =
171
178
utility::EgoSensorCanon (v.get <const EgoSensor>(CloeComponent::GROUNDTRUTH_EGO_SENSOR));
@@ -226,6 +233,8 @@ class SafetyChecker : public Checker {
226
233
// State:
227
234
double prev_mps_{0.0 };
228
235
size_t prev_step_{0 };
236
+
237
+ std::shared_ptr<events::UnsafeCallback> callback_;
229
238
};
230
239
231
240
struct VirtueConfiguration : public Confable {
You can’t perform that action at this time.
0 commit comments