Skip to content

Commit 14852f5

Browse files
haoyuanyingjdsika
authored andcommitted
Enable to see the OSMPDummySensor SensorData output in osi-visualizer. (#36)
* Enable to see the OSMPDummySensor SensorData output in osi-visualizer. * Fix whitespace, style issues of candidate addition
1 parent 534763c commit 14852f5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

examples/OSMPDummySensor/OSMPDummySensor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ fmi2Status COSMPDummySensor::doCalc(fmi2Real currentCommunicationPoint, fmi2Real
249249
obj->mutable_base()->mutable_dimension()->set_length(veh.base().dimension().length());
250250
obj->mutable_base()->mutable_dimension()->set_width(veh.base().dimension().width());
251251
obj->mutable_base()->mutable_dimension()->set_height(veh.base().dimension().height());
252+
253+
osi3::DetectedMovingObject::CandidateMovingObject* candidate = obj->add_candidate();
254+
candidate->set_type(veh.type());
255+
candidate->mutable_vehicle_classification()->CopyFrom(veh.vehicle_classification());
256+
candidate->set_probability(1);
257+
252258
normal_log("OSI","Output Vehicle %d[%d] Probability %f Relative Position: %f,%f,%f (%f,%f,%f)",i,veh.id().value(),obj->header().existence_probability(),rel_x,rel_y,rel_z,obj->base().position().x(),obj->base().position().y(),obj->base().position().z());
253259
i++;
254260
} else {

0 commit comments

Comments
 (0)