Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
integration_tests.cpp File Reference
Include dependency graph for integration_tests.cpp:

Go to the source code of this file.

Classes

class  IntegrationTest
 

Functions

 TEST_F (IntegrationTest, PUBLISH_PATH1)
 Tests the full pipeline with a simple track of 24 cones placed in two straight lines parallel to the x-axis.
 
 TEST_F (IntegrationTest, PUBLISH_PATH2)
 test the full pipeline with a straight track of 24 cones oriented at 45 degrees with the x-axis.
 
 TEST_F (IntegrationTest, PUBLISH_PATH3)
 test the full pipeline with a straight track of 24 cones oriented at 135 degrees with the x-axis.
 
 TEST_F (IntegrationTest, PUBLISH_PATH4)
 test the full pipeline with a straight track of 24 cones oriented at 225 degrees with the x-axis.
 
 TEST_F (IntegrationTest, PUBLISH_PATH5)
 test the full pipeline with a straight track of 24 cones oriented at 315 degrees with the x-axis.
 
 TEST_F (IntegrationTest, PUBLISH_PATH6)
 test the full pipeline with a straight track of 24 cones oriented at 90 degrees with the x-axis (parallel to the y-axis).
 
 TEST_F (IntegrationTest, no_cones)
 Tests the full pipeline when 0 cones are sent.
 
 TEST_F (IntegrationTest, one_cone)
 Tests the full pipeline when only a single cone is sent.
 
void read_from_file (std::ifstream &file, double &finalxi, double &finalxf, double &finalyi, double &finalyf, std::vector< Cone > &cone_array, custom_interfaces::msg::Pose &vehicle_pose)
 Reads a file and processes its contents to initialize vehicle state, cones, and final position range.
 
void save_debug_file (const std::string filename, const std::vector< Cone > cone_array, const custom_interfaces::msg::PathPointArray received_path, const custom_interfaces::msg::Pose vehicle_pose)
 Saves debug information to a file.
 
 TEST_F (IntegrationTest, simple_straight_path)
 Tests the full pipeline with a simple straight path.
 
 TEST_F (IntegrationTest, unbalanced_STRAIGHT_PATH)
 Tests the full pipeline in a straight line with fewer cones in one and more in the other.
 
 TEST_F (IntegrationTest, FULL_CURVE_PATH)
 Tests the full pipeline in a straight line with fewer cones.
 
 TEST_F (IntegrationTest, CURVES_AND_CLOSE_TRACKSIDES)
 A path with curves where one side of the track is close to other part of the track.
 
 TEST_F (IntegrationTest, SHARP_SINOSOIDAL_CURVE)
 A path with a sharp sinosoidal curve, where cones on both sides get closer.
 
 TEST_F (IntegrationTest, ROSBAG_PATH_1)
 Testing a scenario from rosbag Autocross_DV-5.
 
 TEST_F (IntegrationTest, ROSBAG_PATH_2)
 Testing a scenario from rosbag ZigZag_DV-11.
 
 TEST_F (IntegrationTest, ROSBAG_PATH_3)
 Testing a scenario from rosbag Acceleration_Testing_DV-1B.
 
 TEST_F (IntegrationTest, ROSBAG_PATH_4)
 Testing a scenario from rosbag Hard_Course-DV-3 from the beggining of the track.
 
 TEST_F (IntegrationTest, ROSBAG_PATH_5)
 Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.
 
 TEST_F (IntegrationTest, CIRCLE)
 Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.
 
 TEST_F (IntegrationTest, STRAIGHT_3)
 Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.
 
 TEST_F (IntegrationTest, TRACK)
 Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.
 
 TEST_F (IntegrationTest, TRACK_2)
 Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.
 
 TEST_F (IntegrationTest, OUTLIERS_1)
 Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.
 
 TEST_F (IntegrationTest, OUTLIERS_2)
 Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.
 

Function Documentation

◆ read_from_file()

void read_from_file ( std::ifstream &  file,
double &  finalxi,
double &  finalxf,
double &  finalyi,
double &  finalyf,
std::vector< Cone > &  cone_array,
custom_interfaces::msg::Pose &  vehicle_pose 
)

Reads a file and processes its contents to initialize vehicle state, cones, and final position range.

This function reads lines from the provided file stream and processes them based on specific flags:

  • "P": Initializes the vehicle state with position (x, y) and orientation (theta).
  • "C": Adds a cone to the cone array with position (x, y) and color.
  • "F": Sets the final expected position range (finalxi, finalxf, finalyi, finalyf).
Parameters
fileThe input file stream to read from.
finalxiReference to the variable to store the initial x-coordinate of the final position range.
finalxfReference to the variable to store the final x-coordinate of the final position range.
finalyiReference to the variable to store the initial y-coordinate of the final position range.
finalyfReference to the variable to store the final y-coordinate of the final position range.
cone_arrayReference to the vector to store the cones read from the file.
vehicle_poseReference to the Pose object to store the initial vehicle state.

Definition at line 358 of file integration_tests.cpp.

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

◆ save_debug_file()

void save_debug_file ( const std::string  filename,
const std::vector< Cone cone_array,
const custom_interfaces::msg::PathPointArray  received_path,
const custom_interfaces::msg::Pose  vehicle_pose 
)

Saves debug information to a file.

This function writes the received path points, cone array, and vehicle state to a specified debug file. The file is saved in the directory "../../src/planning/test/integration_tests/results/" with the given filename.

Parameters
filenameThe name of the file to save the debug information.
cone_arrayA vector of Cone objects representing the cone positions and colors.
received_pathA PathPointArray message containing the path points.
vehicle_poseA Pose message containing the vehicle's position and orientation.

Definition at line 398 of file integration_tests.cpp.

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

◆ TEST_F() [1/24]

TEST_F ( IntegrationTest  ,
CIRCLE   
)

Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.

Definition at line 867 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [2/24]

TEST_F ( IntegrationTest  ,
CURVES_AND_CLOSE_TRACKSIDES   
)

A path with curves where one side of the track is close to other part of the track.

Definition at line 558 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [3/24]

TEST_F ( IntegrationTest  ,
FULL_CURVE_PATH   
)

Tests the full pipeline in a straight line with fewer cones.

Definition at line 513 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [4/24]

TEST_F ( IntegrationTest  ,
no_cones   
)

Tests the full pipeline when 0 cones are sent.

Definition at line 301 of file integration_tests.cpp.

◆ TEST_F() [5/24]

TEST_F ( IntegrationTest  ,
one_cone   
)

Tests the full pipeline when only a single cone is sent.

Definition at line 320 of file integration_tests.cpp.

◆ TEST_F() [6/24]

TEST_F ( IntegrationTest  ,
OUTLIERS_1   
)

Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.

Definition at line 1044 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [7/24]

TEST_F ( IntegrationTest  ,
OUTLIERS_2   
)

Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.

Definition at line 1088 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [8/24]

TEST_F ( IntegrationTest  ,
PUBLISH_PATH1   
)

Tests the full pipeline with a simple track of 24 cones placed in two straight lines parallel to the x-axis.

The result should be a path of points contained in the x-axis.

Definition at line 93 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [9/24]

TEST_F ( IntegrationTest  ,
PUBLISH_PATH2   
)

test the full pipeline with a straight track of 24 cones oriented at 45 degrees with the x-axis.

Definition at line 124 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [10/24]

TEST_F ( IntegrationTest  ,
PUBLISH_PATH3   
)

test the full pipeline with a straight track of 24 cones oriented at 135 degrees with the x-axis.

Definition at line 161 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [11/24]

TEST_F ( IntegrationTest  ,
PUBLISH_PATH4   
)

test the full pipeline with a straight track of 24 cones oriented at 225 degrees with the x-axis.

Definition at line 199 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [12/24]

TEST_F ( IntegrationTest  ,
PUBLISH_PATH5   
)

test the full pipeline with a straight track of 24 cones oriented at 315 degrees with the x-axis.

Definition at line 235 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [13/24]

TEST_F ( IntegrationTest  ,
PUBLISH_PATH6   
)

test the full pipeline with a straight track of 24 cones oriented at 90 degrees with the x-axis (parallel to the y-axis).

Definition at line 271 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [14/24]

TEST_F ( IntegrationTest  ,
ROSBAG_PATH_1   
)

Testing a scenario from rosbag Autocross_DV-5.

Definition at line 646 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [15/24]

TEST_F ( IntegrationTest  ,
ROSBAG_PATH_2   
)

Testing a scenario from rosbag ZigZag_DV-11.

Definition at line 690 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [16/24]

TEST_F ( IntegrationTest  ,
ROSBAG_PATH_3   
)

Testing a scenario from rosbag Acceleration_Testing_DV-1B.

Definition at line 735 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [17/24]

TEST_F ( IntegrationTest  ,
ROSBAG_PATH_4   
)

Testing a scenario from rosbag Hard_Course-DV-3 from the beggining of the track.

Definition at line 779 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [18/24]

TEST_F ( IntegrationTest  ,
ROSBAG_PATH_5   
)

Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.

Definition at line 823 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [19/24]

TEST_F ( IntegrationTest  ,
SHARP_SINOSOIDAL_CURVE   
)

A path with a sharp sinosoidal curve, where cones on both sides get closer.

Definition at line 602 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [20/24]

TEST_F ( IntegrationTest  ,
simple_straight_path   
)

Tests the full pipeline with a simple straight path.

Definition at line 424 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [21/24]

TEST_F ( IntegrationTest  ,
STRAIGHT_3   
)

Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.

Definition at line 911 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [22/24]

TEST_F ( IntegrationTest  ,
TRACK   
)

Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.

Definition at line 956 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [23/24]

TEST_F ( IntegrationTest  ,
TRACK_2   
)

Testing a scenario from rosbag Hard_Course-DV-3 with a different initial position.

Definition at line 1000 of file integration_tests.cpp.

Here is the call graph for this function:

◆ TEST_F() [24/24]

TEST_F ( IntegrationTest  ,
unbalanced_STRAIGHT_PATH   
)

Tests the full pipeline in a straight line with fewer cones in one and more in the other.

Definition at line 469 of file integration_tests.cpp.

Here is the call graph for this function: