20 #include <unordered_map>
71 std::unordered_map<adore::env::traffic::Participant::TTrackingID,adore::env::traffic::Participant>
participants_;
86 bool in_collision =
false;
99 auto& ego = ego_it->second;
100 auto& egopos = ego.getCenter();
101 const double Re = std::sqrt(ego.getWidth()*ego.getWidth()+ego.getLength()*ego.getLength())*0.5;
106 auto& other = it.second;
107 auto& otherpos = other.getCenter();
108 const double Ro = std::sqrt(other.getWidth()*other.getWidth()+other.getLength()*other.getLength())*0.5;
109 auto d = otherpos-egopos;
110 if(std::sqrt(d(0)*d(0)+d(1)*d(1)+d(2)*d(2))-Re-Ro<0.0)
A class, which monitors for collisions between ego and other objects.
Definition: monitor0.h:67
adore::env::AFactory::TPropositionWriter * proposition_writer_
Definition: monitor0.h:70
std::unordered_map< adore::env::traffic::Participant::TTrackingID, adore::env::traffic::Participant > participants_
Definition: monitor0.h:71
void run()
Definition: monitor0.h:83
CollisionMonitor(adore::sim::AFactory::TParticipantFeed *participant_feed, adore::env::AFactory::TPropositionWriter *proposition_writer, adore::env::traffic::Participant::TTrackingID egoID)
Definition: monitor0.h:74
adore::env::traffic::Participant::TTrackingID egoID_
Definition: monitor0.h:72
adore::sim::AFactory::TParticipantFeed * participant_feed_
Definition: monitor0.h:69
A class, which monitors distance between vehicle and goal.
Definition: monitor0.h:31
adore::env::AFactory::TPropositionWriter * proposition_writer_
Definition: monitor0.h:35
void run()
Definition: monitor0.h:46
adore::env::AFactory::TVehicleMotionStateReader * position_reader_
Definition: monitor0.h:34
adore::env::AFactory::TNavigationGoalReader * goal_reader_
Definition: monitor0.h:33
GoalAttainmentMonitor(adore::env::AFactory::TNavigationGoalReader *goal_reader, adore::env::AFactory::TVehicleMotionStateReader *position_reader, adore::env::AFactory::TPropositionWriter *proposition_writer)
Definition: monitor0.h:37
Definition: monitor0.h:126
adore::env::AFactory::TVehicleMotionStateReader * position_reader_
Definition: monitor0.h:131
Monitor0(adore::env::AFactory *envFactory, adore::sim::AFactory *simFactory, int simulationID)
Definition: monitor0.h:135
GoalAttainmentMonitor * goalAttainmentMonitor_
Definition: monitor0.h:132
adore::env::AFactory::TPropositionWriter * proposition_writer_
Definition: monitor0.h:129
adore::env::AFactory::TNavigationGoalReader * goal_reader_
Definition: monitor0.h:130
adore::sim::AFactory::TParticipantFeed * participant_feed_
Definition: monitor0.h:128
void run()
Definition: monitor0.h:153
virtual ~Monitor0()
Definition: monitor0.h:148
CollisionMonitor * collisionMonitor_
Definition: monitor0.h:133
abstract factory for adore::env communication
Definition: afactory.h:41
virtual TPropositionWriter * getPropositionWriter()=0
virtual TNavigationGoalReader * getNavigationGoalReader()=0
virtual TVehicleMotionStateReader * getVehicleMotionStateReader()=0
virtual void getNext(T &value)=0
virtual bool hasNext() const =0
virtual void getData(T &value)=0
virtual bool hasData() const =0
Definition: com_patterns.h:97
virtual void write(const T &value)=0
abstract factory for adore::sim communication
Definition: afactory.h:43
virtual TParticipantFeed * getParticipantFeed()=0
get state updates from all vehicles
Definition: areaofeffectconverter.h:20
A logical proposition, with a possible timeout for the information.
Definition: proposition.h:27
This struct holds the motion state of the vehicle in 9d.
Definition: vehiclemotionstate9d.h:39
double getX() const
Get the x-coordinate.
Definition: vehiclemotionstate9d.h:54
double getY() const
Get the y-coordinate.
Definition: vehiclemotionstate9d.h:60
double getZ() const
Get the z-coordinate.
Definition: vehiclemotionstate9d.h:66
Struct for representing a participant in traffic.
Definition: participant.h:30
TTrackingID getTrackingID() const
Definition: participant.h:109
int TTrackingID
Definition: participant.h:32
Definition: navigationgoal.h:26
adore::mad::GlobalPosition target_
Definition: navigationgoal.h:28
double z_
Definition: globalposition.h:23
double x_
Definition: globalposition.h:23
double y_
Definition: globalposition.h:23