Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
perception_integration_tests.cpp File Reference
#include <gtest/gtest.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl_conversions/pcl_conversions.h>
#include <custom_interfaces/msg/cone_array.hpp>
#include <custom_interfaces/msg/perception_output.hpp>
#include <filesystem>
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/point_cloud2.hpp>
#include "perception/perception_node.hpp"
Include dependency graph for perception_integration_tests.cpp:

Go to the source code of this file.

Classes

class  PerceptionIntegrationTest
 Test class for blackbox perception integration tests. More...
 

Functions

bool loadGroundTruth (const std::string &file_path, std::vector< std::tuple< float, float, bool, bool > > &ground_truth)
 Helper function to load ground truth cone positions from a file.
 
double computeCorrectness (const custom_interfaces::msg::ConeArray::SharedPtr &detected, std::vector< std::tuple< float, float, bool, bool > > ground_truth, float tolerance=0.2)
 Helper function to compute correctness for a specific test case.
 
void generateCylinder (pcl::PointCloud< pcl::PointXYZI >::Ptr cloud, float radius, float height, float centerX, float centerY, int numSlices, int numHeightSegments, float intensity)
 Generates a cylinder made of pcl points, used to add the found cones in the results pcl.
 
 TEST_F (PerceptionIntegrationTest, StraightLine)
 Straight line test for perception node from rosbag: Accelaration_Testing_DV_1B.mcap.
 
 TEST_F (PerceptionIntegrationTest, AccelerationEndClose)
 Close to accelaration end test for perception node from rosbag: Accelaration_Testing_Manual-4.mcap.
 
 TEST_F (PerceptionIntegrationTest, AccelerationEndMedium)
 Medium distance to accelaration end test for perception node from rosbag: Accelaration_Testing_Manual-4.mcap.
 
 TEST_F (PerceptionIntegrationTest, AccelerationFar)
 Far distance to accelaration end test for perception node from rosbag: Accelaration_Testing_Manual-4.mcap.
 
 TEST_F (PerceptionIntegrationTest, EnterHairpin)
 Blind turn test for perception node from rosbag: Closed_Course_Manual-6.mcap.
 
 TEST_F (PerceptionIntegrationTest, TurnStart)
 Turn test for perception node from rosbag: Hard_Course-DV-5.mcap.
 
 TEST_F (PerceptionIntegrationTest, OddStituation)
 Odd situation test for perception node from rosbag: Hard_Course-DV-5.mcap.
 
 TEST_F (PerceptionIntegrationTest, DiagonalPath)
 A fully diagonal path test for perception node from rosbag: Autocross_DV-1.mcap.
 

Function Documentation

◆ computeCorrectness()

double computeCorrectness ( const custom_interfaces::msg::ConeArray::SharedPtr &  detected,
std::vector< std::tuple< float, float, bool, bool > >  ground_truth,
float  tolerance = 0.2 
)

Helper function to compute correctness for a specific test case.

Definition at line 35 of file perception_integration_tests.cpp.

Here is the caller graph for this function:

◆ generateCylinder()

void generateCylinder ( pcl::PointCloud< pcl::PointXYZI >::Ptr  cloud,
float  radius,
float  height,
float  centerX,
float  centerY,
int  numSlices,
int  numHeightSegments,
float  intensity 
)

Generates a cylinder made of pcl points, used to add the found cones in the results pcl.

Definition at line 76 of file perception_integration_tests.cpp.

Here is the caller graph for this function:

◆ loadGroundTruth()

bool loadGroundTruth ( const std::string &  file_path,
std::vector< std::tuple< float, float, bool, bool > > &  ground_truth 
)

Helper function to load ground truth cone positions from a file.

Definition at line 18 of file perception_integration_tests.cpp.

Here is the caller graph for this function:

◆ TEST_F() [1/8]

TEST_F ( PerceptionIntegrationTest  ,
AccelerationEndClose   
)

Close to accelaration end test for perception node from rosbag: Accelaration_Testing_Manual-4.mcap.

Definition at line 258 of file perception_integration_tests.cpp.

◆ TEST_F() [2/8]

TEST_F ( PerceptionIntegrationTest  ,
AccelerationEndMedium   
)

Medium distance to accelaration end test for perception node from rosbag: Accelaration_Testing_Manual-4.mcap.

Definition at line 266 of file perception_integration_tests.cpp.

◆ TEST_F() [3/8]

TEST_F ( PerceptionIntegrationTest  ,
AccelerationFar   
)

Far distance to accelaration end test for perception node from rosbag: Accelaration_Testing_Manual-4.mcap.

Definition at line 274 of file perception_integration_tests.cpp.

◆ TEST_F() [4/8]

TEST_F ( PerceptionIntegrationTest  ,
DiagonalPath   
)

A fully diagonal path test for perception node from rosbag: Autocross_DV-1.mcap.

Definition at line 296 of file perception_integration_tests.cpp.

◆ TEST_F() [5/8]

TEST_F ( PerceptionIntegrationTest  ,
EnterHairpin   
)

Blind turn test for perception node from rosbag: Closed_Course_Manual-6.mcap.

Definition at line 281 of file perception_integration_tests.cpp.

◆ TEST_F() [6/8]

TEST_F ( PerceptionIntegrationTest  ,
OddStituation   
)

Odd situation test for perception node from rosbag: Hard_Course-DV-5.mcap.

Definition at line 291 of file perception_integration_tests.cpp.

◆ TEST_F() [7/8]

TEST_F ( PerceptionIntegrationTest  ,
StraightLine   
)

Straight line test for perception node from rosbag: Accelaration_Testing_DV_1B.mcap.

Definition at line 252 of file perception_integration_tests.cpp.

◆ TEST_F() [8/8]

TEST_F ( PerceptionIntegrationTest  ,
TurnStart   
)

Turn test for perception node from rosbag: Hard_Course-DV-5.mcap.

Definition at line 286 of file perception_integration_tests.cpp.