mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 21:13:33 +08:00
GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore * Add test stubs * Rename px4_add_gtest to px4_add_unit_gtest * Add infrastructure to run functional tests * Add example tests with parameters and uorb messages * Fix memory issues in destructors in uORB manager and CDev * Add a more real-world test of the collision prevention
This commit is contained in:
@@ -53,6 +53,18 @@ CollisionPrevention::~CollisionPrevention()
|
||||
if (_mavlink_log_pub != nullptr) {
|
||||
orb_unadvertise(_mavlink_log_pub);
|
||||
}
|
||||
|
||||
if (_constraints_pub != nullptr) {
|
||||
orb_unadvertise(_constraints_pub);
|
||||
}
|
||||
|
||||
if (_obstacle_distance_pub != nullptr) {
|
||||
orb_unadvertise(_obstacle_distance_pub);
|
||||
}
|
||||
|
||||
if (_pub_vehicle_command != nullptr) {
|
||||
orb_unadvertise(_pub_vehicle_command);
|
||||
}
|
||||
}
|
||||
|
||||
void CollisionPrevention::_publishConstrainedSetpoint(const Vector2f &original_setpoint,
|
||||
@@ -102,7 +114,7 @@ void CollisionPrevention::_updateOffboardObstacleDistance(obstacle_distance_s &o
|
||||
void CollisionPrevention::_updateDistanceSensor(obstacle_distance_s &obstacle)
|
||||
{
|
||||
for (unsigned i = 0; i < ORB_MULTI_MAX_INSTANCES; i++) {
|
||||
distance_sensor_s distance_sensor;
|
||||
distance_sensor_s distance_sensor {};
|
||||
_sub_distance_sensor[i].copy(&distance_sensor);
|
||||
|
||||
// consider only instaces with updated, valid data and orientations useful for collision prevention
|
||||
|
||||
Reference in New Issue
Block a user