Skip to content
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d0118e4
Chat: openai chat tool
rmackay9 Feb 6, 2025
4773e63
Chat: add MAVLink support
rmackay9 Feb 10, 2025
379fd51
Chat: mess about with type to mavlink send to work
IamPete1 Feb 10, 2025
5f0a988
Chat: add mavlink store and handle function calls
rmackay9 Feb 10, 2025
873b491
Chat: Fix send button by adding proper event listener
AnasChebili Mar 6, 2025
46fdf1e
Chat: added get_vehicle_location_and_yaw definition
AnasChebili Mar 27, 2025
8dc5a88
Chat: implemented get_vehicle_state function's definition
AnasChebili Apr 28, 2025
586a848
Chat: fix error with api key visibility toggle button; fix heartbeat_…
AnasChebili Mar 19, 2025
5a741d0
Chat: added support for recording functionality
AnasChebili Mar 9, 2025
3a84de6
Chat: Refactor chat: update layout, add shared.js and style.css
esatiyev Jun 29, 2025
817791a
Chat: add wakeup timers, fix UI bug
esatiyev Jul 2, 2025
2384c04
Chat: Refactor style.css: Remove unused styles
esatiyev Jul 14, 2025
3825013
Chat: Implement PARAM_VALUE handling, add parameter functions, minor …
esatiyev Jul 14, 2025
dc915ab
Chat: Added find_message_by_name function
esatiyev Jul 14, 2025
b9f9e69
Chat: Fixed an error: Transcription error: TypeError: Cannot read pro…
esatiyev Jul 17, 2025
4d1482f
Chat: Add chat session restore and busy state; clean up code
esatiyev Aug 3, 2025
31d7b35
Dev: add Chat link including icon
rmackay9 Feb 6, 2025
06aab8b
Chat: Remove unused Chat.js and mavlink_msgs.js
esatiyev Aug 14, 2025
bd416a5
modules: moved MAVLink to modules directory
tridge Aug 10, 2025
8dc58e8
modules: moved mavlink_store.js from Chat/MAVLink to modules/MAVLink
esatiyev Aug 14, 2025
6803bc6
Chat: remove old MAVLink module and update imports to use modules/MAV…
esatiyev Aug 14, 2025
c8e242f
Chat: align send method with new mavlink module and update mavlink.js…
esatiyev Aug 19, 2025
3d12c93
module: enforce singleton pattern for MAVLinkMessageStore
esatiyev Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Chat/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Chat

OpenAI based Chat module
2,126 changes: 2,126 additions & 0 deletions Chat/index.html

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions Chat/shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// shared.js
export let MAVLink = null;
export let mavlink_ws = null;

export function setMAVLink(instance) {
MAVLink = instance;
}

export function setMavlinkWS(ws) {
mavlink_ws = ws;
}
24 changes: 24 additions & 0 deletions Chat/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Chat messages */
.user-text {
align-self: flex-end;
background-color: #2563eb; /* blue-600 */
color: #fff;
padding: 10px 16px;
border-radius: 18px 18px 4px 18px;
max-width: 70%;
margin: 4px 0;
font-size: 1rem;
box-shadow: 0 1px 2px rgba(0,0,0,0.07);
}

.assistant-text {
align-self: flex-start;
background-color: #f3f4f6; /* gray-100 */
color: #222;
padding: 10px 16px;
border-radius: 18px 18px 18px 4px;
max-width: 70%;
margin: 4px 0;
font-size: 1rem;
box-shadow: 0 1px 2px rgba(0,0,0,0.07);
}
11 changes: 11 additions & 0 deletions Dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ <h2>Thrust Expo</h2>
</td>
</tr>

<tr>
<td>
<a href="../Chat" style="margin: 20px; display: inline-block;"><img src="../images/Chat_Icon.png" style="width:200px"></a>
</td>
<td style="text-align:left; vertical-align:top; max-width:960px;">
<h2>Chat</h2>
OpenAI Chat module
Use an AI chat to control your vehicle
</td>
</tr>

</table>

</body>
Expand Down
Binary file added images/Chat_Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions modules/MAVLink/local_modules/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This folder is a locally modified copy of some Node/npm packages 'jspack' and 'long'. we have copied them here and tweaked them to be compatible with our needs, please see their respective README.md file for their original info, which we have not changed.

This README.md serves to make you aware that these two packages as stored here in the 'jspack' and 'long' folders ARE MODIFIED from the originals.
By placing this statement here, and putting a notice in long.js as well, we feel are in compliance with the LICENSE file of 'long' , which requires us to tell you they are modified.

We have included their original license files, in compliance with them, as both license/s permit distribution of derived works in source and/or binary form.
19 changes: 19 additions & 0 deletions modules/MAVLink/local_modules/jspack/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.pyc

pids
logs
results

npm-debug.log
node_modules

**~
**.swp
26 changes: 26 additions & 0 deletions modules/MAVLink/local_modules/jspack/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) 2008, Fair Oaks Labs, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

* Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
147 changes: 147 additions & 0 deletions modules/MAVLink/local_modules/jspack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
jspack - library to pack primitives to octet arrays
====================================================

[![Build status](https://travis-ci.org/birchroad/node-jspack.svg?branch=master)](https://travis-ci.org/birchroad/node-jspack)

## Disclaimer
The jspack module and documentation are essentially ports of the
Python struct module and documentation, with such changes as were necessary. The port was originally made by Fair Oaks Labs, Inc. and published at http://code.google.com/p/jspack/
If any Python people are miffed that their documentation got ripped off, let me know,
and I'll gladly revise them.

This module performs conversions between JavaScript values and C structs
represented as octet arrays (i.e. JavaScript arrays of integral numbers
between 0 and 255, inclusive). It uses format strings (explained below) as
compact descriptions of the layout of the C structs and the intended conversion
to/from JavaScript values. This can be used to handle binary data stored in
files, or received from network connections or other sources.

## Install
npm install jspack

## Reference

The module defines the following functions:

### Unpack(fmt, a, p)
Return an array containing values unpacked from the octet array a,
beginning at position p, according to the supplied format string. If there
are more octets in a than required by the format string, the excess is
ignored. If there are fewer octets than required, Unpack() will return
undefined. If no value is supplied for the p argument, zero is assumed.

### PackTo(fmt, a, p, values)
Pack and store the values array into the supplied octet array a, beginning
at position p. If there are more values supplied than are specified in the
format string, the excess is ignored. If there are fewer values supplied,
PackTo() will return false. If there is insufficient space in a to store
the packed values, PackTo() will return false. On success, PackTo() returns
the a argument. If any value is of an inappropriate type, the results are
undefined.

### Pack(fmt, values)
Return an octet array containing the packed values array. If there are
more values supplied than are specified in the format string, the excess is
ignored. If there are fewer values supplied, Pack() will return false. If
any value is of an inappropriate type, the results are undefined.

### CalcLength(fmt)
Return the number of octets required to store the given format string.


## Formats
Format characters have the following meanings; the conversion between C and
JavaScript values should be obvious given their types:

Format | C Type | JavaScript Type | Size (octets) | Notes
-------------------------------------------------------------------
A | char[] | Array | Length | (1)
x | pad byte | N/A | 1 |
c | char | string (length 1) | 1 | (2)
b | signed char | number | 1 | (3)
B | unsigned char | number | 1 | (3)
h | signed short | number | 2 | (3)
H | unsigned short | number | 2 | (3)
i | signed int | number | 4 | (3)
I | unsigned int | number | 4 | (3)
l | signed long | number | 4 | (3)
L | unsigned long | number | 4 | (3)
q | signed long | number | 8 | (6)
Q | unsigned long | number | 8 | (6)
s | char[] | string | Length | (2)
f | float | number | 4 | (4)
d | double | number | 8 | (5)

*Notes:*

**(1)** The "A" code simply returns a slice of the source octet array. This is
primarily useful when a data structure contains bytes which are subject to
multiple interpretations (e.g. unions), and the data structure is being
decoded in multiple passes.

**(2)** The "c" and "s" codes handle strings with codepoints between 0 and 255,
inclusive. The data are not bounds-checked, so strings containing characters
with codepoints outside this range will encode to "octet" arrays that contain
values outside the range of an octet. Furthermore, since these codes decode
octet arrays by assuming the octets represent UNICODE codepoints, they may
not "correctly" decode bytes in the range 128-255, since that range is subject
to multiple interpretations. Caveat coder!

**(3)** The 8 "integer" codes clip their encoded values to the minima and maxmima
of their respective types: If you invoke Struct.Pack('b', [-129]), for
instance, the result will be [128], which is the octet encoding of -128,
which is the minima of a signed char. Similarly, Struct.Pack('h', [-32769])
returns [128, 0]. Fractions are truncated.

**(4)** Since JavaScript doesn't natively support 32-bit floats, whenever a float
is stored, the source JavaScript number must be rounded. This module applies
correct rounding during this process. Numbers with magnitude greater than or
equal to 2^128-2^103 round to either positive or negative Infinity. The
rounding algorithm assumes that JavaScript is using exactly 64 bits of
floating point precision; 128-bit floating point will result in subtle errors.

**(5)** This module assumes that JavaScript is using 64 bits of floating point
precision, so the "d" code performs no rounding. 128-bit floating point will
cause the "d" code to simply truncate significands to 52 bits.

**(6)** Since 64bit longs cannot be represented by numbers JavaScript, this version of
jspack will process longs as arrays in the form: ```[lowBits, hightBits]```. The
decoded long array contains a third element, the unsigned flag, which is ```false``` for signed
and ```true``` for unsigned values.
This representation is similar to what [Long.js](https://github.com/dcodeIO/Long.js), and
therefore the [Google Closure Libaray](https://github.com/google/closure-library), uses.
See [test/int64.js](test/int64.js) for examples how to work with Long.js.

A format character may be preceded by an integral repeat count. For example,
the format string "4h" means exactly the same thing as "hhhh".

Whitespace characters between formats are ignored; a count and its format must
not be separated by whitespace, however.

For the "A" format character, the count is interpreted as the size of the
array, not a repeat count as for the other format characters; for example, "10A"
means a single 10-octet array. When packing, the Array is truncated or padded
with 0 bytes as appropriate to make it conform to the specified length. When
unpacking, the resulting Array always has exactly the specified number of bytes.
As a special case, "0A" means a single, empty Array.

For the "s" format character, the count is interpreted as the size of the
string, not a repeat count as for the other format characters; for example,
"10s" means a single 10-byte string, while "10c" means 10 characters. When
packing, the string is truncated or padded with 0 bytes as appropriate to make
it conform to the specified length. When unpacking, the resulting string always
has exactly the specified number of bytes. As a special case, "0s" means a
single, empty string (while "0c" means 0 characters).


By default, C numbers are represented in network (or big-endian) byte order.
Alternatively, the first character of the format string can be used to indicate
byte order of the packed data, according to the following table:

Character | Byte Order
----------------------------------
< | little-endian
> | big-endian
! | network (= big-endian)

If the first character is not one of these, "!" is assumed.
Loading