$darkmode
osi_omni_sensor.cpp File Reference
#include "osi_omni_sensor.hpp"
#include <math.h>
#include <algorithm>
#include <cassert>
#include <map>
#include <Eigen/Geometry>
#include <cloe/component/lane_boundary.hpp>
#include <cloe/component/object.hpp>
#include <cloe/core.hpp>
#include <cloe/simulator.hpp>
#include <cloe/utility/geometry.hpp>
#include "osi_common.pb.h"
#include "osi_detectedobject.pb.h"
#include "osi_hostvehicledata.pb.h"
#include "osi_object.pb.h"
#include "osi_sensordata.pb.h"
#include "osi_sensorview.pb.h"
#include "osi_ground_truth.hpp"
#include "osi_utils.hpp"
Include dependency graph for osi_omni_sensor.cpp:

Functions

Eigen::Isometry3d osii::osi_position_orientation_to_pose_alt (const osi3::BaseMoving &base, const osi3::BaseMoving &base_gt)
 
cloe::Duration osii::osi_timestamp_to_time (const osi3::Timestamp &timestamp)
 
void osii::from_osi_identifier (const osi3::Identifier &osi_id, int &id)
 
void osii::from_osi_host_vehicle_data (const osi3::HostVehicleData &osi_hv, cloe::Object &obj)
 
void osii::from_osi_detected_item_header (const osi3::DetectedItemHeader &osi_hdr, cloe::Object &obj)
 
void osii::from_osi_detected_moving_object (const osi3::DetectedMovingObject &osi_mo, cloe::Object &obj)
 
void osii::from_osi_detected_moving_object_alt (const osi3::DetectedMovingObject &osi_mo, const OsiGroundTruth &ground_truth, cloe::Object &obj)
 
void osii::from_osi_base_moving (const osi3::BaseMoving &osi_bm, cloe::Object &obj)
 
void osii::from_osi_base_moving_alt (const osi3::BaseMoving &osi_bm, const osi3::BaseMoving &osi_bm_gt, cloe::Object &obj)
 
template<typename T >
void osii::from_osi_mov_obj_type_classification (const T &osi_mo, cloe::Object::Class &oc)
 
template void osii::from_osi_mov_obj_type_classification< osi3::MovingObject > (const osi3::MovingObject &osi_mo, cloe::Object::Class &oc)
 
template void osii::from_osi_mov_obj_type_classification< osi3::DetectedMovingObject::CandidateMovingObject > (const osi3::DetectedMovingObject::CandidateMovingObject &osi_mo, cloe::Object::Class &oc)
 
void osii::from_osi_mov_obj_type_classification (const osi3::MovingObject::Type &osi_ot, const osi3::MovingObject::VehicleClassification::Type &osi_vt, cloe::Object::Class &oc)
 
void osii::transform_ego_coord_from_osi_data (const Eigen::Vector3d &dimensions_gt, cloe::Object &obj)
 
void osii::transform_obj_coord_from_osi_data (const Eigen::Isometry3d &sensor_pose, const Eigen::Vector3d &dimensions_gt, cloe::Object &obj)
 

Variables

const std::map< osi3::MovingObject::Type, cloe::Object::Class > osii::osi_mov_obj_type_map
 
const std::map< osi3::MovingObject::VehicleClassification::Type, cloe::Object::Class > osii::osi_mov_veh_class_map
 
const std::map< osi3::LaneBoundary_Classification_Type, cloe::LaneBoundary::Typeosii::osi_lane_bdry_type_map
 
const std::map< int, cloe::LaneBoundary::Colorosii::osi_lane_bdry_color_map
 

Detailed Description

Function Documentation

◆ from_osi_base_moving()

void osii::from_osi_base_moving ( const osi3::BaseMoving &  osi_bm,
cloe::Object obj 
)

Map the OSI data fields without taking care of transformations to the Cloe reference frame convention. Note that the OSI reference frame may differ for different object data types.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_osi_base_moving_alt()

void osii::from_osi_base_moving_alt ( const osi3::BaseMoving &  osi_bm,
const osi3::BaseMoving &  osi_bm_gt,
cloe::Object obj 
)

As from_osi_base_moving, but use ground truth information if required data is not provided by sensor (model).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_osi_host_vehicle_data()

void osii::from_osi_host_vehicle_data ( const osi3::HostVehicleData &  osi_hv,
cloe::Object obj 
)

OSI host vehicle coordinates/orientations are relative to the global ground truth coordinate system. Here, this data is stored in a Cloe object.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ osi_timestamp_to_time()

cloe::Duration osii::osi_timestamp_to_time ( const osi3::Timestamp &  timestamp)

Convert OSI timestamp to Cloe time format.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transform_obj_coord_from_osi_data()

void osii::transform_obj_coord_from_osi_data ( const Eigen::Isometry3d &  sensor_pose,
const Eigen::Vector3d &  dimensions_gt,
cloe::Object obj 
)
Parameters
sensor_poseRelation between the sensor frame and the ego vehicle frame, expressed in the ego vehicle frame.
objWhen enter: Geometric information in ego vehicle frame. When return: Geometric information in sensor frame.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ osi_lane_bdry_color_map

const std::map<int, cloe::LaneBoundary::Color> osii::osi_lane_bdry_color_map
Initial value:
= {
{osi3::LaneBoundary_Classification_Color_COLOR_UNKNOWN, cloe::LaneBoundary::Color::Unknown},
{osi3::LaneBoundary_Classification_Color_COLOR_OTHER, cloe::LaneBoundary::Color::Unknown},
{osi3::LaneBoundary_Classification_Color_COLOR_NONE, cloe::LaneBoundary::Color::Unknown},
{osi3::LaneBoundary_Classification_Color_COLOR_WHITE, cloe::LaneBoundary::Color::White},
{osi3::LaneBoundary_Classification_Color_COLOR_YELLOW, cloe::LaneBoundary::Color::Yellow},
{osi3::LaneBoundary_Classification_Color_COLOR_RED, cloe::LaneBoundary::Color::Red},
{osi3::LaneBoundary_Classification_Color_COLOR_BLUE, cloe::LaneBoundary::Color::Blue},
{osi3::LaneBoundary_Classification_Color_COLOR_GREEN, cloe::LaneBoundary::Color::Green},
{osi3::LaneBoundary_Classification_Color_COLOR_VIOLET, cloe::LaneBoundary::Color::Unknown},
}

Convert from OSI lane boundary colors to Cloe colors.

◆ osi_lane_bdry_type_map

const std::map<osi3::LaneBoundary_Classification_Type, cloe::LaneBoundary::Type> osii::osi_lane_bdry_type_map
Initial value:
= {
{osi3::LaneBoundary_Classification_Type_TYPE_UNKNOWN, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_OTHER, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_NO_LINE, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_SOLID_LINE, cloe::LaneBoundary::Type::Solid},
{osi3::LaneBoundary_Classification_Type_TYPE_DASHED_LINE, cloe::LaneBoundary::Type::Dashed},
{osi3::LaneBoundary_Classification_Type_TYPE_BOTTS_DOTS, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_ROAD_EDGE, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_SNOW_EDGE, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_GRASS_EDGE, cloe::LaneBoundary::Type::Grass},
{osi3::LaneBoundary_Classification_Type_TYPE_GRAVEL_EDGE, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_SOIL_EDGE, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_GUARD_RAIL, cloe::LaneBoundary::Type::Unknown},
{osi3::LaneBoundary_Classification_Type_TYPE_CURB, cloe::LaneBoundary::Type::Curb},
{osi3::LaneBoundary_Classification_Type_TYPE_STRUCTURE, cloe::LaneBoundary::Type::Unknown},
}

Convert from OSI lane boundary types to Cloe types.

◆ osi_mov_obj_type_map

const std::map<osi3::MovingObject::Type, cloe::Object::Class> osii::osi_mov_obj_type_map
Initial value:
= {
{osi3::MovingObject_Type_TYPE_UNKNOWN, cloe::Object::Class::Unknown},
{osi3::MovingObject_Type_TYPE_OTHER, cloe::Object::Class::Unknown},
{osi3::MovingObject_Type_TYPE_ANIMAL, cloe::Object::Class::Unknown},
{osi3::MovingObject_Type_TYPE_PEDESTRIAN, cloe::Object::Class::Pedestrian},
}

Convert from OSI moving object type to Cloe object classification. Note that vehicles are treated explicitly in osi_mov_veh_class_map.

◆ osi_mov_veh_class_map

const std::map<osi3::MovingObject::VehicleClassification::Type, cloe::Object::Class> osii::osi_mov_veh_class_map
Initial value:
= {
{osi3::MovingObject_VehicleClassification_Type_TYPE_UNKNOWN, cloe::Object::Class::Unknown},
{osi3::MovingObject_VehicleClassification_Type_TYPE_OTHER, cloe::Object::Class::Unknown},
{osi3::MovingObject_VehicleClassification_Type_TYPE_SMALL_CAR, cloe::Object::Class::Car},
{osi3::MovingObject_VehicleClassification_Type_TYPE_COMPACT_CAR, cloe::Object::Class::Car},
{osi3::MovingObject_VehicleClassification_Type_TYPE_MEDIUM_CAR, cloe::Object::Class::Car},
{osi3::MovingObject_VehicleClassification_Type_TYPE_LUXURY_CAR, cloe::Object::Class::Car},
{osi3::MovingObject_VehicleClassification_Type_TYPE_DELIVERY_VAN,
cloe::Object::Class::Truck},
{osi3::MovingObject_VehicleClassification_Type_TYPE_HEAVY_TRUCK,
cloe::Object::Class::Truck},
{osi3::MovingObject_VehicleClassification_Type_TYPE_SEMITRAILER,
cloe::Object::Class::Truck},
{osi3::MovingObject_VehicleClassification_Type_TYPE_TRAILER, cloe::Object::Class::Unknown},
{osi3::MovingObject_VehicleClassification_Type_TYPE_MOTORBIKE,
cloe::Object::Class::Motorbike},
{osi3::MovingObject_VehicleClassification_Type_TYPE_BICYCLE, cloe::Object::Class::Bike},
{osi3::MovingObject_VehicleClassification_Type_TYPE_BUS, cloe::Object::Class::Truck},
{osi3::MovingObject_VehicleClassification_Type_TYPE_TRAM, cloe::Object::Class::Unknown},
{osi3::MovingObject_VehicleClassification_Type_TYPE_TRAIN, cloe::Object::Class::Unknown},
{osi3::MovingObject_VehicleClassification_Type_TYPE_WHEELCHAIR,
cloe::Object::Class::Unknown},
}

Convert from OSI moving vehicle type to Cloe object classification. Note that objects other than vehicles are treated explicitly in osi_mov_obj_type_map.