Compile with more warnings enabled

This commit is contained in:
nsubiron 2019-04-23 12:13:34 +02:00
parent 00cdad57c6
commit 4f3b000225
18 changed files with 280 additions and 260 deletions

View File

@ -8,7 +8,14 @@
#include "carla/Buffer.h"
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wold-style-cast"
#endif
#include "moodycamel/ConcurrentQueue.h"
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
#include <memory>

View File

@ -80,8 +80,6 @@ namespace detail {
class SharedException : public std::exception {
public:
SharedException(const SharedException &) = default;
SharedException(std::shared_ptr<std::exception> e)
: _exception(std::move(e)) {}

View File

@ -30,8 +30,6 @@ namespace geom {
GeoLocation() = default;
GeoLocation(const GeoLocation &) = default;
GeoLocation(double latitude, double longitude, double altitude)
: latitude(latitude),
longitude(longitude),

View File

@ -31,8 +31,6 @@ namespace geom {
Vector2D() = default;
Vector2D(const Vector2D &) = default;
Vector2D(float ix, float iy)
: x(ix),
y(iy) {}
@ -152,7 +150,7 @@ namespace geom {
}
#endif // LIBCARLA_INCLUDED_FROM_UE4
MSGPACK_DEFINE_ARRAY(x, y)
};

View File

@ -33,8 +33,6 @@ namespace geom {
Vector3D() = default;
Vector3D(const Vector3D &) = default;
Vector3D(float ix, float iy, float iz)
: x(ix),
y(iy),

View File

@ -52,41 +52,43 @@ namespace parser {
// Lane Road Mark
int road_mark_id = 0;
for (pugi::xml_node lane_road_mark : lane_node.children("roadMark")) {
pugi::xml_node road_mark_type;
{
const double s_offset = lane_road_mark.attribute("sOffset").as_double();
const std::string type = lane_road_mark.attribute("type").value();
const std::string weight = lane_road_mark.attribute("weight").value();
const std::string color = lane_road_mark.attribute("color").value();
const std::string material = lane_road_mark.attribute("material").value();
const double width = lane_road_mark.attribute("width").as_double();
const std::string lane_change = lane_road_mark.attribute("laneChange").value();
const double height = lane_road_mark.attribute("height").as_double();
const double s_offset = lane_road_mark.attribute("sOffset").as_double();
const std::string type = lane_road_mark.attribute("type").value();
const std::string weight = lane_road_mark.attribute("weight").value();
const std::string color = lane_road_mark.attribute("color").value();
const std::string material = lane_road_mark.attribute("material").value();
const double width = lane_road_mark.attribute("width").as_double();
const std::string lane_change = lane_road_mark.attribute("laneChange").value();
const double height = lane_road_mark.attribute("height").as_double();
// Call map builder for LaneRoadMarkType
// Call map builder for LaneRoadMarkType
std::string type_name = "";
double type_width = 0.0;
road_mark_type = lane_road_mark.child("type");
if (road_mark_type) {
type_name = road_mark_type.attribute("name").value();
type_width = road_mark_type.attribute("width").as_double();
}
std::string type_name = "";
double type_width = 0.0;
pugi::xml_node road_mark_type = lane_road_mark.child("type");
if (road_mark_type) {
type_name = road_mark_type.attribute("name").value();
type_width = road_mark_type.attribute("width").as_double();
// Call map builder for LaneRoadMark
map_builder.CreateRoadMark(
lane,
road_mark_id,
s_offset + s,
type,
weight,
color,
material,
width,
lane_change,
height,
type_name,
type_width);
}
// Call map builder for LaneRoadMark
map_builder.CreateRoadMark(
lane,
road_mark_id,
s_offset + s,
type,
weight,
color,
material,
width,
lane_change,
height,
type_name,
type_width);
for (pugi::xml_node road_mark_type_line_node : road_mark_type.children("line")) {
const double length = road_mark_type_line_node.attribute("length").as_double();

View File

@ -36,224 +36,224 @@ namespace parser {
}
void ObjectParser::Parse(
const pugi::xml_document &xml,
const pugi::xml_document & /*xml*/,
carla::road::MapBuilder & /* map_builder */) {
throw_exception(std::runtime_error("ObjectParser not ready"));
// Extracting the OpenDRIVE
pugi::xml_node opendrive_node = xml.child("OpenDRIVE");
for (pugi::xml_node road_node = opendrive_node.child("road");
road_node;
road_node = road_node.next_sibling("road")) {
const RoadID road_id = (RoadID) road_node.attribute("id").value();
const pugi::xml_node objects_node = road_node.child("objects");
for (pugi::xml_node object_node = objects_node.child("object");
object_node;
object_node = object_node.next_sibling("object")) {
const std::string type = object_node.attribute("type").value();
const std::string name = object_node.attribute("name").value();
const ObjectID object_id = object_node.attribute("id").value();
const double s_position = object_node.attribute("s").as_double();
const double t_position = object_node.attribute("t").as_double();
const double z_offset = object_node.attribute("zOffset").as_double();
const double valid_length = object_node.attribute("validLength").as_double();
const std::string orientation = object_node.attribute("orientation").value();
const double lenght = object_node.attribute("lenght").as_double();
const double width = object_node.attribute("width").as_double();
const double radius = object_node.attribute("radius").as_double();
const double height = object_node.attribute("height").as_double();
const double hdg = object_node.attribute("hdg").as_double();
const double pitch = object_node.attribute("pitch").as_double();
const double roll = object_node.attribute("roll").as_double();
/*map_builder.AddObjectInRoad(road_id, type, name, object_id,
s_position, t_position, z_offset, valid_length,
orientation, lenght, width, radius, height, hdg, pitch, roll);*/
log_debug("AddObjectInRoad",
road_id,
type,
name,
object_id,
s_position,
t_position,
z_offset,
valid_length,
orientation,
lenght,
width,
radius,
height,
hdg,
pitch,
roll);
for (pugi::xml_node repeat_node = object_node.child("repeat");
repeat_node;
repeat_node = repeat_node.next_sibling("repeat")) {
const double s_position_rep = repeat_node.attribute("s").as_double();
const double lenght_rep = repeat_node.attribute("lenght").as_double();
const double distance_rep = repeat_node.attribute("distance").as_double();
const double t_start_rep = repeat_node.attribute("tStart").as_double();
const double t_end_rep = repeat_node.attribute("tEnd").as_double();
const double width_start_rep = repeat_node.attribute("widthStart").as_double();
const double width_end_rep = repeat_node.attribute("widthEnd").as_double();
const double height_start_rep = repeat_node.attribute("heightStart").as_double();
const double z_offset_start_rep = repeat_node.attribute("zOffsetStart").as_double();
const double z_offset_end_rep = repeat_node.attribute("zOffsetEnd").as_double();
/*map_builder.AddRepeatRecordInObject(object_id, s_position_rep,
lenght_rep, t_start_rep,
t_start_rep, t_end_rep, width_start_rep, width_end_rep,
height_start_rep, z_offset_start_rep,
z_offset_end_rep);
*/
log_debug("AddRepeatRecordInObject", object_id, s_position_rep, lenght_rep, distance_rep,
t_start_rep, t_end_rep, width_start_rep, width_end_rep, height_start_rep, z_offset_start_rep,
z_offset_end_rep);
// pugi::xml_node opendrive_node = xml.child("OpenDRIVE");
// for (pugi::xml_node road_node = opendrive_node.child("road");
// road_node;
// road_node = road_node.next_sibling("road")) {
// const RoadID road_id = static_cast<RoadID>(road_node.attribute("id").value());
// const pugi::xml_node objects_node = road_node.child("objects");
// for (pugi::xml_node object_node = objects_node.child("object");
// object_node;
// object_node = object_node.next_sibling("object")) {
// const std::string type = object_node.attribute("type").value();
// const std::string name = object_node.attribute("name").value();
// const ObjectID object_id = object_node.attribute("id").value();
// const double s_position = object_node.attribute("s").as_double();
// const double t_position = object_node.attribute("t").as_double();
// const double z_offset = object_node.attribute("zOffset").as_double();
// const double valid_length = object_node.attribute("validLength").as_double();
// const std::string orientation = object_node.attribute("orientation").value();
// const double lenght = object_node.attribute("lenght").as_double();
// const double width = object_node.attribute("width").as_double();
// const double radius = object_node.attribute("radius").as_double();
// const double height = object_node.attribute("height").as_double();
// const double hdg = object_node.attribute("hdg").as_double();
// const double pitch = object_node.attribute("pitch").as_double();
// const double roll = object_node.attribute("roll").as_double();
// /*map_builder.AddObjectInRoad(road_id, type, name, object_id,
// s_position, t_position, z_offset, valid_length,
// orientation, lenght, width, radius, height, hdg, pitch, roll);*/
// log_debug("AddObjectInRoad",
// road_id,
// type,
// name,
// object_id,
// s_position,
// t_position,
// z_offset,
// valid_length,
// orientation,
// lenght,
// width,
// radius,
// height,
// hdg,
// pitch,
// roll);
// for (pugi::xml_node repeat_node = object_node.child("repeat");
// repeat_node;
// repeat_node = repeat_node.next_sibling("repeat")) {
// const double s_position_rep = repeat_node.attribute("s").as_double();
// const double lenght_rep = repeat_node.attribute("lenght").as_double();
// const double distance_rep = repeat_node.attribute("distance").as_double();
// const double t_start_rep = repeat_node.attribute("tStart").as_double();
// const double t_end_rep = repeat_node.attribute("tEnd").as_double();
// const double width_start_rep = repeat_node.attribute("widthStart").as_double();
// const double width_end_rep = repeat_node.attribute("widthEnd").as_double();
// const double height_start_rep = repeat_node.attribute("heightStart").as_double();
// const double z_offset_start_rep = repeat_node.attribute("zOffsetStart").as_double();
// const double z_offset_end_rep = repeat_node.attribute("zOffsetEnd").as_double();
// /*map_builder.AddRepeatRecordInObject(object_id, s_position_rep,
// lenght_rep, t_start_rep,
// t_start_rep, t_end_rep, width_start_rep, width_end_rep,
// height_start_rep, z_offset_start_rep,
// z_offset_end_rep);
// */
// log_debug("AddRepeatRecordInObject", object_id, s_position_rep, lenght_rep, distance_rep,
// t_start_rep, t_end_rep, width_start_rep, width_end_rep, height_start_rep, z_offset_start_rep,
// z_offset_end_rep);
}
pugi::xml_node outline_node = object_node.child("outline");
for (pugi::xml_node corner_road_node = outline_node.child("cornerRoad");
corner_road_node;
corner_road_node = corner_road_node.next_sibling("cornerRoad")) {
const double s_position_corner_road = corner_road_node.attribute("s").as_double();
const double t_position_corner_road = corner_road_node.attribute("t").as_double();
const double dz_position_corner_road = corner_road_node.attribute("dz").as_double();
const double height_position_corner_road = corner_road_node.attribute("height").as_double();
/*
map_builder.AddCornerRoadToObject(object_id,
s_position_corner_road, t_position_corner_road,
dz_position_corner_road, height_position_corner_road);
*/
log_debug("AddCornerRoadToObject", object_id, s_position_corner_road, t_position_corner_road,
dz_position_corner_road, height_position_corner_road);
}
for (pugi::xml_node corner_local_node = outline_node.child("cornerLocal");
corner_local_node;
corner_local_node = corner_local_node.next_sibling("cornerLocal")) {
const double u_coordinate_corner_local = corner_local_node.attribute("u").as_double();
const double v_coordinate_corner_local = corner_local_node.attribute("v").as_double();
const double z_coordinate_corner_local = corner_local_node.attribute("z").as_double();
const double height_corner_local = corner_local_node.attribute("height").as_double();
/*
map_builder.AddCornerLocalToObject(object_id,
u_coordinate_corner_local, v_coordinate_corner_local,
z_coordinate_corner_local, height_corner_local);
*/
log_debug("AddCornerLocalToObject", object_id, u_coordinate_corner_local, v_coordinate_corner_local,
z_coordinate_corner_local, height_corner_local);
}
pugi::xml_node material_node = object_node.child("material");
if (material_node != nullptr) {
const std::string surface_material = material_node.attribute("surface").value();
const double friction_material = material_node.attribute("friction").as_double();
const double roughness_material = material_node.attribute("roughness").as_double();
/*
map_builder.AddMaterialToObject(object_id, surface_material,
friction_material, roughness_material);
*/
log_debug("AddMaterialToObject", object_id, surface_material, friction_material,
roughness_material);
}
// }
// pugi::xml_node outline_node = object_node.child("outline");
// for (pugi::xml_node corner_road_node = outline_node.child("cornerRoad");
// corner_road_node;
// corner_road_node = corner_road_node.next_sibling("cornerRoad")) {
// const double s_position_corner_road = corner_road_node.attribute("s").as_double();
// const double t_position_corner_road = corner_road_node.attribute("t").as_double();
// const double dz_position_corner_road = corner_road_node.attribute("dz").as_double();
// const double height_position_corner_road = corner_road_node.attribute("height").as_double();
// /*
// map_builder.AddCornerRoadToObject(object_id,
// s_position_corner_road, t_position_corner_road,
// dz_position_corner_road, height_position_corner_road);
// */
// log_debug("AddCornerRoadToObject", object_id, s_position_corner_road, t_position_corner_road,
// dz_position_corner_road, height_position_corner_road);
// }
// for (pugi::xml_node corner_local_node = outline_node.child("cornerLocal");
// corner_local_node;
// corner_local_node = corner_local_node.next_sibling("cornerLocal")) {
// const double u_coordinate_corner_local = corner_local_node.attribute("u").as_double();
// const double v_coordinate_corner_local = corner_local_node.attribute("v").as_double();
// const double z_coordinate_corner_local = corner_local_node.attribute("z").as_double();
// const double height_corner_local = corner_local_node.attribute("height").as_double();
// /*
// map_builder.AddCornerLocalToObject(object_id,
// u_coordinate_corner_local, v_coordinate_corner_local,
// z_coordinate_corner_local, height_corner_local);
// */
// log_debug("AddCornerLocalToObject", object_id, u_coordinate_corner_local, v_coordinate_corner_local,
// z_coordinate_corner_local, height_corner_local);
// }
// pugi::xml_node material_node = object_node.child("material");
// if (material_node != nullptr) {
// const std::string surface_material = material_node.attribute("surface").value();
// const double friction_material = material_node.attribute("friction").as_double();
// const double roughness_material = material_node.attribute("roughness").as_double();
// /*
// map_builder.AddMaterialToObject(object_id, surface_material,
// friction_material, roughness_material);
// */
// log_debug("AddMaterialToObject", object_id, surface_material, friction_material,
// roughness_material);
// }
/* AddValidity(object_node, "validity", object_id,
([&map_builder](const ObjectID &object_id, const int16_t from_lane,
const int16_t to_lane)
{ map_builder.AddValidityToObject(object_id, from_lane,
to_lane);})); */
// /* AddValidity(object_node, "validity", object_id,
// ([&map_builder](const ObjectID &object_id, const int16_t from_lane,
// const int16_t to_lane)
// { map_builder.AddValidityToObject(object_id, from_lane,
// to_lane);})); */
pugi::xml_node parking_space_node = object_node.child("parkingSpace");
if (parking_space_node != nullptr) {
const std::string access_parking = parking_space_node.attribute("access").value();
const std::string restrictions_parking = parking_space_node.attribute("restrictions").value();
/*
map_builder.AddParkingSpaceToObject(object_id, access_parking,
restrictions_parking);
*/
log_debug("AddParkingSpaceToObject", object_id, access_parking, restrictions_parking);
}
for (pugi::xml_node marking_node = parking_space_node.child("marking");
marking_node;
marking_node = marking_node.next_sibling("marking")) {
const std::string side_marking = marking_node.attribute("side").value();
const std::string type_marking = marking_node.attribute("type").value();
const double width_marking = marking_node.attribute("width").as_double();
const std::string color_marking = marking_node.attribute("color").value();
/*
Problem, there is no "Parking ID" or anything similar... how do we
link them?
map_builder.AddMarkingToParkingSpace(side_marking, type_marking,
width_marking, color_marking);
*/
log_debug("AddMarkingToParkingSpace", side_marking, type_marking,
width_marking, color_marking);
}
for (pugi::xml_node obj_reference_node = object_node.child("objectReference");
obj_reference_node;
obj_reference_node = obj_reference_node.next_sibling("objectReference")) {
const double s_position_obj_ref = obj_reference_node.attribute("s").as_double();
const double t_position_obj_ref = obj_reference_node.attribute("t").as_double();
const ObjectID id_obj_ref = obj_reference_node.attribute("id").value();
const double z_offset_obj_ref = obj_reference_node.attribute("zOffset").as_double();
const double valid_lenght_obj_ref = obj_reference_node.attribute("validLenght").as_double();
const std::string orientation_obj_ref = obj_reference_node.attribute("orientation").value();
/*
map_builder.AddObjectReferenceToObject(object_id,
s_position_obj_ref, t_position_obj_ref,
id_obj_ref, z_offset_obj_ref, valid_lenght_obj_ref,
orientation_obj_ref);
*/
log_debug("AddObjectReferenceToObject", object_id, s_position_obj_ref, t_position_obj_ref,
id_obj_ref, z_offset_obj_ref, valid_lenght_obj_ref, orientation_obj_ref);
/* AddValidity(obj_reference_node, "validity", id_obj_ref,
([&map_builder](const ObjectID &id_obj_ref, const int16_t
from_lane, const int16_t to_lane)
{ map_builder.AddValidityToObjectRef(id_obj_ref, from_lane,
to_lane);})); */
}
// pugi::xml_node parking_space_node = object_node.child("parkingSpace");
// if (parking_space_node != nullptr) {
// const std::string access_parking = parking_space_node.attribute("access").value();
// const std::string restrictions_parking = parking_space_node.attribute("restrictions").value();
// /*
// map_builder.AddParkingSpaceToObject(object_id, access_parking,
// restrictions_parking);
// */
// log_debug("AddParkingSpaceToObject", object_id, access_parking, restrictions_parking);
// }
// for (pugi::xml_node marking_node = parking_space_node.child("marking");
// marking_node;
// marking_node = marking_node.next_sibling("marking")) {
// const std::string side_marking = marking_node.attribute("side").value();
// const std::string type_marking = marking_node.attribute("type").value();
// const double width_marking = marking_node.attribute("width").as_double();
// const std::string color_marking = marking_node.attribute("color").value();
// /*
// Problem, there is no "Parking ID" or anything similar... how do we
// link them?
// map_builder.AddMarkingToParkingSpace(side_marking, type_marking,
// width_marking, color_marking);
// */
// log_debug("AddMarkingToParkingSpace", side_marking, type_marking,
// width_marking, color_marking);
// }
// for (pugi::xml_node obj_reference_node = object_node.child("objectReference");
// obj_reference_node;
// obj_reference_node = obj_reference_node.next_sibling("objectReference")) {
// const double s_position_obj_ref = obj_reference_node.attribute("s").as_double();
// const double t_position_obj_ref = obj_reference_node.attribute("t").as_double();
// const ObjectID id_obj_ref = obj_reference_node.attribute("id").value();
// const double z_offset_obj_ref = obj_reference_node.attribute("zOffset").as_double();
// const double valid_lenght_obj_ref = obj_reference_node.attribute("validLenght").as_double();
// const std::string orientation_obj_ref = obj_reference_node.attribute("orientation").value();
// /*
// map_builder.AddObjectReferenceToObject(object_id,
// s_position_obj_ref, t_position_obj_ref,
// id_obj_ref, z_offset_obj_ref, valid_lenght_obj_ref,
// orientation_obj_ref);
// */
// log_debug("AddObjectReferenceToObject", object_id, s_position_obj_ref, t_position_obj_ref,
// id_obj_ref, z_offset_obj_ref, valid_lenght_obj_ref, orientation_obj_ref);
// /* AddValidity(obj_reference_node, "validity", id_obj_ref,
// ([&map_builder](const ObjectID &id_obj_ref, const int16_t
// from_lane, const int16_t to_lane)
// { map_builder.AddValidityToObjectRef(id_obj_ref, from_lane,
// to_lane);})); */
// }
}
for (pugi::xml_node tunnel_node = objects_node.child("tunnel");
tunnel_node;
tunnel_node = tunnel_node.next_sibling("tunnel")) {
const double s_position_tunnel = tunnel_node.attribute("s").as_double();
const double lenght_tunnel = tunnel_node.attribute("lenght").as_double();
const std::string name_tunnel = tunnel_node.attribute("name").value();
const ObjectID id_tunnel = tunnel_node.attribute("id").value();
const std::string type_tunnel = tunnel_node.attribute("type").value();
const double lightning_tunnel = tunnel_node.attribute("lightning").as_double();
const double daylight_tunnel = tunnel_node.attribute("daylight").as_double();
/*
map_builder.AddTunnel(s_position_tunnel, lenght_tunnel, name_tunnel,
id_tunnel,
type_tunnel, lightning_tunnel, daylight_tunnel);
*/
log_debug("AddTunnel", s_position_tunnel, lenght_tunnel, name_tunnel, id_tunnel,
type_tunnel, lightning_tunnel, daylight_tunnel);
/* AddValidity(tunnel_node, "validity", id_tunnel,
([&map_builder](const ObjectID &id_tunnel, const int16_t from_lane,
const int16_t to_lane)
{ map_builder.AddValidityToTunnel(id_tunnel, from_lane,
to_lane);})); */
}
for (pugi::xml_node bridge_node = objects_node.child("bridge");
bridge_node;
bridge_node = bridge_node.next_sibling("bridge")) {
const double s_position_bridge = bridge_node.attribute("s").as_double();
const double lenght_bridge = bridge_node.attribute("lenght").as_double();
const std::string name_bridge = bridge_node.attribute("name").value();
const ObjectID id_bridge = bridge_node.attribute("id").value();
const std::string type_bridge = bridge_node.attribute("type").value();
/*
map_builder.AddBridge(s_position_bridge, lenght_bridge, name_bridge,
id_bridge,
type_bridge);
*/
log_debug("AddTunnel", s_position_bridge, lenght_bridge, name_bridge, id_bridge,
type_bridge);
/*AddValidity(bridge_node, "validity", id_bridge,
([&map_builder](const ObjectID &id_bridge, const int16_t from_lane,
const int16_t to_lane)
{ map_builder.AddValidityToBridge(id_bridge, from_lane,
to_lane);}));*/
}
}
// }
// for (pugi::xml_node tunnel_node = objects_node.child("tunnel");
// tunnel_node;
// tunnel_node = tunnel_node.next_sibling("tunnel")) {
// const double s_position_tunnel = tunnel_node.attribute("s").as_double();
// const double lenght_tunnel = tunnel_node.attribute("lenght").as_double();
// const std::string name_tunnel = tunnel_node.attribute("name").value();
// const ObjectID id_tunnel = tunnel_node.attribute("id").value();
// const std::string type_tunnel = tunnel_node.attribute("type").value();
// const double lightning_tunnel = tunnel_node.attribute("lightning").as_double();
// const double daylight_tunnel = tunnel_node.attribute("daylight").as_double();
// /*
// map_builder.AddTunnel(s_position_tunnel, lenght_tunnel, name_tunnel,
// id_tunnel,
// type_tunnel, lightning_tunnel, daylight_tunnel);
// */
// log_debug("AddTunnel", s_position_tunnel, lenght_tunnel, name_tunnel, id_tunnel,
// type_tunnel, lightning_tunnel, daylight_tunnel);
// /* AddValidity(tunnel_node, "validity", id_tunnel,
// ([&map_builder](const ObjectID &id_tunnel, const int16_t from_lane,
// const int16_t to_lane)
// { map_builder.AddValidityToTunnel(id_tunnel, from_lane,
// to_lane);})); */
// }
// for (pugi::xml_node bridge_node = objects_node.child("bridge");
// bridge_node;
// bridge_node = bridge_node.next_sibling("bridge")) {
// const double s_position_bridge = bridge_node.attribute("s").as_double();
// const double lenght_bridge = bridge_node.attribute("lenght").as_double();
// const std::string name_bridge = bridge_node.attribute("name").value();
// const ObjectID id_bridge = bridge_node.attribute("id").value();
// const std::string type_bridge = bridge_node.attribute("type").value();
// /*
// map_builder.AddBridge(s_position_bridge, lenght_bridge, name_bridge,
// id_bridge,
// type_bridge);
// */
// log_debug("AddTunnel", s_position_bridge, lenght_bridge, name_bridge, id_bridge,
// type_bridge);
// /*AddValidity(bridge_node, "validity", id_bridge,
// ([&map_builder](const ObjectID &id_bridge, const int16_t from_lane,
// const int16_t to_lane)
// { map_builder.AddValidityToBridge(id_bridge, from_lane,
// to_lane);}));*/
// }
// }
}
} // namespace parser
} // namespace opendrive

View File

@ -44,14 +44,14 @@ namespace parser {
for (pugi::xml_node road_node = opendrive_node.child("road");
road_node;
road_node = road_node.next_sibling("road")) {
const RoadID road_id = (RoadID) road_node.attribute("id").as_int();
const RoadID road_id = static_cast<RoadID>(road_node.attribute("id").as_int());
const pugi::xml_node signals_node = road_node.child("signals");
for (pugi::xml_node signal_node = signals_node.child("signal");
signal_node;
signal_node = signal_node.next_sibling("signal")) {
const double s_position = signal_node.attribute("s").as_double();
const double t_position = signal_node.attribute("t").as_double();
const SignalID signal_id = (SignalID) signal_node.attribute("id").as_int();
const SignalID signal_id = static_cast<SignalID>(signal_node.attribute("id").as_int());
const std::string name = signal_node.attribute("name").value();
const std::string dynamic = signal_node.attribute("dynamic").value();
const std::string orientation = signal_node.attribute("orientation").value();

View File

@ -11933,7 +11933,7 @@ namespace pugi
assert(_result.error);
}
PUGI__FN const char* xpath_exception::what() const throw()
PUGI__FN const char* xpath_exception::what() const noexcept
{
return _result.error;
}

View File

@ -1265,7 +1265,7 @@ namespace pugi
explicit xpath_exception(const xpath_parse_result& result);
// Get error message
virtual const char* what() const throw() PUGIXML_OVERRIDE;
virtual const char* what() const noexcept PUGIXML_OVERRIDE;
// Get parse result
const xpath_parse_result& result() const;

View File

@ -29,6 +29,15 @@ namespace element {
class RoadInfoVisitor {
public:
RoadInfoVisitor() = default;
virtual ~RoadInfoVisitor() = default;
RoadInfoVisitor(const RoadInfoVisitor &) = default;
RoadInfoVisitor(RoadInfoVisitor &&) = default;
RoadInfoVisitor &operator=(const RoadInfoVisitor &) = default;
RoadInfoVisitor &operator=(RoadInfoVisitor &&) = default;
virtual void Visit(RoadInfoElevation &) {}
virtual void Visit(RoadInfoGeometry &) {}
virtual void Visit(RoadInfoLane &) {}

View File

@ -9,6 +9,8 @@
#include <carla/RecurrentSharedFuture.h>
#include <carla/ThreadGroup.h>
using namespace std::chrono_literals;
TEST(recurrent_shared_future, use_case) {
using namespace carla;
ThreadGroup threads;

View File

@ -16,6 +16,7 @@
#include <thread>
using namespace carla::rpc;
using namespace std::chrono_literals;
TEST(rpc, compilation_tests) {
Server server(TESTING_PORT);

View File

@ -17,6 +17,8 @@
#include <atomic>
using namespace std::chrono_literals;
// This is required for low level to properly stop the threads in case of
// exception/assert.
class io_service_running {
@ -242,7 +244,7 @@ TEST(streaming, multi_stream) {
}
std::this_thread::sleep_for(6ms);
for (auto i = 0u; i < number_of_messages; ++i) {
for (auto j = 0u; j < number_of_messages; ++j) {
std::this_thread::sleep_for(6ms);
stream << message;
}

View File

@ -12,6 +12,7 @@
#include <algorithm>
using namespace carla::streaming;
using namespace std::chrono_literals;
static auto make_special_message(size_t size) {
std::vector<uint32_t> v(size/sizeof(uint32_t), 42u);

View File

@ -22,5 +22,3 @@
#include <iostream>
constexpr uint16_t TESTING_PORT = 0u;
using namespace std::chrono_literals;

View File

@ -39,8 +39,11 @@ def get_libcarla_extensions():
os.path.join(pwd, 'dependencies/lib/libboost_filesystem.a'),
os.path.join(pwd, 'dependencies/lib', pylib)]
extra_compile_args = [
'-isystem', 'dependencies/include/system',
'-fPIC', '-std=c++14', '-Werror', '-Wall', '-Wextra',
'-isystem', 'dependencies/include/system', '-fPIC', '-std=c++14',
'-Werror', '-Wall', '-Wextra', '-Wpedantic',
'-Wdeprecated', '-Wno-shadow', '-Wuninitialized', '-Wunreachable-code',
'-Wpessimizing-move', '-Wold-style-cast', '-Wnull-dereference',
'-Wduplicate-enum', '-Wnon-virtual-dtor', '-Wheader-hygiene',
'-DBOOST_ERROR_CODE_HEADER_ONLY', '-DLIBCARLA_WITH_PYTHON_SUPPORT'
]
if 'TRAVIS' in os.environ and os.environ['TRAVIS'] == 'true':

View File

@ -310,7 +310,10 @@ set(CMAKE_C_COMPILER ${CC})
set(CMAKE_CXX_COMPILER ${CXX})
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -std=c++14 -pthread -fPIC" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Wpedantic" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wdeprecated -Wshadow -Wuninitialized -Wunreachable-code" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wpessimizing-move -Wold-style-cast -Wnull-dereference" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "\${CMAKE_CXX_FLAGS} -Wduplicate-enum -Wnon-virtual-dtor -Wheader-hygiene" CACHE STRING "" FORCE)
# @todo These flags need to be compatible with setup.py compilation.
set(CMAKE_CXX_FLAGS_RELEASE_CLIENT "\${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -std=c++14 -Wno-missing-braces -DBOOST_ERROR_CODE_HEADER_ONLY -DLIBCARLA_WITH_PYTHON_SUPPORT" CACHE STRING "" FORCE)