Skip to content

Commit 9257d29

Browse files
committed
SITL: fixed frame_property build error with older C++ compilers
1 parent c72f2e5 commit 9257d29

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

libraries/SITL/SIM_Submarine.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ void Submarine::calculate_forces(const struct sitl_input &input, Vector3f &rot_a
9393
*/
9494
float Submarine::calculate_buoyancy_acceleration()
9595
{
96-
float below_water_level = position.z - frame_proprietary.height/2;
96+
float below_water_level = position.z - frame_property.height/2;
9797

9898
// Completely above water level
9999
if (below_water_level < 0) {
100100
return 0.0f;
101101
}
102102

103103
// Completely below water level
104-
if (below_water_level > frame_proprietary.height/2) {
105-
return frame_proprietary.bouyancy_acceleration;
104+
if (below_water_level > frame_property.height/2) {
105+
return frame_property.bouyancy_acceleration;
106106
}
107107

108108
// bouyant force is proportional to fraction of height in water
109-
return frame_proprietary.bouyancy_acceleration * below_water_level/frame_proprietary.height;
109+
return frame_property.bouyancy_acceleration * below_water_level/frame_property.height;
110110
};
111111

112112
/*

libraries/SITL/SIM_Submarine.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,15 @@ class Submarine : public Aircraft {
4545
protected:
4646
const float water_density = 1023.6; // (kg/m^3) At a temperature of 25 °C, salinity of 35 g/kg and 1 atm pressure
4747

48-
const class FrameConfig {
49-
public:
50-
FrameConfig() = default;
48+
const struct {
5149
float length = 0.457; // x direction (meters)
5250
float width = 0.338; // y direction (meters)
5351
float height = 0.254; // z direction (meters)
5452
float weight = 10.5; // (kg)
5553
float net_bouyancy = 2.0; // (N)
5654

5755
float bouyancy_acceleration = GRAVITY_MSS + net_bouyancy/weight;
58-
} frame_proprietary;
56+
} frame_property;
5957

6058
bool on_ground() const override;
6159

0 commit comments

Comments
 (0)