bluerobotics / bluerobotics/cockpit
Mission planning should not send a DO_SET_HOME command; the home point should travel as the mission's first waypoint
- Dominant language
- TypeScript
- Stars
- 198
- Forks
- 63
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 57
Description
Setting a home point in mission planning immediately sends `MAV_CMD_DO_SET_HOME` to the vehicle (`src/views/MissionPlanningView.vue:2216-2232`):
```ts
const setHomePosition = async (): Promise => {
if (!currentCursorGeoCoordinates.value) return
const newHome: [number, number] = [currentCursorGeoCoordinates.value[0], currentCursorGeoCoordinates.value[1]]
try {
home.value = newHome
await vehicleStore.setHomeWaypoint(newHome, 0)
```
This is wrong in principle — mission planning is a planning surface and should not mutate vehicle state until the mission is uploaded — and it is redundant in practice, since `uploadMissionToVehicle` already unshifts the home point as mission item 0 (`src/views/MissionPlanningView.vue:924-932`), which is what the autopilot uses as home.
`setHomePosition` is reached from four places, and only the first two are the user explicitly asking for a home point:
- the map context menu (line 2211),
- the click-to-place home tool (line 2714),
- dragging the home marker (line 4398), and
- downloading a mission from the vehicle (lines 1024-1029), which is an automatic side effect of the download and belongs to the same bug class as #2869.
## Expected behavior
Setting or moving the home point in mission planning updates local planning state only, and the home point reaches the vehicle as mission item 0 on upload.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.