Skip to content

Conversation

@esatiyev
Copy link

@esatiyev esatiyev commented Jul 24, 2025

This pull request contains the current working version of the AI Chat WebTool being developed under Google Summer of Code 2025.

The implementation builds upon prior work by @rmackay9 and other contributors. My additions are integrated with that foundation and reflect the state of development so far.

All changes have been tested locally. Feedback is welcome.

Screenshot from 2025-08-07 11-55-51

@rmackay9 rmackay9 requested a review from Copilot July 31, 2025 07:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces an AI Chat WebTool for Google Summer of Code 2025 that enables natural language control of ArduPilot vehicles through OpenAI's assistant API. The implementation builds upon prior work and integrates MAVLink communication for real-time vehicle control.

Key changes include:

  • Creation of a complete chat interface with OpenAI integration for vehicle control commands
  • Implementation of MAVLink messaging and parameter handling for vehicle communication
  • Addition of voice-to-text functionality for hands-free operation

Reviewed Changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Chat/index.html Main application interface with chat UI, MAVLink integration, and OpenAI assistant functionality
Chat/style.css CSS styling for user and assistant chat message bubbles
Chat/shared.js Shared module for exporting MAVLink instances across components
Chat/mavlink_msgs.js Auto-generated MAVLink message definitions and component mappings
Chat/Readme.md Basic documentation describing the OpenAI-based chat module
Chat/MAVLink/mavlink_store.js MAVLink message storage and retrieval system for caching vehicle data
Chat/MAVLink/local_modules/long/* Local copy of the Long.js library for 64-bit integer operations

IamPete1 and others added 13 commits August 3, 2025 21:24
…msg typo; changed label's for to match input id
- Added and Fixed functions to set, get, delete, and check wakeup timers
- Implemented get_mode_mapping function
- Fixed minor UI design issue
- Updated handleTranscription to add FormData field language=en to enforce English in Whisper transcription
…UI change

- Added case 22 in mavlink_msg_handler for handling PARAM_VALUE messages
- Converted handle_function_call to async
- Added functions for use in handle_function_call:
  - get_parameter
  - get_all_parameters
  - get_parameter_description
  - set_parameter
  - get_mavlink_message
  - get_available_mavlink_messages
- Made small UI adjustments
- Made small UI adjustments
…perties of null (reading 'apiKey')

Added a new “Connect AI” button so users can initialize the assistant before sending messages

Linked the button to the connection routine and exposed the function globally for other modules

Updated audio transcription to ensure a connection to OpenAI exists before sending the audio for processing
- Add "Start New Chat" button and support for restoring previous chat sessions with thread id
- Display prompt to continue or reset previous sessions on page load
- Introduce chat busy state to prevent race conditions; disable UI controls during chat operations
- Remove unnecessary functions for arming/disarming vehicle
- Enhance parameter metadata loading
- Clean up labels, error handling, and general code structure
@khanasif786
Copy link

@esatiyev We can add tool in the Development section "Work is Progress Tools"

@esatiyev
Copy link
Author

esatiyev commented Aug 5, 2025

@khanasif786 Done, thanks

@rmackay9
Copy link

rmackay9 commented Aug 7, 2025

@esatiyev, could you post a picture of the webtool in the description at the top? That will let people know more quickly what it looks like.

Copy link

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for this!

@IamPete1
Copy link
Member

There is a bit of MAVLink re-work in #267 too. It would be good if they could converge to keep the lib in the same place and use it in the same way.

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Chat.js and mavlink_msgs.js can just be removed?

@esatiyev
Copy link
Author

I think Chat.js and mavlink_msgs.js can just be removed?

I have removed the unnecessary files as suggested in commit 06aab8b . Thanks.

@esatiyev
Copy link
Author

There is a bit of MAVLink re-work in #267 too. It would be good if they could converge to keep the lib in the same place and use it in the same way.

I’ve moved MAVLink to modules, same as in PR #267, and updated my index.html file to use it.

@esatiyev esatiyev requested a review from IamPete1 August 19, 2025 01:35
@esatiyev esatiyev changed the title AI Chat WebTool for GSoC 2025: Current Progress Add a new WebTool: AI Chat WebTool Aug 21, 2025
<!-- script for Mavlink export -->
<script src="shared.js"></script>
<!-- simple script functions local to this page -->
<script type="module">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this script to a separate file. It would improve the performance and readability.

eyeIconContainer.innerHTML = eyeClosedSVGPath;
}
}
// listener for toggle api key visibility button click

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// listener for toggle api key visibility button click
// listener for toggle api key visibility button click

}

// attach event listener to the connect button
if (connect_button) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the if statement needed?

document.getElementById("mavlink-disarm-button").addEventListener("click", mavlink_disarm_vehicle);

// add text to debug text box
function add_text_to_debug(text) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also put an auto-scroll toggle button?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not for this PR

const new_thread = await openai.beta.threads.create();
return new_thread ? new_thread.id : null;
} catch (error) {
return null;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also log the error to console?

@esatiyev esatiyev mentioned this pull request Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants