集成了simulink的生成代码
This commit is contained in:
@@ -0,0 +1,507 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% LOG FILE: ./XLOG_SHORESIDE_16_6_2025_____22_24_59/XLOG_SHORESIDE_16_6_2025_____22_24_59.slog
|
||||
%% FILE OPENED ON Thu Jan 1 08:00:00 1970
|
||||
%% LOGSTART 1750083899.229048
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% (1) TIME
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% TIME
|
||||
%% TIME
|
||||
0.753351
|
||||
%% TIME
|
||||
%% TIME
|
||||
0.9541769
|
||||
1.154654
|
||||
1.355344
|
||||
1.555892
|
||||
1.756309
|
||||
1.957507
|
||||
2.159124
|
||||
2.359773
|
||||
2.56044
|
||||
2.761579
|
||||
2.962356
|
||||
3.163624
|
||||
3.364308
|
||||
3.564977
|
||||
3.765584
|
||||
3.966173
|
||||
4.166899
|
||||
4.367947
|
||||
4.56872
|
||||
4.769442
|
||||
4.970057
|
||||
5.170623
|
||||
5.3714
|
||||
5.572141
|
||||
5.772642
|
||||
5.973307
|
||||
6.173816
|
||||
6.374367
|
||||
6.575039
|
||||
6.775772
|
||||
%% TIME
|
||||
%% TIME
|
||||
6.976394
|
||||
7.176887
|
||||
7.377504
|
||||
7.578273
|
||||
7.779018
|
||||
7.979556
|
||||
8.180116
|
||||
8.380661
|
||||
8.581375
|
||||
8.782269
|
||||
8.982922
|
||||
9.183596
|
||||
9.384163
|
||||
9.585023
|
||||
9.785771
|
||||
9.986298
|
||||
10.18705
|
||||
10.38767
|
||||
10.58915
|
||||
10.78978
|
||||
10.99054
|
||||
11.19117
|
||||
11.39183
|
||||
11.59261
|
||||
11.79331
|
||||
11.99397
|
||||
12.19466
|
||||
12.39533
|
||||
12.59607
|
||||
12.79691
|
||||
%% TIME
|
||||
%% TIME
|
||||
12.99757
|
||||
13.19839
|
||||
13.40052
|
||||
13.60162
|
||||
13.80216
|
||||
14.00297
|
||||
14.20373
|
||||
14.40436
|
||||
14.60503
|
||||
14.80572
|
||||
15.00716
|
||||
15.20774
|
||||
15.40825
|
||||
15.60892
|
||||
15.80956
|
||||
16.01028
|
||||
16.21093
|
||||
16.41163
|
||||
16.61239
|
||||
16.81314
|
||||
17.01373
|
||||
17.21427
|
||||
17.41495
|
||||
17.61559
|
||||
17.81621
|
||||
18.01677
|
||||
18.21732
|
||||
18.41789
|
||||
18.61861
|
||||
18.82008
|
||||
%% TIME
|
||||
%% TIME
|
||||
19.02093
|
||||
19.22154
|
||||
19.4222
|
||||
19.62307
|
||||
19.82388
|
||||
20.02439
|
||||
20.22731
|
||||
20.42817
|
||||
20.6296
|
||||
20.83033
|
||||
21.03077
|
||||
21.23151
|
||||
21.43203
|
||||
21.63292
|
||||
21.83371
|
||||
22.03494
|
||||
22.23552
|
||||
22.43613
|
||||
22.63677
|
||||
22.83751
|
||||
23.03813
|
||||
23.23886
|
||||
23.43951
|
||||
23.64017
|
||||
23.84067
|
||||
24.04121
|
||||
24.24189
|
||||
24.44258
|
||||
24.64337
|
||||
24.844
|
||||
%% TIME
|
||||
%% TIME
|
||||
25.04463
|
||||
25.2452
|
||||
25.44573
|
||||
25.64626
|
||||
25.847
|
||||
26.04751
|
||||
26.24819
|
||||
26.44885
|
||||
26.64966
|
||||
26.85041
|
||||
27.05103
|
||||
27.25183
|
||||
27.45259
|
||||
27.65336
|
||||
27.85387
|
||||
28.05447
|
||||
28.25517
|
||||
28.45659
|
||||
28.65718
|
||||
28.85778
|
||||
29.05839
|
||||
29.25912
|
||||
29.45987
|
||||
29.66105
|
||||
29.86174
|
||||
30.06238
|
||||
30.26313
|
||||
30.46388
|
||||
30.66472
|
||||
30.86538
|
||||
%% TIME
|
||||
%% TIME
|
||||
31.06595
|
||||
31.26655
|
||||
31.46723
|
||||
31.66805
|
||||
31.86872
|
||||
32.06911
|
||||
32.26977
|
||||
32.47035
|
||||
32.67114
|
||||
32.87194
|
||||
33.0725
|
||||
33.27309
|
||||
33.47374
|
||||
33.67441
|
||||
33.87498
|
||||
34.07561
|
||||
34.27614
|
||||
34.47669
|
||||
34.67736
|
||||
34.87791
|
||||
35.07867
|
||||
35.27921
|
||||
35.4797
|
||||
35.68037
|
||||
35.88092
|
||||
36.0815
|
||||
36.28229
|
||||
36.48282
|
||||
36.68356
|
||||
36.88418
|
||||
%% TIME
|
||||
%% TIME
|
||||
37.08485
|
||||
37.28559
|
||||
37.48616
|
||||
37.68695
|
||||
37.88758
|
||||
38.08825
|
||||
38.28895
|
||||
38.48963
|
||||
38.69037
|
||||
38.89095
|
||||
39.09159
|
||||
39.2921
|
||||
39.49272
|
||||
39.69319
|
||||
39.894
|
||||
40.09477
|
||||
40.2954
|
||||
40.49589
|
||||
40.69654
|
||||
40.89731
|
||||
41.0981
|
||||
41.29871
|
||||
41.49917
|
||||
41.69975
|
||||
41.90029
|
||||
42.10097
|
||||
42.30172
|
||||
42.50249
|
||||
42.70328
|
||||
42.904
|
||||
%% TIME
|
||||
%% TIME
|
||||
43.10473
|
||||
43.30688
|
||||
43.50759
|
||||
43.70835
|
||||
43.90911
|
||||
44.10994
|
||||
44.31045
|
||||
44.51092
|
||||
44.71182
|
||||
44.91255
|
||||
45.11345
|
||||
45.31411
|
||||
45.51459
|
||||
45.7152
|
||||
45.9157
|
||||
46.11637
|
||||
46.31697
|
||||
46.51752
|
||||
46.71834
|
||||
46.91902
|
||||
47.11984
|
||||
47.32065
|
||||
47.52125
|
||||
47.7226
|
||||
47.92329
|
||||
48.12404
|
||||
48.32464
|
||||
48.52522
|
||||
48.72574
|
||||
48.92664
|
||||
%% TIME
|
||||
%% TIME
|
||||
49.1275
|
||||
49.32804
|
||||
49.52874
|
||||
49.7295
|
||||
49.93018
|
||||
50.13099
|
||||
50.33162
|
||||
50.53217
|
||||
50.73272
|
||||
50.93353
|
||||
51.13435
|
||||
51.33578
|
||||
51.53632
|
||||
51.73706
|
||||
51.93772
|
||||
52.13849
|
||||
52.33924
|
||||
52.53995
|
||||
52.74131
|
||||
52.94199
|
||||
53.14274
|
||||
53.34349
|
||||
53.54407
|
||||
53.74475
|
||||
53.94528
|
||||
54.14598
|
||||
54.34656
|
||||
54.547
|
||||
54.74763
|
||||
54.94835
|
||||
%% TIME
|
||||
%% TIME
|
||||
55.14907
|
||||
55.34962
|
||||
55.55006
|
||||
55.75082
|
||||
55.95134
|
||||
56.15204
|
||||
56.35268
|
||||
56.55323
|
||||
56.75382
|
||||
56.95457
|
||||
57.15536
|
||||
57.35608
|
||||
57.55659
|
||||
57.75765
|
||||
57.95828
|
||||
58.15882
|
||||
58.35953
|
||||
58.55999
|
||||
58.76058
|
||||
58.96128
|
||||
59.16228
|
||||
59.36293
|
||||
59.56335
|
||||
59.764
|
||||
59.9645
|
||||
60.16511
|
||||
60.36572
|
||||
60.56624
|
||||
60.76684
|
||||
60.96766
|
||||
%% TIME
|
||||
%% TIME
|
||||
61.16849
|
||||
61.36899
|
||||
61.5695
|
||||
61.77005
|
||||
61.9706
|
||||
62.17123
|
||||
62.3718
|
||||
62.57225
|
||||
62.77296
|
||||
62.97364
|
||||
63.1745
|
||||
63.37505
|
||||
63.5755
|
||||
63.77626
|
||||
63.97674
|
||||
64.17739
|
||||
64.37793
|
||||
64.57839
|
||||
64.77893
|
||||
64.97951
|
||||
65.18021
|
||||
65.3808
|
||||
65.58128
|
||||
65.782
|
||||
65.98256
|
||||
66.18323
|
||||
66.38409
|
||||
66.58549
|
||||
66.78604
|
||||
66.98836
|
||||
%% TIME
|
||||
%% TIME
|
||||
67.18904
|
||||
67.38967
|
||||
67.59016
|
||||
67.79091
|
||||
67.99137
|
||||
68.19202
|
||||
68.39277
|
||||
68.59335
|
||||
68.794
|
||||
68.99486
|
||||
69.19559
|
||||
69.39615
|
||||
69.59659
|
||||
69.79731
|
||||
69.99776
|
||||
70.19827
|
||||
70.39908
|
||||
70.59954
|
||||
70.80009
|
||||
71.00086
|
||||
71.20138
|
||||
71.40195
|
||||
71.60251
|
||||
71.80303
|
||||
72.00341
|
||||
72.20387
|
||||
72.40451
|
||||
72.60503
|
||||
72.8055
|
||||
73.0064
|
||||
%% TIME
|
||||
%% TIME
|
||||
73.20704
|
||||
73.40755
|
||||
73.60801
|
||||
73.80876
|
||||
74.00935
|
||||
74.20996
|
||||
74.41052
|
||||
74.61089
|
||||
74.81154
|
||||
75.0123
|
||||
75.21298
|
||||
75.41346
|
||||
75.61402
|
||||
75.81472
|
||||
76.0154
|
||||
76.21598
|
||||
76.4164
|
||||
76.61682
|
||||
76.81735
|
||||
77.01857
|
||||
77.21921
|
||||
77.41978
|
||||
77.62023
|
||||
77.82092
|
||||
78.02147
|
||||
78.22216
|
||||
78.42275
|
||||
78.62348
|
||||
78.82409
|
||||
79.02489
|
||||
%% TIME
|
||||
%% TIME
|
||||
79.22562
|
||||
79.42619
|
||||
79.6267
|
||||
79.82731
|
||||
80.02774
|
||||
80.2284
|
||||
80.42915
|
||||
80.63017
|
||||
80.83089
|
||||
81.03153
|
||||
81.23204
|
||||
81.43256
|
||||
81.63315
|
||||
81.83399
|
||||
82.03449
|
||||
82.23539
|
||||
82.43602
|
||||
82.63671
|
||||
82.83746
|
||||
83.03824
|
||||
83.23917
|
||||
83.4398
|
||||
83.64045
|
||||
83.84125
|
||||
84.04179
|
||||
84.24239
|
||||
84.44314
|
||||
84.64379
|
||||
84.84455
|
||||
85.04534
|
||||
%% TIME
|
||||
%% TIME
|
||||
85.24831
|
||||
85.54721
|
||||
85.74793
|
||||
85.94861
|
||||
86.14924
|
||||
86.35003
|
||||
86.55062
|
||||
86.7512
|
||||
86.95184
|
||||
87.15264
|
||||
87.35327
|
||||
87.55388
|
||||
87.75448
|
||||
87.95504
|
||||
88.1557
|
||||
88.35626
|
||||
88.55692
|
||||
88.75752
|
||||
88.95807
|
||||
89.159
|
||||
89.35971
|
||||
89.56033
|
||||
89.76098
|
||||
89.96161
|
||||
90.16245
|
||||
90.36322
|
||||
90.564
|
||||
90.76487
|
||||
90.9655
|
||||
91.16648
|
||||
%% TIME
|
||||
%% TIME
|
||||
91.36718
|
||||
91.56772
|
||||
91.76833
|
||||
91.96926
|
||||
92.17004
|
||||
92.37056
|
||||
92.57115
|
||||
92.77188
|
||||
92.9725
|
||||
93.17327
|
||||
93.37389
|
||||
93.57453
|
||||
93.77508
|
||||
93.97559
|
||||
94.17622
|
||||
@@ -16,12 +16,13 @@ ProcessConfig = ANTLER
|
||||
Run = MOOSDB @ NewConsole = false
|
||||
//Run = uSimMarineV22 @ NewConsole = false
|
||||
Run = pNodeReporter @ NewConsole = false
|
||||
//Run = pLogger @ NewConsole = false
|
||||
//Run = pMarinePIDV22 @ NewConsole = false
|
||||
Run = pMarineViewer @ NewConsole = false
|
||||
Run = uProcessWatch @ NewConsole = false
|
||||
Run = pHelmIvP @ NewConsole = false
|
||||
Run = pAUV150 @ NewConsole = false
|
||||
Run = pMotionControler @ NewConsole = false
|
||||
//Run = pMotionControler @ NewConsole = false
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
@@ -176,4 +177,25 @@ ProcessConfig = pMotionControler
|
||||
AppTick = 10
|
||||
CommsTick = 10
|
||||
config_file = /home/zjk/project/moos-ivp-extend/missions/alder/ControlParam.json
|
||||
}
|
||||
|
||||
ProcessConfig = pLogger
|
||||
{
|
||||
AppTick = 10
|
||||
CommsTick = 10
|
||||
|
||||
File = XLOG_SHORESIDE
|
||||
PATH = ./
|
||||
SyncLog = true @ 0.2
|
||||
AsyncLog = true
|
||||
FileTimeStamp = true
|
||||
|
||||
LogAuxSrc = true
|
||||
|
||||
// Log it all!!!!!
|
||||
WildCardLogging = true
|
||||
|
||||
WildCardOmitPattern = *_STATUS
|
||||
WildCardOmitPattern = DB_VARSUMMARY
|
||||
WildCardOmitPattern = DB_RWSUMMARY
|
||||
}
|
||||
@@ -17,6 +17,9 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
// 添加静态成员定义
|
||||
Controler AUV150::m_control;
|
||||
|
||||
static bool TCP_ReadLoop(void *p)
|
||||
{
|
||||
AUV150 *pAUV150 = (AUV150 *)p;
|
||||
@@ -49,6 +52,8 @@ AUV150::AUV150()
|
||||
m_desiredVarTime = 0;
|
||||
m_controlTime = 0;
|
||||
m_samplingTime = 0;
|
||||
|
||||
m_control.initialize();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
@@ -102,7 +107,19 @@ bool AUV150::OnNewMail(MOOSMSG_LIST &NewMail)
|
||||
{
|
||||
m_CommandFrame.mainThruster = msg.GetDouble();
|
||||
}
|
||||
else if(key != "APPCAST_REQ") // handled by AppCastingMOOSApp
|
||||
else if(key == "DESIRED_HEADING")
|
||||
{
|
||||
m_control.rtU.heading_cmd = msg.GetDouble();
|
||||
}
|
||||
else if(key == "DESIRED_SPEED")
|
||||
{
|
||||
m_control.rtU.speed_cmd = msg.GetDouble();
|
||||
}
|
||||
else if(key == "DESIRED_DEPTH")
|
||||
{
|
||||
m_control.rtU.depth_cmd = msg.GetDouble();
|
||||
}
|
||||
else if(key != "APPCAST_REQ")
|
||||
reportRunWarning("Unhandled Mail: " + key);
|
||||
}
|
||||
|
||||
@@ -205,6 +222,9 @@ void AUV150::registerVariables()
|
||||
Register("DESIRED_RUDDER",0);
|
||||
Register("DESIRED_THRUST",0);
|
||||
Register("DESIRED_ELEVATOR",0);
|
||||
Register("DESIRED_HEADING", 0);
|
||||
Register("DESIRED_SPEED", 0);
|
||||
Register("DESIRED_DEPTH", 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +282,16 @@ bool AUV150::ListenLoop()
|
||||
updateStatus(*p);
|
||||
postStatusUpdate("NAV");
|
||||
// 计算控制量
|
||||
|
||||
// 修改航向角输入,解决360度临界问题
|
||||
m_control.rtU.psi = std::fmod(m_status.trueHeading, 360.0);
|
||||
m_control.rtU.theta = std::remainder(m_status.pitch, 360.0);
|
||||
m_control.rtU.z = m_status.depthSensor;
|
||||
m_control.step();
|
||||
m_CommandFrame.rudderUp = -m_control.rtY.DirectUpperRudderServoAngleCmd;
|
||||
m_CommandFrame.rudderDown = -m_control.rtY.DirectLowerRudderServoAngleCmd;
|
||||
m_CommandFrame.rudderLeft = m_control.rtY.DirectLeftRudderServoAngleCmd;
|
||||
m_CommandFrame.rudderRight = m_control.rtY.DirectRightRudderServoAngleCmd;
|
||||
m_CommandFrame.mainThruster = m_control.rtY.MainThrusterSpeedCmd;
|
||||
// 发送消息
|
||||
try
|
||||
{
|
||||
@@ -278,7 +307,6 @@ bool AUV150::ListenLoop()
|
||||
<< e.sGetException() << "\n";
|
||||
}
|
||||
|
||||
|
||||
// 计算控制频率
|
||||
m_samplingTime = MOOSTime();
|
||||
message_count++;
|
||||
@@ -411,6 +439,12 @@ bool AUV150::buildReport()
|
||||
m_msgs << oss.str() << std::endl << std::endl;
|
||||
};
|
||||
|
||||
//=================DEGUB==========================
|
||||
|
||||
m_msgs << "rudder_L" << m_control.rtY.DirectLowerRudderServoAngleCmd << std::endl;
|
||||
m_msgs << "rudder_R" << m_control.rtY.DirectRightRudderServoAngleCmd << std::endl;
|
||||
m_msgs << "thrust" << m_control.rtY.MainThrusterSpeedCmd << std::endl;
|
||||
|
||||
// =============== Navigation Info ===============
|
||||
printTable(
|
||||
{"Connect", "Read", "Writ" ,"Conter" ,"Server ip","Latitude", "Longitude","Gap"},
|
||||
@@ -425,26 +459,12 @@ bool AUV150::buildReport()
|
||||
doubleToString(m_controlGap, 5) + "s"
|
||||
}
|
||||
);
|
||||
// printTable(
|
||||
// {"Connect", "Read", "Writ" ,"Conter" ,"Gap","Gap2"},
|
||||
// {
|
||||
// (isConnected() ? "Yes" : "No"),
|
||||
// doubleToString(getRealReadFreq(), 4) + " Hz",
|
||||
// doubleToString(getRealWriteFreq(), 4) + " Hz",
|
||||
// ulintToString(getCounter()),
|
||||
// doubleToString(m_controlGap, 5) + "s",
|
||||
// doubleToString((m_controlTime-m_samplingTime),5)
|
||||
// }
|
||||
// );
|
||||
m_msgs << "Fault Codes: ";
|
||||
for (uint8_t code : getFaultCodes()) {
|
||||
m_msgs << uintToString(code) + " ";
|
||||
}
|
||||
m_msgs << std::endl;
|
||||
m_msgs << "Navigation Mode : " << uintToString(m_status.navModeFb) << std::endl;
|
||||
// m_msgs << "Origin Latitude : " << m_OriginLatitude << endl;
|
||||
// m_msgs << "Origin Longitude : " << m_OriginLongitude << endl;
|
||||
// m_msgs << "---------------------------------\n";
|
||||
// =============== Heading & Attitude ===============
|
||||
printTable(
|
||||
{"Heading", "Pitch", "Roll", "X", "Y", "Z", "H"},
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "MOOS/libMOOS/Utils/MOOSThread.h"
|
||||
#include "MOOS/libMOOS/Utils/MOOSUtilityFunctions.h"
|
||||
#include "MOOS/libMOOSGeodesy/MOOSGeodesy.h"
|
||||
#include "Controler/Controler.h"
|
||||
#include "AngleUtils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@@ -179,6 +181,9 @@ private: // State variables
|
||||
|
||||
double m_controlTime;
|
||||
double m_samplingTime;
|
||||
|
||||
//控制器
|
||||
static Controler m_control;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -16,6 +16,14 @@ SET(SRC
|
||||
AUV150.cpp
|
||||
AUV150_Info.cpp
|
||||
main.cpp
|
||||
# 添加Controller源文件
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Controler/Controler.cpp
|
||||
)
|
||||
|
||||
# 添加头文件目录
|
||||
include_directories(
|
||||
${MOOSGEODESY_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Controler
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(pAUV150 ${SRC})
|
||||
@@ -23,6 +31,7 @@ ADD_EXECUTABLE(pAUV150 ${SRC})
|
||||
TARGET_LINK_LIBRARIES(pAUV150
|
||||
${MOOS_LIBRARIES}
|
||||
${MOOSGEODESY_LIBRARIES}
|
||||
geometry
|
||||
apputil
|
||||
mbutil
|
||||
m
|
||||
|
||||
177
src/pAUV150/Controler/Controler.cpp
Normal file
177
src/pAUV150/Controler/Controler.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
//
|
||||
// Academic License - for use in teaching, academic research, and meeting
|
||||
// course requirements at degree granting institutions only. Not for
|
||||
// government, commercial, or other organizational use.
|
||||
//
|
||||
// File: Controler.cpp
|
||||
//
|
||||
// Code generated for Simulink model 'Controler'.
|
||||
//
|
||||
// Model version : 5.11
|
||||
// Simulink Coder version : 24.2 (R2024b) 21-Jun-2024
|
||||
// C/C++ source code generated on : Tue Jun 17 18:31:17 2025
|
||||
//
|
||||
// Target selection: ert.tlc
|
||||
// Embedded hardware selection: Intel->x86-64 (Linux 64)
|
||||
// Code generation objectives:
|
||||
// 1. Execution efficiency
|
||||
// 2. RAM efficiency
|
||||
// Validation result: Not run
|
||||
//
|
||||
#include "Controler.h"
|
||||
#include "rtwtypes.h"
|
||||
|
||||
// Model step function
|
||||
void Controler::step()
|
||||
{
|
||||
real_T rtb_FilterCoefficient;
|
||||
real_T rtb_FilterCoefficient_a;
|
||||
real_T rtb_FilterCoefficient_lc;
|
||||
real_T rtb_IntegralGain;
|
||||
real_T rtb_Sum1;
|
||||
real_T rtb_Sum2;
|
||||
|
||||
// Outputs for Atomic SubSystem: '<Root>/Controler'
|
||||
// Sum: '<S1>/Sum' incorporates:
|
||||
// Inport: '<Root>/heading_cmd'
|
||||
// Inport: '<Root>/psi'
|
||||
|
||||
rtb_Sum1 = rtU.heading_cmd - rtU.psi;
|
||||
|
||||
// Gain: '<S42>/Filter Coefficient' incorporates:
|
||||
// DiscreteIntegrator: '<S34>/Filter'
|
||||
// Gain: '<S32>/Derivative Gain'
|
||||
// Sum: '<S34>/SumD'
|
||||
|
||||
rtb_FilterCoefficient = (0.01 * rtb_Sum1 - rtDW.Filter_DSTATE) * 10.0;
|
||||
|
||||
// Outport: '<Root>/DirectUpperRudderServoAngleCmd' incorporates:
|
||||
// DiscreteIntegrator: '<S39>/Integrator'
|
||||
// Gain: '<S44>/Proportional Gain'
|
||||
// Sum: '<S48>/Sum'
|
||||
|
||||
rtY.DirectUpperRudderServoAngleCmd = (0.1 * rtb_Sum1 + rtDW.Integrator_DSTATE)
|
||||
+ rtb_FilterCoefficient;
|
||||
|
||||
// Gain: '<S36>/Integral Gain'
|
||||
rtb_IntegralGain = 0.0 * rtb_Sum1;
|
||||
|
||||
// Sum: '<S1>/Sum1' incorporates:
|
||||
// Inport: '<Root>/depth_cmd'
|
||||
// Inport: '<Root>/z'
|
||||
|
||||
rtb_Sum1 = rtU.z - rtU.depth_cmd;
|
||||
|
||||
// Gain: '<S94>/Filter Coefficient' incorporates:
|
||||
// DiscreteIntegrator: '<S86>/Filter'
|
||||
// Gain: '<S84>/Derivative Gain'
|
||||
// Sum: '<S86>/SumD'
|
||||
|
||||
rtb_FilterCoefficient_lc = (0.0 * rtb_Sum1 - rtDW.Filter_DSTATE_m) * 10.0;
|
||||
|
||||
// Sum: '<S1>/Sum2' incorporates:
|
||||
// DiscreteIntegrator: '<S91>/Integrator'
|
||||
// Gain: '<S96>/Proportional Gain'
|
||||
// Inport: '<Root>/theta'
|
||||
// Sum: '<S100>/Sum'
|
||||
|
||||
rtb_Sum2 = ((2.0 * rtb_Sum1 + rtDW.Integrator_DSTATE_o) +
|
||||
rtb_FilterCoefficient_lc) - rtU.theta;
|
||||
|
||||
// Gain: '<S146>/Filter Coefficient' incorporates:
|
||||
// DiscreteIntegrator: '<S138>/Filter'
|
||||
// Gain: '<S136>/Derivative Gain'
|
||||
// Sum: '<S138>/SumD'
|
||||
|
||||
rtb_FilterCoefficient_a = (0.1 * rtb_Sum2 - rtDW.Filter_DSTATE_l) * 10.0;
|
||||
|
||||
// Outport: '<Root>/DirectLeftRudderServoAngleCmd' incorporates:
|
||||
// DiscreteIntegrator: '<S143>/Integrator'
|
||||
// Gain: '<S148>/Proportional Gain'
|
||||
// Sum: '<S152>/Sum'
|
||||
|
||||
rtY.DirectLeftRudderServoAngleCmd = (0.5 * rtb_Sum2 + rtDW.Integrator_DSTATE_f)
|
||||
+ rtb_FilterCoefficient_a;
|
||||
|
||||
// Update for DiscreteIntegrator: '<S34>/Filter'
|
||||
rtDW.Filter_DSTATE += 0.1 * rtb_FilterCoefficient;
|
||||
|
||||
// Update for DiscreteIntegrator: '<S39>/Integrator'
|
||||
rtDW.Integrator_DSTATE += 0.1 * rtb_IntegralGain;
|
||||
|
||||
// Update for DiscreteIntegrator: '<S86>/Filter'
|
||||
rtDW.Filter_DSTATE_m += 0.1 * rtb_FilterCoefficient_lc;
|
||||
|
||||
// Update for DiscreteIntegrator: '<S91>/Integrator' incorporates:
|
||||
// Gain: '<S88>/Integral Gain'
|
||||
|
||||
rtDW.Integrator_DSTATE_o += 0.0 * rtb_Sum1 * 0.1;
|
||||
|
||||
// Update for DiscreteIntegrator: '<S138>/Filter'
|
||||
rtDW.Filter_DSTATE_l += 0.1 * rtb_FilterCoefficient_a;
|
||||
|
||||
// Update for DiscreteIntegrator: '<S143>/Integrator' incorporates:
|
||||
// Gain: '<S140>/Integral Gain'
|
||||
|
||||
rtDW.Integrator_DSTATE_f += 0.0 * rtb_Sum2 * 0.1;
|
||||
|
||||
// End of Outputs for SubSystem: '<Root>/Controler'
|
||||
|
||||
// Outport: '<Root>/MainThrusterSpeedCmd' incorporates:
|
||||
// Constant: '<S1>/Constant'
|
||||
|
||||
rtY.MainThrusterSpeedCmd = 100.0;
|
||||
|
||||
// Outport: '<Root>/DirectLowerRudderServoAngleCmd' incorporates:
|
||||
// Constant: '<S1>/Constant2'
|
||||
|
||||
rtY.DirectLowerRudderServoAngleCmd = 1.0;
|
||||
|
||||
// Outport: '<Root>/DirectRightRudderServoAngleCmd' incorporates:
|
||||
// Constant: '<S1>/Constant4'
|
||||
|
||||
rtY.DirectRightRudderServoAngleCmd = 1.0;
|
||||
}
|
||||
|
||||
// Model initialize function
|
||||
void Controler::initialize()
|
||||
{
|
||||
// (no initialization code required)
|
||||
}
|
||||
|
||||
const char_T* Controler::RT_MODEL::getErrorStatus() const
|
||||
{
|
||||
return (errorStatus);
|
||||
}
|
||||
|
||||
void Controler::RT_MODEL::setErrorStatus(const char_T* const volatile
|
||||
aErrorStatus)
|
||||
{
|
||||
(errorStatus = aErrorStatus);
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Controler::Controler() :
|
||||
rtU(),
|
||||
rtY(),
|
||||
rtDW(),
|
||||
rtM()
|
||||
{
|
||||
// Currently there is no constructor body generated.
|
||||
}
|
||||
|
||||
// Destructor
|
||||
// Currently there is no destructor body generated.
|
||||
Controler::~Controler() = default;
|
||||
|
||||
// Real-Time Model get method
|
||||
Controler::RT_MODEL * Controler::getRTM()
|
||||
{
|
||||
return (&rtM);
|
||||
}
|
||||
|
||||
//
|
||||
// File trailer for generated code.
|
||||
//
|
||||
// [EOF]
|
||||
//
|
||||
314
src/pAUV150/Controler/Controler.h
Normal file
314
src/pAUV150/Controler/Controler.h
Normal file
@@ -0,0 +1,314 @@
|
||||
//
|
||||
// Academic License - for use in teaching, academic research, and meeting
|
||||
// course requirements at degree granting institutions only. Not for
|
||||
// government, commercial, or other organizational use.
|
||||
//
|
||||
// File: Controler.h
|
||||
//
|
||||
// Code generated for Simulink model 'Controler'.
|
||||
//
|
||||
// Model version : 5.11
|
||||
// Simulink Coder version : 24.2 (R2024b) 21-Jun-2024
|
||||
// C/C++ source code generated on : Tue Jun 17 18:31:17 2025
|
||||
//
|
||||
// Target selection: ert.tlc
|
||||
// Embedded hardware selection: Intel->x86-64 (Linux 64)
|
||||
// Code generation objectives:
|
||||
// 1. Execution efficiency
|
||||
// 2. RAM efficiency
|
||||
// Validation result: Not run
|
||||
//
|
||||
#ifndef Controler_h_
|
||||
#define Controler_h_
|
||||
#include <cmath>
|
||||
#include "rtwtypes.h"
|
||||
#include "Controler_types.h"
|
||||
|
||||
// Class declaration for model Controler
|
||||
class Controler final
|
||||
{
|
||||
// public data and function members
|
||||
public:
|
||||
// Block signals and states (default storage) for system '<Root>'
|
||||
struct DW {
|
||||
real_T Filter_DSTATE; // '<S34>/Filter'
|
||||
real_T Integrator_DSTATE; // '<S39>/Integrator'
|
||||
real_T Filter_DSTATE_m; // '<S86>/Filter'
|
||||
real_T Integrator_DSTATE_o; // '<S91>/Integrator'
|
||||
real_T Filter_DSTATE_l; // '<S138>/Filter'
|
||||
real_T Integrator_DSTATE_f; // '<S143>/Integrator'
|
||||
};
|
||||
|
||||
// External inputs (root inport signals with default storage)
|
||||
struct ExtU {
|
||||
real_T u; // '<Root>/u'
|
||||
real_T v; // '<Root>/v'
|
||||
real_T w; // '<Root>/w'
|
||||
real_T phi; // '<Root>/phi'
|
||||
real_T theta; // '<Root>/theta'
|
||||
real_T psi; // '<Root>/psi'
|
||||
real_T x; // '<Root>/x'
|
||||
real_T y; // '<Root>/y'
|
||||
real_T z; // '<Root>/z'
|
||||
real_T dx; // '<Root>/dx'
|
||||
real_T dy; // '<Root>/dy'
|
||||
real_T dz; // '<Root>/dz'
|
||||
real_T speed_cmd; // '<Root>/speed_cmd'
|
||||
real_T heading_cmd; // '<Root>/heading_cmd'
|
||||
real_T depth_cmd; // '<Root>/depth_cmd'
|
||||
};
|
||||
|
||||
// External outputs (root outports fed by signals with default storage)
|
||||
struct ExtY {
|
||||
real_T MainThrusterSpeedCmd; // '<Root>/MainThrusterSpeedCmd'
|
||||
real_T DirectUpperRudderServoAngleCmd;
|
||||
// '<Root>/DirectUpperRudderServoAngleCmd'
|
||||
real_T DirectLowerRudderServoAngleCmd;
|
||||
// '<Root>/DirectLowerRudderServoAngleCmd'
|
||||
real_T DirectLeftRudderServoAngleCmd;
|
||||
// '<Root>/DirectLeftRudderServoAngleCmd'
|
||||
real_T DirectRightRudderServoAngleCmd;
|
||||
// '<Root>/DirectRightRudderServoAngleCmd'
|
||||
};
|
||||
|
||||
// Real-time Model Data Structure
|
||||
struct RT_MODEL {
|
||||
const char_T * volatile errorStatus;
|
||||
const char_T* getErrorStatus() const;
|
||||
void setErrorStatus(const char_T* const volatile aErrorStatus);
|
||||
};
|
||||
|
||||
// Copy Constructor
|
||||
Controler(Controler const&) = delete;
|
||||
|
||||
// Assignment Operator
|
||||
Controler& operator= (Controler const&) & = delete;
|
||||
|
||||
// Move Constructor
|
||||
Controler(Controler &&) = delete;
|
||||
|
||||
// Move Assignment Operator
|
||||
Controler& operator= (Controler &&) = delete;
|
||||
|
||||
// Real-Time Model get method
|
||||
Controler::RT_MODEL * getRTM();
|
||||
|
||||
// External inputs
|
||||
ExtU rtU;
|
||||
|
||||
// External outputs
|
||||
ExtY rtY;
|
||||
|
||||
// model initialize function
|
||||
static void initialize();
|
||||
|
||||
// model step function
|
||||
void step();
|
||||
|
||||
// Constructor
|
||||
Controler();
|
||||
|
||||
// Destructor
|
||||
~Controler();
|
||||
|
||||
// private data and function members
|
||||
private:
|
||||
// Block states
|
||||
DW rtDW;
|
||||
|
||||
// Real-Time Model
|
||||
RT_MODEL rtM;
|
||||
};
|
||||
|
||||
//-
|
||||
// These blocks were eliminated from the model due to optimizations:
|
||||
//
|
||||
// Block '<S1>/Scope1' : Unused code path elimination
|
||||
|
||||
|
||||
//-
|
||||
// The generated code includes comments that allow you to trace directly
|
||||
// back to the appropriate location in the model. The basic format
|
||||
// is <system>/block_name, where system is the system number (uniquely
|
||||
// assigned by Simulink) and block_name is the name of the block.
|
||||
//
|
||||
// Note that this particular code originates from a subsystem build,
|
||||
// and has its own system numbers different from the parent model.
|
||||
// Refer to the system hierarchy for this subsystem below, and use the
|
||||
// MATLAB hilite_system command to trace the generated code back
|
||||
// to the parent model. For example,
|
||||
//
|
||||
// hilite_system('SimModelR2022b_0617/Controler') - opens subsystem SimModelR2022b_0617/Controler
|
||||
// hilite_system('SimModelR2022b_0617/Controler/Kp') - opens and selects block Kp
|
||||
//
|
||||
// Here is the system hierarchy for this model
|
||||
//
|
||||
// '<Root>' : 'SimModelR2022b_0617'
|
||||
// '<S1>' : 'SimModelR2022b_0617/Controler'
|
||||
// '<S2>' : 'SimModelR2022b_0617/Controler/PID Controller'
|
||||
// '<S3>' : 'SimModelR2022b_0617/Controler/PID Controller1'
|
||||
// '<S4>' : 'SimModelR2022b_0617/Controler/PID Controller2'
|
||||
// '<S5>' : 'SimModelR2022b_0617/Controler/PID Controller/Anti-windup'
|
||||
// '<S6>' : 'SimModelR2022b_0617/Controler/PID Controller/D Gain'
|
||||
// '<S7>' : 'SimModelR2022b_0617/Controler/PID Controller/External Derivative'
|
||||
// '<S8>' : 'SimModelR2022b_0617/Controler/PID Controller/Filter'
|
||||
// '<S9>' : 'SimModelR2022b_0617/Controler/PID Controller/Filter ICs'
|
||||
// '<S10>' : 'SimModelR2022b_0617/Controler/PID Controller/I Gain'
|
||||
// '<S11>' : 'SimModelR2022b_0617/Controler/PID Controller/Ideal P Gain'
|
||||
// '<S12>' : 'SimModelR2022b_0617/Controler/PID Controller/Ideal P Gain Fdbk'
|
||||
// '<S13>' : 'SimModelR2022b_0617/Controler/PID Controller/Integrator'
|
||||
// '<S14>' : 'SimModelR2022b_0617/Controler/PID Controller/Integrator ICs'
|
||||
// '<S15>' : 'SimModelR2022b_0617/Controler/PID Controller/N Copy'
|
||||
// '<S16>' : 'SimModelR2022b_0617/Controler/PID Controller/N Gain'
|
||||
// '<S17>' : 'SimModelR2022b_0617/Controler/PID Controller/P Copy'
|
||||
// '<S18>' : 'SimModelR2022b_0617/Controler/PID Controller/Parallel P Gain'
|
||||
// '<S19>' : 'SimModelR2022b_0617/Controler/PID Controller/Reset Signal'
|
||||
// '<S20>' : 'SimModelR2022b_0617/Controler/PID Controller/Saturation'
|
||||
// '<S21>' : 'SimModelR2022b_0617/Controler/PID Controller/Saturation Fdbk'
|
||||
// '<S22>' : 'SimModelR2022b_0617/Controler/PID Controller/Sum'
|
||||
// '<S23>' : 'SimModelR2022b_0617/Controler/PID Controller/Sum Fdbk'
|
||||
// '<S24>' : 'SimModelR2022b_0617/Controler/PID Controller/Tracking Mode'
|
||||
// '<S25>' : 'SimModelR2022b_0617/Controler/PID Controller/Tracking Mode Sum'
|
||||
// '<S26>' : 'SimModelR2022b_0617/Controler/PID Controller/Tsamp - Integral'
|
||||
// '<S27>' : 'SimModelR2022b_0617/Controler/PID Controller/Tsamp - Ngain'
|
||||
// '<S28>' : 'SimModelR2022b_0617/Controler/PID Controller/postSat Signal'
|
||||
// '<S29>' : 'SimModelR2022b_0617/Controler/PID Controller/preInt Signal'
|
||||
// '<S30>' : 'SimModelR2022b_0617/Controler/PID Controller/preSat Signal'
|
||||
// '<S31>' : 'SimModelR2022b_0617/Controler/PID Controller/Anti-windup/Passthrough'
|
||||
// '<S32>' : 'SimModelR2022b_0617/Controler/PID Controller/D Gain/Internal Parameters'
|
||||
// '<S33>' : 'SimModelR2022b_0617/Controler/PID Controller/External Derivative/Error'
|
||||
// '<S34>' : 'SimModelR2022b_0617/Controler/PID Controller/Filter/Disc. Forward Euler Filter'
|
||||
// '<S35>' : 'SimModelR2022b_0617/Controler/PID Controller/Filter ICs/Internal IC - Filter'
|
||||
// '<S36>' : 'SimModelR2022b_0617/Controler/PID Controller/I Gain/Internal Parameters'
|
||||
// '<S37>' : 'SimModelR2022b_0617/Controler/PID Controller/Ideal P Gain/Passthrough'
|
||||
// '<S38>' : 'SimModelR2022b_0617/Controler/PID Controller/Ideal P Gain Fdbk/Disabled'
|
||||
// '<S39>' : 'SimModelR2022b_0617/Controler/PID Controller/Integrator/Discrete'
|
||||
// '<S40>' : 'SimModelR2022b_0617/Controler/PID Controller/Integrator ICs/Internal IC'
|
||||
// '<S41>' : 'SimModelR2022b_0617/Controler/PID Controller/N Copy/Disabled'
|
||||
// '<S42>' : 'SimModelR2022b_0617/Controler/PID Controller/N Gain/Internal Parameters'
|
||||
// '<S43>' : 'SimModelR2022b_0617/Controler/PID Controller/P Copy/Disabled'
|
||||
// '<S44>' : 'SimModelR2022b_0617/Controler/PID Controller/Parallel P Gain/Internal Parameters'
|
||||
// '<S45>' : 'SimModelR2022b_0617/Controler/PID Controller/Reset Signal/Disabled'
|
||||
// '<S46>' : 'SimModelR2022b_0617/Controler/PID Controller/Saturation/Passthrough'
|
||||
// '<S47>' : 'SimModelR2022b_0617/Controler/PID Controller/Saturation Fdbk/Disabled'
|
||||
// '<S48>' : 'SimModelR2022b_0617/Controler/PID Controller/Sum/Sum_PID'
|
||||
// '<S49>' : 'SimModelR2022b_0617/Controler/PID Controller/Sum Fdbk/Disabled'
|
||||
// '<S50>' : 'SimModelR2022b_0617/Controler/PID Controller/Tracking Mode/Disabled'
|
||||
// '<S51>' : 'SimModelR2022b_0617/Controler/PID Controller/Tracking Mode Sum/Passthrough'
|
||||
// '<S52>' : 'SimModelR2022b_0617/Controler/PID Controller/Tsamp - Integral/TsSignalSpecification'
|
||||
// '<S53>' : 'SimModelR2022b_0617/Controler/PID Controller/Tsamp - Ngain/Passthrough'
|
||||
// '<S54>' : 'SimModelR2022b_0617/Controler/PID Controller/postSat Signal/Forward_Path'
|
||||
// '<S55>' : 'SimModelR2022b_0617/Controler/PID Controller/preInt Signal/Internal PreInt'
|
||||
// '<S56>' : 'SimModelR2022b_0617/Controler/PID Controller/preSat Signal/Forward_Path'
|
||||
// '<S57>' : 'SimModelR2022b_0617/Controler/PID Controller1/Anti-windup'
|
||||
// '<S58>' : 'SimModelR2022b_0617/Controler/PID Controller1/D Gain'
|
||||
// '<S59>' : 'SimModelR2022b_0617/Controler/PID Controller1/External Derivative'
|
||||
// '<S60>' : 'SimModelR2022b_0617/Controler/PID Controller1/Filter'
|
||||
// '<S61>' : 'SimModelR2022b_0617/Controler/PID Controller1/Filter ICs'
|
||||
// '<S62>' : 'SimModelR2022b_0617/Controler/PID Controller1/I Gain'
|
||||
// '<S63>' : 'SimModelR2022b_0617/Controler/PID Controller1/Ideal P Gain'
|
||||
// '<S64>' : 'SimModelR2022b_0617/Controler/PID Controller1/Ideal P Gain Fdbk'
|
||||
// '<S65>' : 'SimModelR2022b_0617/Controler/PID Controller1/Integrator'
|
||||
// '<S66>' : 'SimModelR2022b_0617/Controler/PID Controller1/Integrator ICs'
|
||||
// '<S67>' : 'SimModelR2022b_0617/Controler/PID Controller1/N Copy'
|
||||
// '<S68>' : 'SimModelR2022b_0617/Controler/PID Controller1/N Gain'
|
||||
// '<S69>' : 'SimModelR2022b_0617/Controler/PID Controller1/P Copy'
|
||||
// '<S70>' : 'SimModelR2022b_0617/Controler/PID Controller1/Parallel P Gain'
|
||||
// '<S71>' : 'SimModelR2022b_0617/Controler/PID Controller1/Reset Signal'
|
||||
// '<S72>' : 'SimModelR2022b_0617/Controler/PID Controller1/Saturation'
|
||||
// '<S73>' : 'SimModelR2022b_0617/Controler/PID Controller1/Saturation Fdbk'
|
||||
// '<S74>' : 'SimModelR2022b_0617/Controler/PID Controller1/Sum'
|
||||
// '<S75>' : 'SimModelR2022b_0617/Controler/PID Controller1/Sum Fdbk'
|
||||
// '<S76>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tracking Mode'
|
||||
// '<S77>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tracking Mode Sum'
|
||||
// '<S78>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tsamp - Integral'
|
||||
// '<S79>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tsamp - Ngain'
|
||||
// '<S80>' : 'SimModelR2022b_0617/Controler/PID Controller1/postSat Signal'
|
||||
// '<S81>' : 'SimModelR2022b_0617/Controler/PID Controller1/preInt Signal'
|
||||
// '<S82>' : 'SimModelR2022b_0617/Controler/PID Controller1/preSat Signal'
|
||||
// '<S83>' : 'SimModelR2022b_0617/Controler/PID Controller1/Anti-windup/Passthrough'
|
||||
// '<S84>' : 'SimModelR2022b_0617/Controler/PID Controller1/D Gain/Internal Parameters'
|
||||
// '<S85>' : 'SimModelR2022b_0617/Controler/PID Controller1/External Derivative/Error'
|
||||
// '<S86>' : 'SimModelR2022b_0617/Controler/PID Controller1/Filter/Disc. Forward Euler Filter'
|
||||
// '<S87>' : 'SimModelR2022b_0617/Controler/PID Controller1/Filter ICs/Internal IC - Filter'
|
||||
// '<S88>' : 'SimModelR2022b_0617/Controler/PID Controller1/I Gain/Internal Parameters'
|
||||
// '<S89>' : 'SimModelR2022b_0617/Controler/PID Controller1/Ideal P Gain/Passthrough'
|
||||
// '<S90>' : 'SimModelR2022b_0617/Controler/PID Controller1/Ideal P Gain Fdbk/Disabled'
|
||||
// '<S91>' : 'SimModelR2022b_0617/Controler/PID Controller1/Integrator/Discrete'
|
||||
// '<S92>' : 'SimModelR2022b_0617/Controler/PID Controller1/Integrator ICs/Internal IC'
|
||||
// '<S93>' : 'SimModelR2022b_0617/Controler/PID Controller1/N Copy/Disabled'
|
||||
// '<S94>' : 'SimModelR2022b_0617/Controler/PID Controller1/N Gain/Internal Parameters'
|
||||
// '<S95>' : 'SimModelR2022b_0617/Controler/PID Controller1/P Copy/Disabled'
|
||||
// '<S96>' : 'SimModelR2022b_0617/Controler/PID Controller1/Parallel P Gain/Internal Parameters'
|
||||
// '<S97>' : 'SimModelR2022b_0617/Controler/PID Controller1/Reset Signal/Disabled'
|
||||
// '<S98>' : 'SimModelR2022b_0617/Controler/PID Controller1/Saturation/Passthrough'
|
||||
// '<S99>' : 'SimModelR2022b_0617/Controler/PID Controller1/Saturation Fdbk/Disabled'
|
||||
// '<S100>' : 'SimModelR2022b_0617/Controler/PID Controller1/Sum/Sum_PID'
|
||||
// '<S101>' : 'SimModelR2022b_0617/Controler/PID Controller1/Sum Fdbk/Disabled'
|
||||
// '<S102>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tracking Mode/Disabled'
|
||||
// '<S103>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tracking Mode Sum/Passthrough'
|
||||
// '<S104>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tsamp - Integral/TsSignalSpecification'
|
||||
// '<S105>' : 'SimModelR2022b_0617/Controler/PID Controller1/Tsamp - Ngain/Passthrough'
|
||||
// '<S106>' : 'SimModelR2022b_0617/Controler/PID Controller1/postSat Signal/Forward_Path'
|
||||
// '<S107>' : 'SimModelR2022b_0617/Controler/PID Controller1/preInt Signal/Internal PreInt'
|
||||
// '<S108>' : 'SimModelR2022b_0617/Controler/PID Controller1/preSat Signal/Forward_Path'
|
||||
// '<S109>' : 'SimModelR2022b_0617/Controler/PID Controller2/Anti-windup'
|
||||
// '<S110>' : 'SimModelR2022b_0617/Controler/PID Controller2/D Gain'
|
||||
// '<S111>' : 'SimModelR2022b_0617/Controler/PID Controller2/External Derivative'
|
||||
// '<S112>' : 'SimModelR2022b_0617/Controler/PID Controller2/Filter'
|
||||
// '<S113>' : 'SimModelR2022b_0617/Controler/PID Controller2/Filter ICs'
|
||||
// '<S114>' : 'SimModelR2022b_0617/Controler/PID Controller2/I Gain'
|
||||
// '<S115>' : 'SimModelR2022b_0617/Controler/PID Controller2/Ideal P Gain'
|
||||
// '<S116>' : 'SimModelR2022b_0617/Controler/PID Controller2/Ideal P Gain Fdbk'
|
||||
// '<S117>' : 'SimModelR2022b_0617/Controler/PID Controller2/Integrator'
|
||||
// '<S118>' : 'SimModelR2022b_0617/Controler/PID Controller2/Integrator ICs'
|
||||
// '<S119>' : 'SimModelR2022b_0617/Controler/PID Controller2/N Copy'
|
||||
// '<S120>' : 'SimModelR2022b_0617/Controler/PID Controller2/N Gain'
|
||||
// '<S121>' : 'SimModelR2022b_0617/Controler/PID Controller2/P Copy'
|
||||
// '<S122>' : 'SimModelR2022b_0617/Controler/PID Controller2/Parallel P Gain'
|
||||
// '<S123>' : 'SimModelR2022b_0617/Controler/PID Controller2/Reset Signal'
|
||||
// '<S124>' : 'SimModelR2022b_0617/Controler/PID Controller2/Saturation'
|
||||
// '<S125>' : 'SimModelR2022b_0617/Controler/PID Controller2/Saturation Fdbk'
|
||||
// '<S126>' : 'SimModelR2022b_0617/Controler/PID Controller2/Sum'
|
||||
// '<S127>' : 'SimModelR2022b_0617/Controler/PID Controller2/Sum Fdbk'
|
||||
// '<S128>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tracking Mode'
|
||||
// '<S129>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tracking Mode Sum'
|
||||
// '<S130>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tsamp - Integral'
|
||||
// '<S131>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tsamp - Ngain'
|
||||
// '<S132>' : 'SimModelR2022b_0617/Controler/PID Controller2/postSat Signal'
|
||||
// '<S133>' : 'SimModelR2022b_0617/Controler/PID Controller2/preInt Signal'
|
||||
// '<S134>' : 'SimModelR2022b_0617/Controler/PID Controller2/preSat Signal'
|
||||
// '<S135>' : 'SimModelR2022b_0617/Controler/PID Controller2/Anti-windup/Passthrough'
|
||||
// '<S136>' : 'SimModelR2022b_0617/Controler/PID Controller2/D Gain/Internal Parameters'
|
||||
// '<S137>' : 'SimModelR2022b_0617/Controler/PID Controller2/External Derivative/Error'
|
||||
// '<S138>' : 'SimModelR2022b_0617/Controler/PID Controller2/Filter/Disc. Forward Euler Filter'
|
||||
// '<S139>' : 'SimModelR2022b_0617/Controler/PID Controller2/Filter ICs/Internal IC - Filter'
|
||||
// '<S140>' : 'SimModelR2022b_0617/Controler/PID Controller2/I Gain/Internal Parameters'
|
||||
// '<S141>' : 'SimModelR2022b_0617/Controler/PID Controller2/Ideal P Gain/Passthrough'
|
||||
// '<S142>' : 'SimModelR2022b_0617/Controler/PID Controller2/Ideal P Gain Fdbk/Disabled'
|
||||
// '<S143>' : 'SimModelR2022b_0617/Controler/PID Controller2/Integrator/Discrete'
|
||||
// '<S144>' : 'SimModelR2022b_0617/Controler/PID Controller2/Integrator ICs/Internal IC'
|
||||
// '<S145>' : 'SimModelR2022b_0617/Controler/PID Controller2/N Copy/Disabled'
|
||||
// '<S146>' : 'SimModelR2022b_0617/Controler/PID Controller2/N Gain/Internal Parameters'
|
||||
// '<S147>' : 'SimModelR2022b_0617/Controler/PID Controller2/P Copy/Disabled'
|
||||
// '<S148>' : 'SimModelR2022b_0617/Controler/PID Controller2/Parallel P Gain/Internal Parameters'
|
||||
// '<S149>' : 'SimModelR2022b_0617/Controler/PID Controller2/Reset Signal/Disabled'
|
||||
// '<S150>' : 'SimModelR2022b_0617/Controler/PID Controller2/Saturation/Passthrough'
|
||||
// '<S151>' : 'SimModelR2022b_0617/Controler/PID Controller2/Saturation Fdbk/Disabled'
|
||||
// '<S152>' : 'SimModelR2022b_0617/Controler/PID Controller2/Sum/Sum_PID'
|
||||
// '<S153>' : 'SimModelR2022b_0617/Controler/PID Controller2/Sum Fdbk/Disabled'
|
||||
// '<S154>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tracking Mode/Disabled'
|
||||
// '<S155>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tracking Mode Sum/Passthrough'
|
||||
// '<S156>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tsamp - Integral/TsSignalSpecification'
|
||||
// '<S157>' : 'SimModelR2022b_0617/Controler/PID Controller2/Tsamp - Ngain/Passthrough'
|
||||
// '<S158>' : 'SimModelR2022b_0617/Controler/PID Controller2/postSat Signal/Forward_Path'
|
||||
// '<S159>' : 'SimModelR2022b_0617/Controler/PID Controller2/preInt Signal/Internal PreInt'
|
||||
// '<S160>' : 'SimModelR2022b_0617/Controler/PID Controller2/preSat Signal/Forward_Path'
|
||||
|
||||
#endif // Controler_h_
|
||||
|
||||
//
|
||||
// File trailer for generated code.
|
||||
//
|
||||
// [EOF]
|
||||
//
|
||||
31
src/pAUV150/Controler/Controler_private.h
Normal file
31
src/pAUV150/Controler/Controler_private.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Academic License - for use in teaching, academic research, and meeting
|
||||
// course requirements at degree granting institutions only. Not for
|
||||
// government, commercial, or other organizational use.
|
||||
//
|
||||
// File: Controler_private.h
|
||||
//
|
||||
// Code generated for Simulink model 'Controler'.
|
||||
//
|
||||
// Model version : 5.11
|
||||
// Simulink Coder version : 24.2 (R2024b) 21-Jun-2024
|
||||
// C/C++ source code generated on : Tue Jun 17 18:31:17 2025
|
||||
//
|
||||
// Target selection: ert.tlc
|
||||
// Embedded hardware selection: Intel->x86-64 (Linux 64)
|
||||
// Code generation objectives:
|
||||
// 1. Execution efficiency
|
||||
// 2. RAM efficiency
|
||||
// Validation result: Not run
|
||||
//
|
||||
#ifndef Controler_private_h_
|
||||
#define Controler_private_h_
|
||||
#include "rtwtypes.h"
|
||||
#include "Controler_types.h"
|
||||
#endif // Controler_private_h_
|
||||
|
||||
//
|
||||
// File trailer for generated code.
|
||||
//
|
||||
// [EOF]
|
||||
//
|
||||
29
src/pAUV150/Controler/Controler_types.h
Normal file
29
src/pAUV150/Controler/Controler_types.h
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Academic License - for use in teaching, academic research, and meeting
|
||||
// course requirements at degree granting institutions only. Not for
|
||||
// government, commercial, or other organizational use.
|
||||
//
|
||||
// File: Controler_types.h
|
||||
//
|
||||
// Code generated for Simulink model 'Controler'.
|
||||
//
|
||||
// Model version : 5.11
|
||||
// Simulink Coder version : 24.2 (R2024b) 21-Jun-2024
|
||||
// C/C++ source code generated on : Tue Jun 17 18:31:17 2025
|
||||
//
|
||||
// Target selection: ert.tlc
|
||||
// Embedded hardware selection: Intel->x86-64 (Linux 64)
|
||||
// Code generation objectives:
|
||||
// 1. Execution efficiency
|
||||
// 2. RAM efficiency
|
||||
// Validation result: Not run
|
||||
//
|
||||
#ifndef Controler_types_h_
|
||||
#define Controler_types_h_
|
||||
#endif // Controler_types_h_
|
||||
|
||||
//
|
||||
// File trailer for generated code.
|
||||
//
|
||||
// [EOF]
|
||||
//
|
||||
106
src/pAUV150/Controler/rtwtypes.h
Normal file
106
src/pAUV150/Controler/rtwtypes.h
Normal file
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// Academic License - for use in teaching, academic research, and meeting
|
||||
// course requirements at degree granting institutions only. Not for
|
||||
// government, commercial, or other organizational use.
|
||||
//
|
||||
// File: rtwtypes.h
|
||||
//
|
||||
// Code generated for Simulink model 'Controler'.
|
||||
//
|
||||
// Model version : 5.11
|
||||
// Simulink Coder version : 24.2 (R2024b) 21-Jun-2024
|
||||
// C/C++ source code generated on : Tue Jun 17 18:31:17 2025
|
||||
//
|
||||
// Target selection: ert.tlc
|
||||
// Embedded hardware selection: Intel->x86-64 (Linux 64)
|
||||
// Code generation objectives:
|
||||
// 1. Execution efficiency
|
||||
// 2. RAM efficiency
|
||||
// Validation result: Not run
|
||||
//
|
||||
|
||||
#ifndef RTWTYPES_H
|
||||
#define RTWTYPES_H
|
||||
|
||||
// Logical type definitions
|
||||
#if (!defined(__cplusplus))
|
||||
#ifndef false
|
||||
#define false (0U)
|
||||
#endif
|
||||
|
||||
#ifndef true
|
||||
#define true (1U)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//=======================================================================*
|
||||
// Target hardware information
|
||||
// Device type: Intel->x86-64 (Linux 64)
|
||||
// Number of bits: char: 8 short: 16 int: 32
|
||||
// long: 64 long long: 64
|
||||
// native word size: 64
|
||||
// Byte ordering: LittleEndian
|
||||
// Signed integer division rounds to: Zero
|
||||
// Shift right on a signed integer as arithmetic shift: on
|
||||
// =======================================================================
|
||||
|
||||
//=======================================================================*
|
||||
// Fixed width word size data types: *
|
||||
// int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
|
||||
// uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
|
||||
// real32_T, real64_T - 32 and 64 bit floating point numbers *
|
||||
// =======================================================================
|
||||
typedef signed char int8_T;
|
||||
typedef unsigned char uint8_T;
|
||||
typedef short int16_T;
|
||||
typedef unsigned short uint16_T;
|
||||
typedef int int32_T;
|
||||
typedef unsigned int uint32_T;
|
||||
typedef long int64_T;
|
||||
typedef unsigned long uint64_T;
|
||||
typedef float real32_T;
|
||||
typedef double real64_T;
|
||||
|
||||
//===========================================================================*
|
||||
// Generic type definitions: boolean_T, char_T, byte_T, int_T, uint_T, *
|
||||
// real_T, time_T, ulong_T, ulonglong_T. *
|
||||
// ===========================================================================
|
||||
typedef double real_T;
|
||||
typedef double time_T;
|
||||
typedef unsigned char boolean_T;
|
||||
typedef int int_T;
|
||||
typedef unsigned int uint_T;
|
||||
typedef unsigned long ulong_T;
|
||||
typedef unsigned long long ulonglong_T;
|
||||
typedef char char_T;
|
||||
typedef unsigned char uchar_T;
|
||||
typedef char_T byte_T;
|
||||
|
||||
//=======================================================================*
|
||||
// Min and Max: *
|
||||
// int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
|
||||
// uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
|
||||
// =======================================================================
|
||||
#define MAX_int8_T ((int8_T)(127))
|
||||
#define MIN_int8_T ((int8_T)(-128))
|
||||
#define MAX_uint8_T ((uint8_T)(255U))
|
||||
#define MAX_int16_T ((int16_T)(32767))
|
||||
#define MIN_int16_T ((int16_T)(-32768))
|
||||
#define MAX_uint16_T ((uint16_T)(65535U))
|
||||
#define MAX_int32_T ((int32_T)(2147483647))
|
||||
#define MIN_int32_T ((int32_T)(-2147483647-1))
|
||||
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU))
|
||||
#define MAX_int64_T ((int64_T)(9223372036854775807L))
|
||||
#define MIN_int64_T ((int64_T)(-9223372036854775807L-1L))
|
||||
#define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFUL))
|
||||
|
||||
// Block D-Work pointer type
|
||||
typedef void * pointer_T;
|
||||
|
||||
#endif // RTWTYPES_H
|
||||
|
||||
//
|
||||
// File trailer for generated code.
|
||||
//
|
||||
// [EOF]
|
||||
//
|
||||
Reference in New Issue
Block a user