Compare commits

..

2 Commits

Author SHA1 Message Date
946649d3e4 add stuff for temporary files 2026-04-01 10:45:07 -07:00
50b207b880 more updates 2026-04-01 10:21:26 -07:00

101
CLAUDE.md
View File

@@ -36,7 +36,7 @@ Classes:
1. Anything to do with sending anything to the display. Needs to be on the 1. Anything to do with sending anything to the display. Needs to be on the
same thread as the main function same thread as the main function
2. Communications with outside sources; ais and ads-bl for targets 2. Communications with outside sources; ais and ads-b for targets
3. Operator controls 3. Operator controls
@@ -56,18 +56,30 @@ for the a scope. The ppi scope
will be on the right side of the screen and the a scope will be on the left will be on the right side of the screen and the a scope will be on the left
hand side of the screen. hand side of the screen.
Suggest one window with viewports. Lets have window the entire screen. For develpment The maximum range should be enough to cover the entirity of Bellingham bay
I would need some sort of escape the esscape the full screen and go back to the as seen from the dock of the Community Boating Center.
desktop.
Suggest that the radar itself is at the location of the Community Boating Use one window with viewports covering the entire screen. For development,
Center dock in Bellingham, Washington, That should be 0,0 in local cartesian F11 toggles fullscreen, Escape exits the program entirely.
coordinates or 0 in range for vectoring. North on radar needs to be north in
reality.
GPS for tagets should be converted to local cartesian reference to this The radar is fixed at the Community Boating Center dock in Bellingham,
location. I don't know if I have to be concerned with vector data. Please Washington. That location is 0,0 in local Cartesian coordinates. North on
comment. the radar display is true north.
GPS coordinates from targets are converted to local Cartesian coordinates
referenced to this origin using a flat-earth equirectangular projection,
which is accurate enough for harbor radar ranges (0-24 nautical miles):
x = (lon - origin_lon) * cos(origin_lat) * R
y = (lat - origin_lat) * R
Where R is Earth's radius (6,371,000 m). Result is in meters from the origin.
No need to be concerned with spherical or vector geometry at these ranges.
Coordinate conversion belongs in the main application, not in the Raspberry Pi
communication class. The RPi class delivers raw lat/lon; the main app converts
to local Cartesian. This keeps the RPi code simple and means a change to the
radar origin only requires changing one place.
Notes for controls the user can play with Notes for controls the user can play with
@@ -110,7 +122,7 @@ for how many pulses received and in what direction. That would be permanent.
Temporary code necessary for changing control selection and value via the Temporary code necessary for changing control selection and value via the
keyboard until I get the necessary hardware for the controls. keyboard until I get the necessary hardware for the controls.
Also please note that thill will need to be flexible as encoders can Also please note that this will need to be flexible as encoders can
be expensive, especially robust ones that kids cannot break. be expensive, especially robust ones that kids cannot break.
Shaders: Shaders:
@@ -124,7 +136,7 @@ or tested independently without affecting the others. At least the following sha
3. clutter for waves, in white blue 3. clutter for waves, in white blue
4. graticule for PPI for bearing ticks, numbers, and range rings that 4. graticule for PPI for bearing ticks, numbers, and range rings that
will change with range selection will change with range selection
5. Have operator switch graticules on the vintage a scope 5. Have operator switch graticules on the vintage a scope
6. Shoreline; tricky as shoreline has hills. 6. Shoreline; tricky as shoreline has hills.
7. This may be overkill, but something for notable buildings and docks. The 7. This may be overkill, but something for notable buildings and docks. The
curved south bay trail and taylor dock comes to mind, also the squalicum curved south bay trail and taylor dock comes to mind, also the squalicum
@@ -138,8 +150,6 @@ axis. There will be a graticule for the a scope. This will show range markings.
day, the operator would physically change the graticule overlay. What we can do is to day, the operator would physically change the graticule overlay. What we can do is to
electronically change the overlay and put a brief message saying operator changes electronically change the overlay and put a brief message saying operator changes
the graticule. the graticule.
The graticule was illuminated with #47 incandescent dial lights, we need to have that
graticule lit with an equivalent color. Horizontal is range, vertical is strength graticule lit with an equivalent color. Horizontal is range, vertical is strength
of the return blip. The phosphor of the A scope is green, similar to P1, which was of the return blip. The phosphor of the A scope is green, similar to P1, which was
used on oscillosopes. used on oscillosopes.
@@ -158,7 +168,8 @@ Located on right hand of the screen. Put 1/2 inch margins on the right and top a
The PPI display will need shaders for the following: The PPI display will need shaders for the following:
1. Active radar target echos (blue white phosphor) 1. Active radar target echos (blue white phosphor) Have different brighness for
size and blooming for larger sizes
2. Graticule (warm incandescent color, it was a plastic overlay lit with lamps. Does 2. Graticule (warm incandescent color, it was a plastic overlay lit with lamps. Does
not get included with persistant phosphor. Can change if the operator changes the not get included with persistant phosphor. Can change if the operator changes the
@@ -172,11 +183,13 @@ The PPI display will need shaders for the following:
4. facility to include shore lines. This will change with range settings. If possible, can 4. facility to include shore lines. This will change with range settings. If possible, can
we include docks and tall buildings? Immediate is blue white same as targets. we include docks and tall buildings? Immediate is blue white same as targets.
5. Persistance (green yellow) for targets, clutter, and shore lines. Persistance should 5. Persistence (green yellow) for targets, clutter, and shore lines. Persistence uses
be ping pong. Lets suggest for persistance to be about 3 seconds. ping-pong framebuffers with a decay multiplier each frame. Target persistence is
approximately 3 seconds, matching the P7 phosphor decay to 10% brightness.
6. The pulse repitition time should be the same as a multiple of the screen update rate 6. The pulse repetition frequency (PRF) is a simulation parameter. At 24 RPM antenna
so that we would have no aliasing. rotation, one full sweep takes 2.5 seconds and produces ~150 frames at 60 fps —
smooth with no aliasing concern.
Communication: Communication:
@@ -188,33 +201,41 @@ ports. AIS requires a separate Raspberry Pi with its own SDR tuned to VHF 161/16
Each Raspberry Pi will act as a server fielding requests from this program. Each Raspberry Pi will act as a server fielding requests from this program.
Lets try to have each raspberry pi as a separate instantiation of a class Each Raspberry Pi is a separate instantiation of a class called RemoteTargetSource.
called raspberry pi. Those classes will use a common data structure: Those classes will use a common target data structure:
1. double longitude 1. double longitude
2. double latitude 2. double latitude
3. std::string *vessel_name 3. std::string vessel_name
4. std::string *registration 4. std::string registration
5. float *vessel_size 5. float length_meters
6. float course 6. float beam_meters
7. float speed 7. int vessel_type (AIS type code; aircraft type for ADS-B/UAT)
8. time_t timestame 8. uint32_t mmsi (AIS unique identifier; ICAO hex address for aircraft)
9. float altitude (0 for boats) 9. float course (course over ground, degrees)
10. Target type 10. float speed (speed over ground, knots)
11. time_t timestamp (time of last fix; used to age out stale targets)
12. float altitude (meters; 0 for surface vessels)
13. TargetType type (enum: vessel, aircraft, etc.)
Looking for suggesions The RPi communication thread blocks on a socket read until data arrives, then
writes to a shared target queue protected by a mutex and signals a condition
Each of these raspberry pis will called by a main function (running as its own thread) variable. The main application consumes from that queue.
to gather this data structure if there are any targets received since the last
call.
The Raspberry Pi code will live in a separate git repository with its own CLAUDE.md The Raspberry Pi code will live in a separate git repository with its own CLAUDE.md
and its own CMakeLists.txt, since it targets a different architecture (ARM) and has and its own CMakeLists.txt, since it targets a different architecture (ARM) and has
a different toolchain and dependencies. Do not mix it into this repository hierarchy. a different toolchain and dependencies. Do not mix it into this repository hierarchy.
The code will work on a blocking basis to block until something becomes available
It should be up to this piece to convert the global latitude and longitude to Is is possible to create the softward with the following temporary files:
cartesian coordinates for the display. Unless you suggest otherwise
Right now, I just want to make sure that the structure is okay and that the CMakeFile.txt 1. leave all controls to default; center for everything.
looks okay. I am not ready to ask you to create any code 2. create five fake targets, at random locations within the range
of the radar, moving randomly at normal boat speeds. Us variety of sizes
Have it able to run without the controls and the Raspbery pi stuff as I need
to purchase the raspberry pi 5 units
Just evaluate and give estimate on amouint of time/tokens and about the total
tokens, time, and number of lines of code
Please do not generate code. Just comments.