Skip to content

Conversation

@Shilo-Jeyaraj
Copy link

No description provided.

Copy link
Collaborator

@benjtran benjtran left a comment

Choose a reason for hiding this comment

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

Nice job :D
I noticed you made it compatible with fence and rally items. Could you include sample fence + rally points to confirm they can be properly written and read consecutively from the drone? Once this is validated, this feature will be approved to merge.

@benjtran
Copy link
Collaborator

Also why did you make another IMACS.yaml file within radio?

@Shilo-Jeyaraj
Copy link
Author

Shilo-Jeyaraj commented Oct 11, 2025 via email

…lity

- Added sample mission items (San Francisco to British Columbia)
- Added sample fence items (4-vertex polygon around SF area)
- Added sample rally points (3 rally points around SF area)
- Added test buttons to easily switch between mission types
- All mission types now have test data for validation
Copy link
Collaborator

@benjtran benjtran left a comment

Choose a reason for hiding this comment

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

The sample rally waypoints are there; however, when writing them to the drone it fails to upload: "Mission upload failed: Could not upload mission, received mission acknowledgement error". It may be worth reviewing uploadMission() in MissionController to verify that you're passing in the correct mission type.

Also there seems to be no fence wps

Comment on lines 479 to 520
<Divider className="my-1" />

{/* Test buttons for validation */}
<div className="flex flex-col gap-2">
<div className="text-sm text-gray-400 mb-2">Test All Mission Types:</div>
<div className="flex gap-2">
<Button
onClick={() => {
setActiveTab("mission")
console.log("🧪 Testing Mission items:", missionItems.length)
}}
variant="outline"
size="sm"
className="flex-1"
>
Test Mission ({missionItems.length})
</Button>
<Button
onClick={() => {
setActiveTab("fence")
console.log("🧪 Testing Fence items:", fenceItems.length)
}}
variant="outline"
size="sm"
className="flex-1"
>
Test Fence ({fenceItems.length})
</Button>
<Button
onClick={() => {
setActiveTab("rally")
console.log("🧪 Testing Rally items:", rallyItems.length)
}}
variant="outline"
size="sm"
className="flex-1"
>
Test Rally ({rallyItems.length})
</Button>
</div>
</div>

Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need these buttons

README.md Outdated
#### Creating a virtual environment

Create a new Python virtual environment using `python -m venv venv`. This can then be activated using `./venv/scripts/activate`.
Create a new Python virtual environment using `python -m venv venv`. This can then be activated using `C`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need to change this

Copy link
Collaborator

@benjtran benjtran left a comment

Choose a reason for hiding this comment

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

Just some cleanup needed then ready to merge !

Comment on lines 50 to 81
defaultValue: [
{
id: uuidv4(),
seq: 0,
command: 16, // MAV_CMD_NAV_WAYPOINT
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7749, // San Francisco latitude
y: -122.4194, // San Francisco longitude
z: 100.0, // altitude
},
{
id: uuidv4(),
seq: 1,
command: 16, // MAV_CMD_NAV_WAYPOINT
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 49.2827, // British Columbia latitude
y: -123.1207, // British Columbia longitude
z: 150.0, // altitude
}
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Revert these changes back to the original waypoints from main

Comment on lines 53 to 196
defaultValue: [],
defaultValue: [
{
id: uuidv4(),
seq: 0,
command: 16, // MAV_CMD_NAV_WAYPOINT (using waypoint command for SITL compatibility)
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7849, // Fence vertex 1 - slightly north of SF
y: -122.4094, // Fence vertex 1 - slightly east of SF
z: 200.0, // max altitude
},
{
id: uuidv4(),
seq: 1,
command: 16, // MAV_CMD_NAV_WAYPOINT (using waypoint command for SITL compatibility)
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7649, // Fence vertex 2 - slightly south of SF
y: -122.4094, // Fence vertex 2 - slightly east of SF
z: 200.0, // max altitude
},
{
id: uuidv4(),
seq: 2,
command: 16, // MAV_CMD_NAV_WAYPOINT (using waypoint command for SITL compatibility)
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7649, // Fence vertex 3 - slightly south of SF
y: -122.4294, // Fence vertex 3 - slightly west of SF
z: 200.0, // max altitude
},
{
id: uuidv4(),
seq: 3,
command: 16, // MAV_CMD_NAV_WAYPOINT (using waypoint command for SITL compatibility)
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7849, // Fence vertex 4 - slightly north of SF
y: -122.4294, // Fence vertex 4 - slightly west of SF
z: 200.0, // max altitude
}
],
})
const [rallyItems, setRallyItems] = useSessionStorage({
key: "rallyItems",
defaultValue: [],
defaultValue: [
{
id: uuidv4(),
seq: 0,
command: 16, // MAV_CMD_NAV_WAYPOINT (using waypoint command for SITL compatibility)
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7849, // Rally point 1 - north of SF
y: -122.4094, // Rally point 1 - east of SF
z: 120.0, // altitude
},
{
id: uuidv4(),
seq: 1,
command: 16, // MAV_CMD_NAV_WAYPOINT (using waypoint command for SITL compatibility)
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7649, // Rally point 2 - south of SF
y: -122.4294, // Rally point 2 - west of SF
z: 130.0, // altitude
},
{
id: uuidv4(),
seq: 2,
command: 16, // MAV_CMD_NAV_WAYPOINT (using waypoint command for SITL compatibility)
frame: 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
current: 0,
autocontinue: 1,
param1: 0.0,
param2: 0.0,
param3: 0.0,
param4: 0.0,
x: 37.7749, // Rally point 3 - center SF
y: -122.4194, // Rally point 3 - center SF
z: 110.0, // altitude
}
],
Copy link
Collaborator

Choose a reason for hiding this comment

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

We'll have 0 fence and rally waypoints by default

Comment on lines 278 to 288
socket.on("upload_mission_result", (data) => {
console.log("📨 Received upload_mission_result:", data)
setIsUploading(false)
if (data.success) {
console.log("✅ Mission upload successful!")
showSuccessNotification(data.message)
} else {
console.log("❌ Mission upload failed:", data.message)
showErrorNotification(data.message)
}
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: remove the console logs so we dont clog it

Comment on lines 349 to 432
console.log("🚀 Write Mission Button Pressed!")
console.log("📊 Current state:", {
connected,
isUploading,
activeTab,
missionItemsCount: missionItems.length,
fenceItemsCount: fenceItems.length,
rallyItemsCount: rallyItems.length
})

if (!connected) {
console.log("❌ Not connected to drone")
showErrorNotification("Not connected to drone")
return
}

if (isUploading) {
console.log("⏳ Mission upload already in progress")
showErrorNotification("Mission upload already in progress")
return
}

let missionData = []
if (activeTab === "mission") {
missionData = missionItems
console.log("📋 Using mission items:", missionItems)
} else if (activeTab === "fence") {
missionData = fenceItems
} else if (activeTab === "rally") {
missionData = rallyItems
}

if (missionData.length === 0) {
console.log(`❌ No ${activeTab} items to upload`)
showErrorNotification(`No ${activeTab} items to upload`)
return
}

console.log(`✅ Found ${missionData.length} ${activeTab} items to upload`)

setIsUploading(true)

// Convert mission items to the format expected by the backend
const formattedMissionData = missionData.map((item, index) => {
const formatted = {
seq: index,
frame: item.frame || 3, // MAV_FRAME_GLOBAL_RELATIVE_ALT
command: item.command || 16, // MAV_CMD_NAV_WAYPOINT
current: item.current || 0,
autocontinue: item.autocontinue || 1,
param1: item.param1 || 0.0,
param2: item.param2 || 0.0,
param3: item.param3 || 0.0,
param4: item.param4 || 0.0,
x: Math.round((item.x || 0) * 1e7), // latitude as integer (1e7 * degrees)
y: Math.round((item.y || 0) * 1e7), // longitude as integer (1e7 * degrees)
z: item.z || 0.0, // altitude
}
console.log(`📝 Formatted item ${index}:`, formatted)


return formatted
})

console.log("📤 Sending mission data to backend:", {
type: activeTab,
mission_data: formattedMissionData
})

socket.emit("upload_mission", {
type: activeTab,
mission_data: formattedMissionData,
})

console.log("⏰ Setting 30-second timeout for upload...")

// Set a timeout to handle cases where the upload might hang
setTimeout(() => {
if (isUploading) {
console.log("⏰ Mission upload timed out!")
setIsUploading(false)
showErrorNotification("Mission upload timed out. Please try again.")
}
}, 30000) // 30 second timeout
Copy link
Collaborator

Choose a reason for hiding this comment

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

Console logs can be removed

radio/IMACS.yml Outdated
Comment on lines 1 to 2
logs:
location: "" No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file is not needed

Copy link
Collaborator

Choose a reason for hiding this comment

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

This file is not needed

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can delete this file

Copy link
Collaborator

@benjtran benjtran left a comment

Choose a reason for hiding this comment

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

Remove your changes to the readme and delete this file: "t! Backend is running. Next steps"

Copy link
Collaborator

@benjtran benjtran left a comment

Choose a reason for hiding this comment

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

lgtm

@benjtran benjtran merged commit 7d00584 into main Nov 3, 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.

4 participants