mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.3k stars 3.63k forks source link

Plan: Resume mission after RTL for battery change #4883

Closed DonLakeFlyer closed 7 years ago

DonLakeFlyer commented 7 years ago

Discussion starts in #4868. Rest of discussion should be here.

Antiheavy commented 7 years ago

I can't speak to the inner workings of the code, but as a user of many ground stations over the years I've seen the following behavior is typical. Actually, this may be more of an autopilot thing than a ground station thing although the two obviously work together:

dagar commented 7 years ago

A lot of that would need to exist on the firmware side (which I'm happy to help with).

Correct me if I'm way off here, but if we first had a solid mechanism for ensuring GCS and autopilot mission were in sync would it make the more advanced features feasible?

DonLakeFlyer commented 7 years ago

It's more complicated that just that. At the beginning of a mission (or in the middle even) there can be various camera setup commands like setting up the distance trigger for example.If you want to resume a survey you need to restart the camera as well or you'll fly the pattern but take no images.

DonLakeFlyer commented 7 years ago

So you actually need to regenerate the mission, pulling all the DO commands off the front up to the point where you want to resume and then add the rest of the mission. Then send the new mission to the vehicle. Then you need to think about what you do with taking off for the resumed mission. Do you have to manually take off? Or do you also magically pull the takeoff sequence from the front and stuff that back in as well. It's get crazy pretty fast.

DonLakeFlyer commented 7 years ago

More problems: If you RTL to swap batteries on a fixed wing, won't it just go the DO_LAND_START which in turn will trash your mission current item to go back to?

DonLakeFlyer commented 7 years ago

I just tried an RTL in SITL from the middle of the mission. When the vehicle landed vehicle reset current mission item to 0.

dagar commented 7 years ago

I didn't realize this was about landing mid-survey mission and resuming. I was mainly thinking of the case where you're currently flying a mission and want to tweak a waypoint mid-flight.

I know this isn't immediately helpful, but I was thinking many of the survey issues could go away if the autopilot actually had an understanding of what it was doing instead of just dumbly executing a command sequence. That could mean either a single mission item that outlines the polygon (the autopilot is now responsible for calculating the grid), simply marking the start and end of a survey sequence, or just having individual trigger commands throughout.

DonLakeFlyer commented 7 years ago

The point is to be able to do a battery change in the middle of a mission and then keep going.

Antiheavy commented 7 years ago

Ah, some topic confusion on my part too. I'd argue good behavior with updating a mission in flight is a more fundamental capability than mission resume (i.e. everyone would expect a UAV to be able to do that). However, mission resume is a really good feature for surveys and I am excited about the capability. Are there discussions elsewhere that describe the intended functionality?

The different ways Fixed Wing and VTOL handle takeoff and landing could make certain approaches to resume problematic. Are you depending on the autopilot to remember where it left off or is QGC going to remember where it left off and send the vehicle there at the appropriate time?

I don't really know how this is intended to work, but this is how I'm brainstorming about it:

dagar commented 7 years ago

@DonLakeFlyer have you considered surveying with one waypoint + DO_DIGICAM_CONTROL placed at each desired image location? With that type of survey mission QGC could pause the mission (save current index + RTL), then use MAV_CMD_MISSION_START (specify start index) to resume. MC and VTOL handle the takeoff properly without a takeoff waypoint. FW doesn't really, but could with a little thought.

DonLakeFlyer commented 7 years ago

I have it all figured out. I'll explain soon.

DonLakeFlyer commented 7 years ago

Ok, here is how it works:

Not done:

The list of commands which are looked for to get re-added at the beginning of the mission are:

Here is the visual sequence, using a Survey as an example:

Plan a Survey: screen shot 2017-03-30 at 9 50 55 am

Fly the Survey: screen shot 2017-03-30 at 9 54 15 am

RTL from middle of Survey: screen shot 2017-03-30 at 9 58 03 am

After battery swap and reconnect, click Resume Mission: screen shot 2017-03-30 at 9 58 49 am

Confirm resume mission: screen shot 2017-03-30 at 9 59 02 am

Confirm changed mission: screen shot 2017-03-30 at 9 59 13 am

DonLakeFlyer commented 7 years ago

have you considered surveying with one waypoint + DO_DIGICAM_CONTROL placed at each desired image location?

You can't do that because it blows up the mission item count like crazy on large surveys and can exceed the mission space available on the vehicle.

DonLakeFlyer commented 7 years ago

For fixed wing I think it comes down to being the operators job to get the vehicle back up into the air. And then they can resume. The guided bar is not yet set up for that but I will fix as I finish fleshing this out.

NaterGator commented 7 years ago

For fixed wing I think it comes down to being the operators job to get the vehicle back up into the air. And then they can resume. The guided bar is not yet set up for that but I will fix as I finish fleshing this out.

An option for that is to ignore everything past MAV_CMD_DO_LAND_START since that can be considered part of the landing approach. The mission logic then just needs to manage the jump from FW takeoff to resume_seq_no instead of the waypoint following takeoff.

dagar commented 7 years ago

The current PX4 nuttx (pixhawk) mission limit is 2000 commands, and UINT16 on other platforms.

On Thu, Mar 30, 2017 at 1:15 PM, Don Gagne notifications@github.com wrote:

have you considered surveying with one waypoint + DO_DIGICAM_CONTROL placed at each desired image location?

You can't do that because it blows up the mission item count like crazy on large surveys and can exceed the mission space available on the vehicle.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mavlink/qgroundcontrol/issues/4883#issuecomment-290479118, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFK6OoDk3MWCs7yvfwzcbu4DpqLqgCDks5rq-MhgaJpZM4MtPl4 .

DonLakeFlyer commented 7 years ago

The current PX4 nuttx (pixhawk) mission limit is 2000 commands,

If only my life were as simple as to only need to run on a single firmware type :)

DonLakeFlyer commented 7 years ago

An option for that is to ignore everything past MAV_CMD_DO_LAND_START since that can be considered part of the landing approach.

MAV_CMD_DO_LAND_START ? I don't get it. To me the only way to pull a correct takeoff sequence from the beginning of mission would be if there was some sort of MAV_CMD_DO_TAKEOFF_STOP marker.

dagar commented 7 years ago

To be honest this feels like we're fighting a bad abstraction, but I'll try to be productive.

What if the first time you create the survey you have a NOP jump at the beginning (just after the camera setup). At pause you store the current index to update the jump (could be immediate, or when you click "Resume Mission (9)") and then you RTL. After replacing the battery you simply start the mission again. Same takeoff, same camera setup, jump to where you left off and continue.

DonLakeFlyer commented 7 years ago

Camera commands can be anywhere in the mission not just at the beginning. With waypoint interspersed in between.

DonLakeFlyer commented 7 years ago

To be honest this feels like we're fighting a bad abstraction

Tell me something I don't know.

Antiheavy commented 7 years ago

The current PX4 nuttx (pixhawk) mission limit is 2000 commands, and UINT16 on other platforms.

We often fly survey type missions with many more than 2000 photo points.

DonLakeFlyer commented 7 years ago

This is all working. But I'm not very happy with the requirement to not disconnect from the vehicle. Looking into how to not require that.

DonLakeFlyer commented 7 years ago

Going to live with no disconnecting for 3.2