20 #include <unordered_set>
74 auto pos = tp.getCenter();
75 auto psi = tp.getYaw();
76 const double abcd = tp.getLength();
77 const double c = 0.2 * abcd;
78 const double d = 0.2 * abcd;
79 const double L = abcd-c-d;
80 const double w = tp.getWidth();
81 pos(0) = pos(0) +
cos(psi)*(-0.5*abcd+d);
82 pos(1) = pos(1) +
sin(psi)*(-0.5*abcd+d);
86 plotPosition(ss.str(),pos(0),pos(1),psi,L,c,d,
w*0.5,tp.getVx(),tp.getVy(),
"LineColor=0,0,0",tp.getClassification(),tp.getTrackingID(),tp.getStationID());
115 void plotPosition(
const std::string& name,
double gX,
double gY,
double psi,
double L,
double c,
double d,
double w,
double vx,
double vy,
const std::string& options,
adore::env::traffic::Participant::EClassification participant_type,
int id,
int v2xid = 0)
118 auto rho = length*0.5-d;
123 auto m_targetZoom = 20.0;
125 std::string s = name+
"/texture";
126 std::stringstream image;
127 if(v2xid==111)image<<
"../images/viewcar2.png";
128 else if(v2xid==222)image<<
"../images/FASCarE.png";
135 if(image.str().size()>0)
145 double v = std::sqrt(vx*vx+vy*vy);
146 double cv = v>0.1?vx/v:0.0;
147 double sv = v>0.1?vy/v:0.0;
150 double ascale = 0.2 * vscale;
151 double ax = -v * ca * ascale - v * sa * ascale;
152 double ay = -v * sa * ascale + v * ca * ascale;
177 X[11] = gX +
std::cos(psi) * (b + vx*vscale - cv * ax - sv * ay) -
std::sin(psi) * (vy*vscale -sv * ax + cv * ay);
178 Y[11] = gY +
std::sin(psi) * (b + vx*vscale - cv * ax - sv * ay) +
std::cos(psi) * (vy*vscale -sv * ax + cv * ay);
181 X[13] = gX +
std::cos(psi) * (b + vx*vscale - cv * ax + sv * ay) -
std::sin(psi) * (vy*vscale -sv * ax - cv * ay);
182 Y[13] = gY +
std::sin(psi) * (b + vx*vscale - cv * ax + sv * ay) +
std::cos(psi) * (vy*vscale -sv * ax - cv * ay);
183 std::string s2 = name+
"/outline";
a optimzed plotting application to plot other traffic
Definition: plot_traffic.h:32
PlotTraffic(DLR_TS::PlotLab::AFigureStub *figure, std::string prefix, bool debug_plot_ids)
Definition: plot_traffic.h:47
std::unordered_set< std::string > plot_tags_current_
Definition: plot_traffic.h:38
void plotPosition(const std::string &name, double gX, double gY, double psi, double L, double c, double d, double w, double vx, double vy, const std::string &options, adore::env::traffic::Participant::EClassification participant_type, int id, int v2xid=0)
plotting a vehicle
Definition: plot_traffic.h:115
bool debug_plot_ids_
Definition: plot_traffic.h:35
std::unordered_set< std::string > plot_tags_old_
Definition: plot_traffic.h:37
~PlotTraffic()
Definition: plot_traffic.h:55
std::string app_tag_
Definition: plot_traffic.h:44
adore::env::AFactory::TParticipantSetReader * trafficReader_
Definition: plot_traffic.h:34
DLR_TS::PlotLab::AFigureStub * figure_
Definition: plot_traffic.h:40
std::string prefix_
Definition: plot_traffic.h:43
void run()
Definition: plot_traffic.h:59
virtual TParticipantSetReader * getTrafficParticipantSetReader()=0
static adore::env::AFactory * get()
Definition: afactory.h:236
Definition: com_patterns.h:68
virtual void getData(T &value)=0
virtual bool hasUpdate() const =0
std::vector< Participant > TParticipantSet
Definition: participant.h:164
interval< T > cos(interval< T > x)
Definition: intervalarithmetic.h:225
interval< T > sin(interval< T > x)
Definition: intervalarithmetic.h:204
z
Definition: adore_set_goal.py:32
w
Definition: adore_set_pose.py:40
Definition: areaofeffectconverter.h:20
EClassification
Definition: participant.h:36
@ BUS
Definition: participant.h:49
@ PEDESTRIAN_GROUP
Definition: participant.h:56
@ TRUCK
Definition: participant.h:50
@ CAR
Definition: participant.h:47
@ HEAVY_TRUCK
Definition: participant.h:52
@ PEDESTRIAN
Definition: participant.h:42