cleanup demo
This commit is contained in:
1 parent
8abd009aed
commit
fa5d63361c
69 files changed
+72
-469
No files matched your search
@@ -1,30 +0,0 @@
|
||||
function obj = initialize(obj, initsPath)
|
||||
arguments (Input)
|
||||
obj (1, 1) {mustBeA(obj, 'scenario')};
|
||||
initsPath (1, 1) string;
|
||||
end
|
||||
arguments (Output)
|
||||
obj (1, 1) {mustBeA(obj, 'scenario')};
|
||||
end
|
||||
|
||||
obj.inits = load(initsPath);
|
||||
|
||||
% Instantiate the correct number of UAVs
|
||||
obj.uavs = cell(obj.inits.numAgents, 1);
|
||||
[obj.uavs{:}] = deal(uav);
|
||||
|
||||
% Configure ports to broadcast to drones
|
||||
obj.ports = repmat(obj.basePort, [obj.inits.numAgents, 1]) + (1:obj.inits.numAgents)';
|
||||
obj.udp = cell(obj.inits.numAgents, 1);
|
||||
for ii = 1:obj.inits.numAgents
|
||||
obj.udp{ii} = udpport("IPV4", "LocalPort", obj.ports(ii), "Tag", sprintf("UAV %d", ii), "Timeout", obj.timeout);
|
||||
end
|
||||
|
||||
% Initialize UAVs in scenario's knowledge
|
||||
for ii = 1:obj.inits.numAgents
|
||||
obj.uavs{ii} = obj.uavs{ii}.initialize(obj.ports(ii) + obj.portOffset, obj.timeout, sprintf("UAV %d", ii));
|
||||
end
|
||||
|
||||
% Update opMode
|
||||
obj.opMode = OPMODE.INITIALIZED;
|
||||
end
|
||||
@@ -1,73 +0,0 @@
|
||||
function obj = run(obj)
|
||||
arguments (Input)
|
||||
obj (1, 1) {mustBeA(obj, 'scenario')};
|
||||
end
|
||||
arguments (Output)
|
||||
obj (1, 1) {mustBeA(obj, 'scenario')};
|
||||
end
|
||||
|
||||
count = 0;
|
||||
|
||||
while true
|
||||
%% UAV operations (simulated only)
|
||||
if coder.target("MATLAB")
|
||||
% Iterate over UAVs
|
||||
for ii = 1:size(obj.uavs, 1)
|
||||
% Determine behavior from UAV opMode
|
||||
if obj.uavs{ii}.opMode == OPMODE.INVALID
|
||||
error("Invalid UAV opMode");
|
||||
elseif obj.uavs{ii}.opMode == OPMODE.INITIALIZED
|
||||
% Waiting for starting position to be sent by the controller
|
||||
if all(~(isnan(obj.uavs{ii}.commandPos)))
|
||||
% Teleport to starting position
|
||||
obj.uavs{ii}.pos = obj.uavs{ii}.commandPos;
|
||||
|
||||
% reset to no command
|
||||
obj.uavs{ii}.commandPos = NaN(1, 3);
|
||||
|
||||
% Acknowledge command receipt to controller by reporting a new opMode
|
||||
obj.uavs{ii}.commandOpMode = OPMODE.SET;
|
||||
end
|
||||
else
|
||||
error("Unexpected UAV opMode");
|
||||
end
|
||||
end
|
||||
elseif coder.target("C++")
|
||||
coder.cinclude('udp_comm.h');
|
||||
% Iterate over UAVs
|
||||
for ii = 1:size(obj.uavs, 1)
|
||||
mode = uint8(0);
|
||||
coder.ceval('recvOpMode', coder.wref(mode));
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
%% Server operations
|
||||
% Compute guidance for UAVs and issue commands
|
||||
if obj.opMode == OPMODE.INVALID
|
||||
error("Invalid controller opMode");
|
||||
elseif obj.opMode == OPMODE.INITIALIZED
|
||||
% On the first iteration, command UAVs to go to their starting positions
|
||||
commandPos = obj.inits.pos;
|
||||
elseif obj.opMode == OPMODE.SET
|
||||
% begin experiment once the controller and UAVs are ready
|
||||
if unique(cellfun(@(x) x.opMode.id, obj.uavs)) == OPMODE.SET.id
|
||||
keyboard
|
||||
end
|
||||
else
|
||||
error("Unexpected controller opMode");
|
||||
end
|
||||
|
||||
% Transmit commands
|
||||
% Command drones to their starting positions
|
||||
for ii = 1:size(obj.uavs, 1)
|
||||
obj.uavs{ii} = obj.sendTarget(obj.uavs{ii}, commandPos(ii, 1:3));
|
||||
end
|
||||
keyboard
|
||||
|
||||
|
||||
|
||||
% tally iterations
|
||||
count = count + 1;
|
||||
end
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
classdef scenario
|
||||
properties (Access = public)
|
||||
% Experiment
|
||||
domain = rectangularPrism;
|
||||
inits;
|
||||
|
||||
% State
|
||||
opMode = OPMODE.INVALID;
|
||||
|
||||
% UAVs
|
||||
uavs;
|
||||
|
||||
% Communications
|
||||
timeout = 2; % seconds
|
||||
basePort = 3330;
|
||||
portOffset = 1110;
|
||||
ports;
|
||||
udp;
|
||||
|
||||
end
|
||||
|
||||
methods(Access = public)
|
||||
[obj] = initialize(obj, initsPath);
|
||||
[obj] = run(obj);
|
||||
[obj] = setup(obj);
|
||||
u = sendTarget(u, pos);
|
||||
end
|
||||
end
|
||||
@@ -1,24 +0,0 @@
|
||||
function u = sendTarget(~, u, pos)
|
||||
arguments (Input)
|
||||
~
|
||||
u (1, 1) {mustBeA(u, 'uav')};
|
||||
pos (1, 3) double;
|
||||
end
|
||||
arguments (Output)
|
||||
u (1, 1) {mustBeA(u, 'uav')};
|
||||
end
|
||||
|
||||
% Branch here depending on environment
|
||||
if coder.target("MATLAB")
|
||||
% Simulation - update target position
|
||||
u.commandPos = pos;
|
||||
|
||||
elseif coder.target("C++")
|
||||
% Codegen - TX starting position to UAV
|
||||
coder.cinclude("udp_comm.h");
|
||||
coder.ceval("sendTarget", coder.rref(pos));
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
@@ -1,17 +0,0 @@
|
||||
function obj = setup(obj)
|
||||
arguments (Input)
|
||||
obj (1, 1) {mustBeA(obj, 'scenario')};
|
||||
end
|
||||
arguments (Output)
|
||||
obj (1, 1) {mustBeA(obj, 'scenario')};
|
||||
end
|
||||
|
||||
% Command drones to their starting positions
|
||||
for ii = 1:size(obj.uavs, 1)
|
||||
obj.uavs{ii} = obj.sendTarget(obj.uavs{ii}, obj.inits.pos(ii, 1:3));
|
||||
end
|
||||
|
||||
% Update opMode
|
||||
obj.opMode = OPMODE.SET;
|
||||
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
function obj = initialize(obj, port, timeout, label)
|
||||
arguments (Input)
|
||||
obj (1, 1) {mustBeA(obj, "uav")};
|
||||
port (1, 1) double;
|
||||
timeout (1, 1) double;
|
||||
label (1, 1) string;
|
||||
end
|
||||
arguments (Output)
|
||||
obj (1, 1) {mustBeA(obj, "uav")};
|
||||
end
|
||||
obj.label = label;
|
||||
obj.port = port;
|
||||
obj.timeout = timeout;
|
||||
|
||||
% Branch here depending on environment
|
||||
if coder.target("MATLAB")
|
||||
obj.pos = [0, 0, 20] + rand(1, 3) * 10; % just put it somewhere so we can plot it
|
||||
|
||||
elseif coder.target("C++")
|
||||
% initialize ip/port
|
||||
coder.cinclude('udp_comm.h');
|
||||
coder.ceval('initComs', "ip", obj.port);
|
||||
end
|
||||
|
||||
obj.opMode = OPMODE.INITIALIZED;
|
||||
|
||||
end
|
||||
@@ -1,20 +0,0 @@
|
||||
function obj = onYourMarks(obj)
|
||||
arguments (Input)
|
||||
obj (1, 1) {mustBeA(obj, "uav")};
|
||||
end
|
||||
|
||||
arguments (Output)
|
||||
obj (1, 1) {mustBeA(obj, "uav")};
|
||||
end
|
||||
|
||||
% Receive initial position data
|
||||
initialPosition = read(obj.udp, 3, "double");
|
||||
|
||||
% Acknowledge message receipt
|
||||
|
||||
% teleport to desired position
|
||||
obj.pos = initialPosition;
|
||||
|
||||
keyboard
|
||||
|
||||
end
|
||||
@@ -1,22 +0,0 @@
|
||||
classdef uav
|
||||
properties
|
||||
label = "";
|
||||
|
||||
% Communications
|
||||
port;
|
||||
timeout;
|
||||
|
||||
% State
|
||||
opMode = OPMODE.INVALID;
|
||||
pos = NaN(1, 3);
|
||||
|
||||
% Commanding (not for codegen)
|
||||
commandOpMode = OPMODE.INVALID;
|
||||
commandPos = NaN(1, 3);
|
||||
end
|
||||
|
||||
methods (Access = public)
|
||||
obj = initialize(obj, port, timeout, label)
|
||||
obj = onYourMarks(obj);
|
||||
end
|
||||
end
|
||||
@@ -1,10 +0,0 @@
|
||||
classdef OPMODE
|
||||
properties (Constant)
|
||||
INVALID = uint8(0);
|
||||
INITIALIZED = uint8(1);
|
||||
SET = uint8(2);
|
||||
RUNNING = uint8(3);
|
||||
CONCLUDING = uint8(4);
|
||||
FINISHED = uint8(5);
|
||||
end
|
||||
end
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
#g++ -I/home/kdee/matlab/R2025a/extern/include controller_main.cpp controller.cpp controller_impl.cpp -o controller_app -lpthread
|
||||
|
||||
wd=$(pwd)
|
||||
cd /home/kdee/Desktop/miSim/aerpaw/codegen
|
||||
g++ -I/home/kdee/matlab/R2025a/extern/include -I../basic_demo/handcode -I. ../basic_demo/handcode/controller_main.cpp controller.cpp ../basic_demo/handcode/controller_impl.cpp controller_initialize.cpp controller_terminate.cpp -o controller_app -lpthread
|
||||
cd $wd
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-3
@@ -1,10 +1,10 @@
|
||||
#include <iostream>
|
||||
#include "controller.h" // Generated by MATLAB Coder
|
||||
#include "controller_impl.h" // Your TCP implementation header
|
||||
#include "controller.h"
|
||||
#include "controller_impl.h" // TCP implementation header
|
||||
|
||||
int main() {
|
||||
// Number of clients to handle
|
||||
int numClients = 2; // Example: change as needed
|
||||
int numClients = 2; // for now
|
||||
|
||||
std::cout << "Initializing TCP server...\n";
|
||||
|
||||
+59
-25
@@ -49,88 +49,87 @@
|
||||
<part role="matlabCoder">
|
||||
<MF0 packageUris="http://schema.mathworks.com/mf0/coderapp_config_datamodel/R2021a.001 http://schema.mathworks.com/mf0/coderapp_core_proj_dm/R2025a http://schema.mathworks.com/mf0/coderapp_core_rt_dm/R2022b http://schema.mathworks.com/mf0/coderapp_form_datamodel/R2020a http://schema.mathworks.com/mf0/coderapp_matlabcoder_proj_dm/R2025a http://schema.mathworks.com/mf0/coderapp_matlabcoder_rt_dm/R2022b http://schema.mathworks.com/mf0/coderapp_types_project_datamodel/R2025a http://schema.mathworks.com/mf0/coderapp_types_runtime_datamodel/R2022b http://schema.mathworks.com/mf0/coderapp_utils_datamodel/R2020a" version="1.1">
|
||||
<coderapp.internal.mlc.mfz.MatlabCoderProjectState id="1" type="coderapp.internal.mlc.mfz.MatlabCoderProjectState">
|
||||
<WorkflowTarget>EXE</WorkflowTarget>
|
||||
<Activity id="2" type="coderapp.internal.mlc.mfz.MainBuildActivity">
|
||||
<Compile>NOT_PLANNED</Compile>
|
||||
<Generate>SUCCESS</Generate>
|
||||
<TargetHardware>MATLAB Host Computer</TargetHardware>
|
||||
<TargetLanguage>C++</TargetLanguage>
|
||||
<WorkflowTarget>LIB</WorkflowTarget>
|
||||
<WorkflowTarget>EXE</WorkflowTarget>
|
||||
<Result id="3" type="coderapp.internal.mlc.mfz.MatlabCoderCodegenResult"/>
|
||||
</Activity>
|
||||
<MainBuildResult id="3" type="coderapp.internal.mlc.mfz.MatlabCoderCodegenResult">
|
||||
<WorkflowTarget>LIB</WorkflowTarget>
|
||||
<LogDirectory>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller</LogDirectory>
|
||||
<MainReport id="4" type="coderapp.internal.build.mfz.CodegenArtifact"/>
|
||||
<WorkflowTarget>EXE</WorkflowTarget>
|
||||
<LogDirectory>/home/kdee/Desktop/miSim/aerpaw/codegen</LogDirectory>
|
||||
<Artifacts id="4" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<SubType>CODEGEN_REPORT</SubType>
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/html/report.mldatx</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/basic_demo/handcode/comms.cpp</Path>
|
||||
</File>
|
||||
<Type>CODEGEN_REPORT</Type>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="5" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller.cpp</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/basic_demo/handcode/controller_impl.cpp</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="6" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/basic_demo/handcode/controller_impl.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="7" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller_data.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller.cpp</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="8" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller_impl.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="9" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller_initialize.cpp</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller_data.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="10" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller_initialize.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller_initialize.cpp</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="11" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller_terminate.cpp</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller_initialize.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="12" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller_terminate.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller_terminate.cpp</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="13" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/controller_types.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller_terminate.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="14" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/rtwtypes.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/controller_types.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="15" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/comms.cpp</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/rtwtypes.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
@@ -142,19 +141,19 @@
|
||||
</Artifacts>
|
||||
<Artifacts id="17" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/examples/main.cpp</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/examples/main.cpp</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<Artifacts id="18" type="coderapp.internal.build.mfz.CodegenArtifact">
|
||||
<File type="coderapp.internal.util.mfz.FileSpec">
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/lib/controller/examples/main.h</Path>
|
||||
<Path>/home/kdee/Desktop/miSim/aerpaw/codegen/examples/main.h</Path>
|
||||
</File>
|
||||
<Type>GENERATED_SOURCE</Type>
|
||||
</Artifacts>
|
||||
<BuildFolder type="coderapp.internal.util.mfz.FileSpec"/>
|
||||
<Success>true</Success>
|
||||
<Timestamp>2026-01-28T21:28:33</Timestamp>
|
||||
<Timestamp>2026-01-28T23:10:50</Timestamp>
|
||||
</MainBuildResult>
|
||||
</coderapp.internal.mlc.mfz.MatlabCoderProjectState>
|
||||
</MF0>
|
||||
@@ -163,15 +162,50 @@
|
||||
<MF0 packageUris="http://schema.mathworks.com/mf0/coderapp_config_datamodel/R2021a.001 http://schema.mathworks.com/mf0/coderapp_core_proj_dm/R2025a http://schema.mathworks.com/mf0/coderapp_core_rt_dm/R2022b http://schema.mathworks.com/mf0/coderapp_form_datamodel/R2020a http://schema.mathworks.com/mf0/coderapp_matlabcoder_proj_dm/R2025a http://schema.mathworks.com/mf0/coderapp_matlabcoder_rt_dm/R2022b http://schema.mathworks.com/mf0/coderapp_types_project_datamodel/R2025a http://schema.mathworks.com/mf0/coderapp_types_runtime_datamodel/R2022b http://schema.mathworks.com/mf0/coderapp_utils_datamodel/R2020a" version="1.1">
|
||||
<coderapp.internal.ext.ConfigStore id="1" type="coderapp.internal.ext.ConfigStore">
|
||||
<Values id="2" type="coderapp.internal.ext.ConfigEntry">
|
||||
<Key>customSource</Key>
|
||||
<Data id="3" type="coderapp.internal.config.data.FileArrayParamData">
|
||||
<Value>/home/kdee/Desktop/miSim/aerpaw/comms.cpp</Value>
|
||||
<Key>buildFolderPath</Key>
|
||||
<Data id="3" type="coderapp.internal.config.data.FileParamData">
|
||||
<Value>/home/kdee/Desktop/miSim/aerpaw/codegen</Value>
|
||||
<Help type="coderapp.internal.util.DocRef"/>
|
||||
</Data>
|
||||
</Values>
|
||||
<Values id="4" type="coderapp.internal.ext.ConfigEntry">
|
||||
<Key>targetLang</Key>
|
||||
<Key>buildFolderType</Key>
|
||||
<Data id="5" type="coderapp.internal.config.data.EnumParamData">
|
||||
<Value>Specified</Value>
|
||||
<Help type="coderapp.internal.util.DocRef"/>
|
||||
</Data>
|
||||
</Values>
|
||||
<Values id="6" type="coderapp.internal.ext.ConfigEntry">
|
||||
<Key>customInclude</Key>
|
||||
<Data id="7" type="coderapp.internal.config.data.FileArrayParamData">
|
||||
<Value>/home/kdee/Desktop/miSim/aerpaw/basic_demo/handcode</Value>
|
||||
<Help type="coderapp.internal.util.DocRef"/>
|
||||
</Data>
|
||||
</Values>
|
||||
<Values id="8" type="coderapp.internal.ext.ConfigEntry">
|
||||
<Key>customSource</Key>
|
||||
<Data id="9" type="coderapp.internal.config.data.FileArrayParamData">
|
||||
<Value>/home/kdee/Desktop/miSim/aerpaw/basic_demo/handcode/comms.cpp</Value>
|
||||
<Value>/home/kdee/Desktop/miSim/aerpaw/basic_demo/handcode/controller_impl.cpp</Value>
|
||||
<Help type="coderapp.internal.util.DocRef"/>
|
||||
</Data>
|
||||
</Values>
|
||||
<Values id="10" type="coderapp.internal.ext.ConfigEntry">
|
||||
<Key>genCodeOnly</Key>
|
||||
<Data id="11" type="coderapp.internal.config.data.BooleanParamData">
|
||||
<Value>true</Value>
|
||||
<Help type="coderapp.internal.util.DocRef"/>
|
||||
</Data>
|
||||
</Values>
|
||||
<Values id="12" type="coderapp.internal.ext.ConfigEntry">
|
||||
<Key>generateReport</Key>
|
||||
<Data id="13" type="coderapp.internal.config.data.BooleanParamData">
|
||||
<Help type="coderapp.internal.util.DocRef"/>
|
||||
</Data>
|
||||
</Values>
|
||||
<Values id="14" type="coderapp.internal.ext.ConfigEntry">
|
||||
<Key>targetLang</Key>
|
||||
<Data id="15" type="coderapp.internal.config.data.EnumParamData">
|
||||
<Value>C++</Value>
|
||||
<Help type="coderapp.internal.util.DocRef"/>
|
||||
</Data>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "udp_comm.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#include <cstring>
|
||||
|
||||
static int sock = -1;
|
||||
static sockaddr_in remote_addr;
|
||||
|
||||
void initComms(const char* ip, uint16_t port)
|
||||
{
|
||||
if (sock != -1) return;
|
||||
|
||||
sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
||||
memset(&remote_addr, 0, sizeof(remote_addr));
|
||||
remote_addr.sin_family = AF_INET;
|
||||
remote_addr.sin_port = htons(port);
|
||||
inet_pton(AF_INET, ip, &remote_addr.sin_addr);
|
||||
}
|
||||
|
||||
void sendTarget(const double* pos)
|
||||
{
|
||||
sendto(sock, pos, 3*sizeof(double), 0,
|
||||
(sockaddr*)&remote_addr, sizeof(remote_addr));
|
||||
}
|
||||
|
||||
void recvOpMode(uint8_t* mode)
|
||||
{
|
||||
recvfrom(sock, mode, sizeof(uint8_t), MSG_DONTWAIT,
|
||||
nullptr, nullptr);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef UDP_COMM_H
|
||||
#define UDP_COMM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void initComms(const char* ip, uint16_t port);
|
||||
void sendTarget(const double* pos);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
classdef experiments < matlab.unittest.TestCase
|
||||
methods (Test)
|
||||
function Test1(tc)
|
||||
s = scenario;
|
||||
|
||||
% TODO - define test case in simulation in here and generate the inits on the fly as needed
|
||||
s = s.initialize("2026_01_28_16_11_39_miSimInits.mat");
|
||||
|
||||
s = s.run();
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
File renamed without changes.
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="compile.sh" type="File"/>
|
||||
File renamed without changes.
+1
-1
@@ -1,2 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
<Info location="handcode" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="aerpaw/cpp" Type="Relative"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="ffd75785-8b8f-4006-add6-f7b276c0cf6a" type="Reference"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="controller.coderprj" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="test"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="experiments.m" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="@scenario" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="@uav" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="OPMODE.m" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="cpp" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="codegen" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="initialize.m" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="setup.m" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="run.m" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="sendTarget.m" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="scenario.m" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="initialize.m" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="onYourMarks.m" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="uav.m" type="File"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="udp_comm.cpp" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="udp_comm.h" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user