Skip to content

Commit 843fa93

Browse files
committed
remove issues section and leave only passing tests
1 parent 19f21fb commit 843fa93

File tree

1 file changed

+0
-161
lines changed

1 file changed

+0
-161
lines changed

simulation/traffic_simulator/test/src/entity/test_entity_base.cpp

Lines changed: 0 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -774,105 +774,6 @@ TEST(EntityBase, getDistanceToLeftLaneBound)
774774
EXPECT_NEAR(distance_result, distance_actual, 0.1);
775775
}
776776

777-
TEST(EntityBase, getDistanceToRightLaneBound)
778-
{
779-
// see issue 1 at the end of this file
780-
const double lane_width = 3.0;
781-
const double entity_center_offset = -0.5;
782-
lanelet::Id id_previous = 34666;
783-
lanelet::Id id = 120659;
784-
lanelet::Id id_next = 120660;
785-
786-
auto hdmap_utils_ptr = makeHdMapUtilsSharedPointer();
787-
auto pose = makeCanonicalizedLaneletPose(hdmap_utils_ptr, id);
788-
auto bbox = makeBoundingBox(entity_center_offset);
789-
auto status = makeCanonicalizedEntityStatus(hdmap_utils_ptr, pose, bbox);
790-
791-
DummyEntity dummy("dummy_entity", status, hdmap_utils_ptr);
792-
dummy.setRouteLanelets({id_previous, id, id_next});
793-
794-
auto distance_result = dummy.getDistanceToRightLaneBound();
795-
double distance_actual = (lane_width - bbox.dimensions.y) / 2 + entity_center_offset;
796-
EXPECT_NEAR(distance_result, distance_actual, 0.1);
797-
}
798-
799-
TEST(EntityBase, getDistanceToLaneBound)
800-
{
801-
// see issue 1 at the end of this file
802-
const double lane_width = 3.0;
803-
const double entity_center_offset = -0.5;
804-
lanelet::Id id_previous = 34666;
805-
lanelet::Id id = 120659;
806-
lanelet::Id id_next = 120660;
807-
808-
auto hdmap_utils_ptr = makeHdMapUtilsSharedPointer();
809-
auto pose = makeCanonicalizedLaneletPose(hdmap_utils_ptr, id);
810-
auto bbox = makeBoundingBox(entity_center_offset);
811-
auto status = makeCanonicalizedEntityStatus(hdmap_utils_ptr, pose, bbox);
812-
813-
DummyEntity dummy("dummy_entity", status, hdmap_utils_ptr);
814-
dummy.setRouteLanelets({id_previous, id, id_next});
815-
816-
auto distance_result = dummy.getDistanceToLaneBound();
817-
double distance_actual = std::min(
818-
(lane_width - bbox.dimensions.y) / 2 - entity_center_offset,
819-
(lane_width - bbox.dimensions.y) / 2 + entity_center_offset);
820-
EXPECT_NEAR(distance_result, distance_actual, 0.1);
821-
}
822-
823-
TEST(EntityBase, getDistanceToLeftLaneBound_empty)
824-
{
825-
// fix is to be implemented, 2nd issue
826-
lanelet::Id id = 120659;
827-
828-
auto hdmap_utils_ptr = makeHdMapUtilsSharedPointer();
829-
auto pose = makeCanonicalizedLaneletPose(hdmap_utils_ptr, id);
830-
auto bbox = makeBoundingBox();
831-
auto status = makeCanonicalizedEntityStatus(hdmap_utils_ptr, pose, bbox);
832-
833-
DummyEntity dummy("dummy_entity", status, hdmap_utils_ptr);
834-
auto ids = std::vector<lanelet::Id>{};
835-
836-
// auto left = dummy.getDistanceToLeftLaneBound(ids);
837-
838-
throw std::runtime_error("Fix not implemented");
839-
}
840-
841-
TEST(EntityBase, getDistanceToRightLaneBound_empty)
842-
{
843-
// fix is to be implemented, 2nd issue
844-
lanelet::Id id = 120659;
845-
846-
auto hdmap_utils_ptr = makeHdMapUtilsSharedPointer();
847-
auto pose = makeCanonicalizedLaneletPose(hdmap_utils_ptr, id);
848-
auto bbox = makeBoundingBox();
849-
auto status = makeCanonicalizedEntityStatus(hdmap_utils_ptr, pose, bbox);
850-
851-
DummyEntity dummy("dummy_entity", status, hdmap_utils_ptr);
852-
auto ids = std::vector<lanelet::Id>{};
853-
854-
// auto right = dummy.getDistanceToRightLaneBound(ids);
855-
throw std::runtime_error("Fix not implemented");
856-
}
857-
858-
TEST(EntityBase, getDistanceToLaneBound_empty)
859-
{
860-
// fix is to be implemented, 2nd issue
861-
lanelet::Id id = 120659;
862-
863-
auto hdmap_utils_ptr = makeHdMapUtilsSharedPointer();
864-
auto pose = makeCanonicalizedLaneletPose(hdmap_utils_ptr, id);
865-
auto bbox = makeBoundingBox();
866-
auto status = makeCanonicalizedEntityStatus(hdmap_utils_ptr, pose, bbox);
867-
868-
DummyEntity dummy("dummy_entity", status, hdmap_utils_ptr);
869-
auto ids = std::vector<lanelet::Id>{};
870-
871-
// auto distance = dummy.getDistanceToLaneBound(ids);
872-
873-
throw std::runtime_error("Fix not implemented");
874-
}
875-
876777
TEST(EntityBase, getDistanceToLeftLaneBound_many)
877778
{
878779
const double entity_center_offset = -0.5;
@@ -892,46 +793,6 @@ TEST(EntityBase, getDistanceToLeftLaneBound_many)
892793
EXPECT_NEAR(distance_result, distance_actual, 0.1);
893794
}
894795

895-
TEST(EntityBase, getDistanceToRightLaneBound_many)
896-
{
897-
// typo, 1st issue
898-
const double entity_center_offset = -0.5;
899-
lanelet::Id id_0 = 120659;
900-
lanelet::Id id_1 = 120659;
901-
902-
auto hdmap_utils_ptr = makeHdMapUtilsSharedPointer();
903-
auto pose = makeCanonicalizedLaneletPose(hdmap_utils_ptr, id_0);
904-
auto bbox = makeBoundingBox(entity_center_offset);
905-
auto status = makeCanonicalizedEntityStatus(hdmap_utils_ptr, pose, bbox);
906-
907-
DummyEntity dummy("dummy_entity", status, hdmap_utils_ptr);
908-
909-
lanelet::Ids ids{id_0, id_1};
910-
auto distance_result = dummy.getDistanceToRightLaneBound(ids);
911-
auto distance_actual = dummy.getDistanceToRightLaneBound(id_0);
912-
EXPECT_NEAR(distance_result, distance_actual, 0.1);
913-
}
914-
915-
TEST(EntityBase, getDistanceToLaneBound_many)
916-
{
917-
// typo, 1st issue
918-
const double entity_center_offset = -0.5;
919-
lanelet::Id id_0 = 120659;
920-
lanelet::Id id_1 = 120659;
921-
922-
auto hdmap_utils_ptr = makeHdMapUtilsSharedPointer();
923-
auto pose = makeCanonicalizedLaneletPose(hdmap_utils_ptr, id_0);
924-
auto bbox = makeBoundingBox(entity_center_offset);
925-
auto status = makeCanonicalizedEntityStatus(hdmap_utils_ptr, pose, bbox);
926-
927-
DummyEntity dummy("dummy_entity", status, hdmap_utils_ptr);
928-
929-
lanelet::Ids ids{id_0, id_1};
930-
auto distance_result = dummy.getDistanceToLaneBound(ids);
931-
auto distance_actual = dummy.getDistanceToLaneBound(id_0);
932-
EXPECT_NEAR(distance_result, distance_actual, 0.1);
933-
}
934-
935796
TEST(EntityBase, getLaneletPose_notOnRoadAndCrosswalkPedestrian)
936797
{
937798
auto hdmap_utils = makeHdMapUtilsSharedPointer();
@@ -1077,25 +938,3 @@ TEST(EntityBase, getMapPoseFromRelativePose_relative)
1077938
auto ref_pose = makeCanonicalizedLaneletPose(hdmap_utils, id, s);
1078939
EXPECT_POSE_NEAR(result_pose, static_cast<geometry_msgs::msg::Pose>(ref_pose), eps);
1079940
}
1080-
1081-
/*
1082-
ISSUES:
1083-
1: 182: "getDistanceToRightLaneBound" typo
1084-
2: 183: sigsegv on empty "distances" vector
1085-
3: 595, 581: removal of these lines might be considered.
1086-
It looks like a job to change the "target_speed" is added after
1087-
the "target_speed" is already set for the desired value.
1088-
The job will do nothing, if continuous == false and the target_speed is already set
1089-
4: 644: this line should be moved down, just like in 604, 630, 587.
1090-
"target_speed" often will not be set because of this line.
1091-
5: 385, 437, 512, 545: it is unclear, why is a request to change the speed being issued,
1092-
and then, immediately, the speed is forcefully changed.
1093-
The job assigned to change the target speed will return early anyway,
1094-
after checking "isTargetSpeedReached" (if continuous == false)
1095-
6: 551, 618: "requestSpeedChange" throws on invalid entity name if-and-only-if continuous is false.
1096-
Order of checking in the if statement might be swapped to fix this.
1097-
7: 49, 59: it should be considered to make the "cancelRequest" and "appendDebugMarker" functions
1098-
purely virtual, or make them throw.
1099-
8: 565: "requestSpeedChange" throws if "continuous" == true with "RelativeTargetSpeed",
1100-
whereas it does not when called with absolute ratget speed, in line 456.
1101-
*/

0 commit comments

Comments
 (0)