17 #include <adore_if_ros_msg/TrafficParticipantSet.h>
18 #include <adore_if_ros_msg/TrafficParticipantSimulation.h>
38 object->detection_by_sensor_ = msg->detection_by_sensor;
39 object->trackingID_ = msg->trackingID;
47 msg->detection_by_sensor =
object.getDetectionBySensor();
48 msg->trackingID =
object.getTrackingID();
55 object->acceleration_x_ = 0.0;
56 object->brakeLight_certainty_ = data.brakeLight_certainty;
57 object->brakeLightsOn_ = data.brakeLightOn;
58 object->center_(0) = data.motion_state.pose.pose.position.x;
59 object->center_(1) = data.motion_state.pose.pose.position.y;
60 object->center_(2) = data.motion_state.pose.pose.position.z;
62 object->classification_certainty_ = data.classification_certainty;
63 object->existance_certainty_ = data.existance_certainty;
64 object->height_ = data.shape.dimensions[data.shape.BOX_Z];
65 object->highBeamCertainty_ = data.highBeam_certainty;
66 object->highBeamOn_ = data.highBeamOn;
67 object->leftIndicator_certainty_ = data.leftIndicator_certainty;
68 object->leftIndicatorOn_ = data.leftIndicatorOn;
69 object->length_ = data.shape.dimensions[data.shape.BOX_X];
70 object->lowBeamCertainty_ = data.lowBeam_certainty;
71 object->lowBeamOn_ = data.lowBeamOn;
72 object->observation_time_ = data.time;
73 object->rightIndicator_certainty_ = data.rightIndicator_certainty;
74 object->rightIndicatorOn_ = data.rightIndicatorOn;
75 object->v2xStationID_ = data.v2xStationID;
76 object->vx_ = data.motion_state.twist.twist.linear.x;
77 object->vy_ = data.motion_state.twist.twist.linear.y;
78 object->width_ = data.shape.dimensions[data.shape.BOX_Y];
81 object->yawrate_ = data.motion_state.twist.twist.angular.z;
88 msg->time =
object.observation_time_;
89 msg->brakeLight_certainty =
object.brakeLight_certainty_;
90 msg->brakeLightOn =
object.brakeLightsOn_;
91 msg->motion_state.pose.pose.position.x =
object.center_(0);
92 msg->motion_state.pose.pose.position.y =
object.center_(1);
93 msg->motion_state.pose.pose.position.z =
object.center_(2);
94 msg->classification.type_id = (char)
object.classification_;
95 msg->classification_certainty =
object.classification_certainty_;
96 msg->existance_certainty =
object.existance_certainty_;
97 msg->shape.dimensions.push_back(
object.length_);
98 msg->shape.dimensions.push_back(
object.width_);
99 msg->shape.dimensions.push_back(
object.height_);
100 msg->highBeam_certainty =
object.highBeamCertainty_;
101 msg->highBeamOn =
object.highBeamOn_;
102 msg->leftIndicator_certainty =
object.leftIndicator_certainty_;
103 msg->leftIndicatorOn =
object.leftIndicatorOn_;
104 msg->lowBeam_certainty =
object.lowBeamCertainty_;
105 msg->lowBeamOn =
object.lowBeamOn_;
106 msg->motion_state.header.stamp.fromSec(
object.observation_time_ );
107 msg->rightIndicator_certainty =
object.rightIndicator_certainty_;
108 msg->rightIndicatorOn =
object.rightIndicatorOn_;
109 msg->v2xStationID =
object.v2xStationID_;
110 msg->motion_state.twist.twist.linear.x =
object.vx_;
111 msg->motion_state.twist.twist.linear.y =
object.vy_;
113 qc.
setHeading(
object.yaw_,msg->motion_state.pose.pose);
114 msg->motion_state.twist.twist.angular.z =
object.yawrate_;
127 for(
auto& entry:msg->data)
131 set->push_back(
object);
136 adore_if_ros_msg::TrafficParticipantSet msg;
139 adore_if_ros_msg::TrafficParticipantDetection pmsg;
141 msg.data.push_back(pmsg);
160 void receive1(adore_if_ros_msg::TrafficParticipantSetConstPtr msg)
166 void receive2(adore_if_ros_msg::TrafficParticipantSetConstPtr msg)
173 TPSetMultiReader(ros::NodeHandle* n,
const std::string& topic1,
const std::string& topic2,
int qsize)
177 n->param(
"/tcp_no_delay", no_delay,
false);
192 for(
const auto& p:
data1_)value.push_back(p);
193 for(
const auto& p:
data2_)value.push_back(p);
208 adore_if_ros_msg::TrafficParticipantSimulation msg;
210 msg.simulationID =
object.getTrackingID();
219 object.trackingID_ = msg->simulationID;
227 object.trackingID_ = msg.simulationID;
247 adore_if_ros_msg::TrafficParticipantDetection msg;
261 adore_if_ros_msg::TrafficParticipant msg;
Definition: trafficparticipantconverter.h:233
void operator()(adore_if_ros_msg::TrafficParticipantDetectionConstPtr msg, adore::env::traffic::Participant *object)
Definition: trafficparticipantconverter.h:238
adore_if_ros_msg::TrafficParticipantDetection operator()(const adore::env::traffic::Participant &object)
Definition: trafficparticipantconverter.h:245
Definition: trafficparticipantconverter.h:254
adore_if_ros_msg::TrafficParticipant operator()(const adore::env::traffic::Participant &object)
Definition: trafficparticipantconverter.h:259
Definition: trafficparticipantconverter.h:119
adore_if_ros_msg::TrafficParticipantSet operator()(const adore::env::traffic::TParticipantSet &set)
Definition: trafficparticipantconverter.h:134
void operator()(adore_if_ros_msg::TrafficParticipantSetConstPtr msg, adore::env::traffic::TParticipantSet *set)
Definition: trafficparticipantconverter.h:124
TPSetMultiReader reads two ros topics and combines data from both.
Definition: trafficparticipantconverter.h:152
ros::Subscriber subscriber2_
Definition: trafficparticipantconverter.h:159
void receive2(adore_if_ros_msg::TrafficParticipantSetConstPtr msg)
Definition: trafficparticipantconverter.h:166
virtual bool hasUpdate() const override
Definition: trafficparticipantconverter.h:185
bool initialized_
Definition: trafficparticipantconverter.h:154
adore::env::traffic::TParticipantSet data2_
Definition: trafficparticipantconverter.h:157
TPSetMultiReader(ros::NodeHandle *n, const std::string &topic1, const std::string &topic2, int qsize)
Definition: trafficparticipantconverter.h:173
virtual void getData(adore::env::traffic::TParticipantSet &value) override
Definition: trafficparticipantconverter.h:189
void receive1(adore_if_ros_msg::TrafficParticipantSetConstPtr msg)
Definition: trafficparticipantconverter.h:160
adore::env::traffic::TParticipantSet data1_
Definition: trafficparticipantconverter.h:156
bool changed_
Definition: trafficparticipantconverter.h:155
virtual bool hasData() const override
Definition: trafficparticipantconverter.h:181
ros::Subscriber subscriber1_
Definition: trafficparticipantconverter.h:158
Definition: trafficparticipantconverter.h:200
void operator()(const adore_if_ros_msg::TrafficParticipantSimulation &msg, adore::env::traffic::Participant &object)
Definition: trafficparticipantconverter.h:224
void operator()(adore_if_ros_msg::TrafficParticipantSimulationConstPtr msg, adore::env::traffic::Participant &object)
Definition: trafficparticipantconverter.h:216
adore_if_ros_msg::TrafficParticipantSimulation operator()(const adore::env::traffic::Participant &object)
Definition: trafficparticipantconverter.h:206
Definition: trafficparticipantconverter.h:30
void decodeTrafficParticipant(const adore_if_ros_msg::TrafficParticipant &data, adore::env::traffic::Participant *object)
Definition: trafficparticipantconverter.h:53
void encodeTrafficParticipantDetection(const adore::env::traffic::Participant &object, adore_if_ros_msg::TrafficParticipantDetection *msg)
Definition: trafficparticipantconverter.h:44
void encodeTrafficParticipant(const adore::env::traffic::Participant &object, adore_if_ros_msg::TrafficParticipant *msg)
Definition: trafficparticipantconverter.h:86
void decodeTrafficParticipantDetection(const adore_if_ros_msg::TrafficParticipantDetection *msg, adore::env::traffic::Participant *object)
Definition: trafficparticipantconverter.h:35
Definition: com_patterns.h:68
std::vector< Participant > TParticipantSet
Definition: participant.h:164
void set(T *data, T value, int size)
Definition: adoremath.h:39
Definition: areaofeffectconverter.h:20
Struct for representing a participant in traffic.
Definition: participant.h:30
EClassification
Definition: participant.h:36
Definition: quaternion.h:28
double quaternionToHeading(const geometry_msgs::Pose &p) const
convert quaternion to heading
Definition: quaternion.h:49
void setHeading(double heading, geometry_msgs::Pose &msg) const
set heading of a Pose message
Definition: quaternion.h:31