Made corrections.
This commit is contained in:
31
.gitignore
vendored
Normal file
31
.gitignore
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Build output
|
||||||
|
build/
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# CMake generated
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles/
|
||||||
|
cmake_install.cmake
|
||||||
|
Makefile
|
||||||
|
install_manifest.txt
|
||||||
|
CTestTestfile.cmake
|
||||||
|
|
||||||
|
# Compiled GLSL (if any cached/binary shaders are generated)
|
||||||
|
*.spv
|
||||||
|
|
||||||
|
# GDAL/LIDAR processed output
|
||||||
|
map/lidar_processed/
|
||||||
|
|
||||||
|
# Editor and OS artifacts
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Local session artifacts
|
||||||
|
todo
|
||||||
@@ -52,7 +52,7 @@ Examples of data and functions for this class and it subordinates:
|
|||||||
for the police boat will be the police boat's location and heading. This affects the
|
for the police boat will be the police boat's location and heading. This affects the
|
||||||
radar display for the police boat. Perhaps I can suggest that the these three values
|
radar display for the police boat. Perhaps I can suggest that the these three values
|
||||||
should be furnished as uniforms to the shaders for the police boat: 1. int police_boat;
|
should be furnished as uniforms to the shaders for the police boat: 1. int police_boat;
|
||||||
1 is police boat and 0 is not, 2. flost police_location; in local coordinate space,
|
1 is police boat and 0 is not, 2. vec2 police_location; in local coordinate space,
|
||||||
and 3. float police_boat heading.
|
and 3. float police_boat heading.
|
||||||
Please note that this is running in thread 1. The data input to this is being
|
Please note that this is running in thread 1. The data input to this is being
|
||||||
provided by the traffic_cop, which is running on thread 2. The traffic_cop needs
|
provided by the traffic_cop, which is running on thread 2. The traffic_cop needs
|
||||||
@@ -69,7 +69,6 @@ Examples of data and functions for this class and it subordinates:
|
|||||||
float beam; // Vessel beam bounds (meters)
|
float beam; // Vessel beam bounds (meters)
|
||||||
float course; // Course over ground vector (radians relative to True North)
|
float course; // Course over ground vector (radians relative to True North)
|
||||||
float altitude; // Target altitude profile (meters = 0 for boats)
|
float altitude; // Target altitude profile (meters = 0 for boats)
|
||||||
time_t timestamp; // Data aging tracking identifier
|
|
||||||
float current_reflectivity; // derivied from vessel_type (see table below)
|
float current_reflectivity; // derivied from vessel_type (see table below)
|
||||||
float height_estimate; // derived from vessel_type (see table below)
|
float height_estimate; // derived from vessel_type (see table below)
|
||||||
float noiseglint; // derived from vessel_type (see table below)
|
float noiseglint; // derived from vessel_type (see table below)
|
||||||
|
|||||||
@@ -63,3 +63,9 @@ field:
|
|||||||
that is part of Boulevard Park. It is also at the foot of Taylor Street. We call
|
that is part of Boulevard Park. It is also at the foot of Taylor Street. We call
|
||||||
this the Taylor Dock. The Police boat will cruise around Bellingham Bay, showing
|
this the Taylor Dock. The Police boat will cruise around Bellingham Bay, showing
|
||||||
a radar on a moving boat.
|
a radar on a moving boat.
|
||||||
|
|
||||||
|
5. The intro scene (introduction)
|
||||||
|
This shall appear when the application is started. It introductes the exhibit and
|
||||||
|
instructs the user to use the 1 and 2 keyboard keys to select the radar. The 1 key
|
||||||
|
steps forward in a circle and the 2 key steps backward and the enter key makes the
|
||||||
|
selection
|
||||||
|
|||||||
12
CLAUDE.md
12
CLAUDE.md
@@ -115,7 +115,7 @@ of the component, for example 01_classes, 02_management, 03_chain_Home, and so o
|
|||||||
TEMPORARY TESTING FILES
|
TEMPORARY TESTING FILES
|
||||||
|
|
||||||
As each component if built, I may ask for temporary files to be created
|
As each component if built, I may ask for temporary files to be created
|
||||||
for testing of the component. For example, I may ask for targets on a radar
|
for construction component. For example, I may ask for targets on a radar
|
||||||
before any target handling code is made.
|
before any target handling code is made.
|
||||||
|
|
||||||
I will indicated what is needed to be built. And when I am done testing, I will
|
I will indicated what is needed to be built. And when I am done testing, I will
|
||||||
@@ -279,7 +279,6 @@ ssbo_target_information { // This is what is sent to the shaders as SSBO
|
|||||||
float beam; // Vessel beam bounds (meters)
|
float beam; // Vessel beam bounds (meters)
|
||||||
float course; // Course over ground vector (radians relative to True North)
|
float course; // Course over ground vector (radians relative to True North)
|
||||||
float altitude; // Target altitude profile (meters = 0 for boats)
|
float altitude; // Target altitude profile (meters = 0 for boats)
|
||||||
time_t timestamp; // Data aging tracking identifier
|
|
||||||
float current_reflectivity; // derivied from vessel_type (see table below)
|
float current_reflectivity; // derivied from vessel_type (see table below)
|
||||||
float height_estimate; // derived from vessel_type (see table below)
|
float height_estimate; // derived from vessel_type (see table below)
|
||||||
float noiseglint; // derived from vessel_type (see table below)
|
float noiseglint; // derived from vessel_type (see table below)
|
||||||
@@ -456,18 +455,9 @@ struct radar_management_structure {
|
|||||||
int operatable; // 1 is yes, 0 is no
|
int operatable; // 1 is yes, 0 is no
|
||||||
int available; // 1 is yes, 0 is no - this is the one controled by the exhibit owner
|
int available; // 1 is yes, 0 is no - this is the one controled by the exhibit owner
|
||||||
int selected; // 1 is currently operating, 0 is not operating
|
int selected; // 1 is currently operating, 0 is not operating
|
||||||
int testing; // What is being developed and tested; 1 = overall management
|
|
||||||
including startup and radar selectionr,
|
|
||||||
2 = chain_home, 3 = marine_ascope, 4 = marine_traffic, 5 = police_boat, 6 = traffic_cop,
|
|
||||||
7 = simulator, and 8 = raspberry pi receiver
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Note that if a radar is in testing, no other radars can be available. Also testing code can be used
|
|
||||||
to work on the radar being tested and developed
|
|
||||||
In the global data, we need these items:
|
|
||||||
|
|
||||||
struct radar_management_structure radar_management;
|
struct radar_management_structure radar_management;
|
||||||
int current_radar; // 0 is none; 1 is chain_home; 2 is marine_ascope; 3 is marine_traffic; 4 is police_boat
|
|
||||||
|
|
||||||
|
|
||||||
===========================================================================
|
===========================================================================
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ radar_management_structure radar_management[RADAR_COUNT] = {
|
|||||||
// Components: Thread 1, Traffic Cop (Thread 2), all scope renderers
|
// Components: Thread 1, Traffic Cop (Thread 2), all scope renderers
|
||||||
int current_radar = RADAR_NONE;
|
int current_radar = RADAR_NONE;
|
||||||
|
|
||||||
|
// Range settnigs for each radar
|
||||||
|
int chain_home_range_setting;
|
||||||
|
int ascope_range_setting;
|
||||||
|
int traffic_control_range_setting;
|
||||||
|
int police_boat range_setting;
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
* THREAD MUTEXES
|
* THREAD MUTEXES
|
||||||
* Components: all threads as noted per mutex
|
* Components: all threads as noted per mutex
|
||||||
|
|||||||
73
todo
73
todo
@@ -1,73 +0,0 @@
|
|||||||
● Let me survey the project structure and key files before sharing concerns.
|
|
||||||
|
|
||||||
Searched for 1 pattern, read 7 files, listed 1 directory (ctrl+o to expand)
|
|
||||||
|
|
||||||
● Good. I have a thorough picture now. Here are the concerns, ordered by severity:
|
|
||||||
|
|
||||||
---
|
|
||||||
Compile Blocker
|
|
||||||
|
|
||||||
global_data.cpp will not compile. It uses TESTING_COMPONENT (line 51) which is defined in settings.h,
|
|
||||||
but the file only includes data_structure_and_constants.h. Neither that header nor global_data.cpp
|
|
||||||
includes settings.h. This is a straightforward fix — add #include "include/settings.h" to
|
|
||||||
global_data.cpp.
|
|
||||||
|
|
||||||
---
|
|
||||||
Design Concerns
|
|
||||||
|
|
||||||
1. time_t in ssbo_target_information cannot go to GLSL without an extension.
|
|
||||||
time_t on Linux 64-bit is int64_t (8 bytes). Standard GLSL std430 has no 64-bit integer type — it would
|
|
||||||
require the GL_ARB_gpu_shader_int64 extension. The Radeon 780M does support it, but it's non-standard
|
|
||||||
and requires explicit enablement in the shader source. The simpler fix: since the Traffic Cop already
|
|
||||||
discards targets older than 1 hour on the CPU, the timestamp serves no GPU-side purpose. Remove time_t
|
|
||||||
timestamp from ssbo_target_information — it belongs only in target_data_to_thread_1_structure.
|
|
||||||
|
|
||||||
2. Dual state for "which radar is active" risks going out of sync.
|
|
||||||
Both current_radar (an int) and radar_management[i].selected (a per-entry flag) track the active radar.
|
|
||||||
Any code that changes one must change the other, and it's easy to miss one. I'd recommend a setter
|
|
||||||
function (e.g., set_active_radar(int)) that updates both atomically. Otherwise you'll eventually have
|
|
||||||
current_radar == RADAR_MARINE_TRAFFIC while radar_management[3].selected == 0.
|
|
||||||
|
|
||||||
3. uniform_max_range is a single float, but range selection is discrete steps.
|
|
||||||
The settings define 4–5 discrete range values per scope (MARINE_A_SCOPE_RANGE_STEP_1 through _4, etc.),
|
|
||||||
but there's no index variable to track which step is currently selected. The keyboard handler for o/p
|
|
||||||
keys will need a per-scope step index that it increments/decrements, then looks up the appropriate step
|
|
||||||
value to write into uniform_max_range. That index variable doesn't exist anywhere yet.
|
|
||||||
|
|
||||||
4. Thread safety gap on uniform globals.
|
|
||||||
The uniform_* globals are written by Thread 6 (future physical controls) protected by
|
|
||||||
mutex_control_data_to_shaders, but Thread 1 reads them during the render loop without acquiring that
|
|
||||||
mutex. When Thread 6 is eventually built, this will be a data race. Worth designing the read-side
|
|
||||||
locking now so you don't have to retrofit it across all scopes later.
|
|
||||||
|
|
||||||
---
|
|
||||||
Missing Infrastructure
|
|
||||||
|
|
||||||
5. No CMakeLists.txt. Nothing will compile without it. It needs to link against: OpenGL, GLFW3,
|
|
||||||
FreeType, GDAL, and link in glad/src/glad.c. This should be built before any component .cpp file.
|
|
||||||
|
|
||||||
6. No main.cpp / Thread 1 entry point. Expected at this stage since components are being built
|
|
||||||
piecemeal, but the CMakeLists.txt will need a placeholder main.cpp to have an executable.
|
|
||||||
|
|
||||||
---
|
|
||||||
Minor
|
|
||||||
|
|
||||||
7. Misleading comment in global_data.cpp (line 48). It says "The testing field in slots 1-4 mirrors slot
|
|
||||||
0 for convenient access" — but the initialization hardcodes TESTING_NONE in slots 1-4; there's no
|
|
||||||
mirror. Either remove that sentence or actually initialize them to radar_management[0].testing (which
|
|
||||||
can't be done in a static initializer anyway). Simplest fix: just delete that sentence from the comment.
|
|
||||||
|
|
||||||
8. police_location in 01_classes.md is described as float police_location. A position in 2D local
|
|
||||||
Cartesian space needs two components (x, y). When you get to the police boat shader uniform, that will
|
|
||||||
need to be a vec2 (two floats), not a single float.
|
|
||||||
|
|
||||||
9. simulation_data/simulation_journey is a placeholder. It has no values for target_x/target_y and a
|
|
||||||
non-parseable timestamp. This is fine for now, but the format needs to be defined when the simulator
|
|
||||||
component (Thread 3) is built.
|
|
||||||
|
|
||||||
---
|
|
||||||
Summary: The one item to fix immediately before writing code is the settings.h missing include in
|
|
||||||
global_data.cpp. The SSBO time_t issue should be resolved before the first shader is written. The rest
|
|
||||||
can be addressed as the relevant components are built. Want me to fix the global_data.cpp include now?
|
|
||||||
|
|
||||||
✻ Cooked for 1m 46s
|
|
||||||
Reference in New Issue
Block a user