Skip to content

Conversation

miyatakazuya
Copy link
Contributor

@miyatakazuya miyatakazuya commented May 19, 2025

This PR introduces the Refueling tick, as well as overall changes to the FSM based on the new mission plan.
While it is a large PR, the changes are simple (when compared to the beast that is feat/cv-everything).

  1. Refueling
  • This tick queries the mav to check its armed status. If it is rearmed, then it signals that the team has re-armed a new payload onto the drone and so the tick escapes onto the next.
  • The tick prior to this is airdrop_approach, and the decision to either terminate the mission/land or refuel is based on the amount of airdrops that have been dropped so far.
  • The active_takeoff tick has also been modified to skip the CV procedure if we have done them already.
  1. Other changes
  • Minor changes to static.cpp and the searchBoundPath generation.

Closes: #242 #241 #235 #240

@kimichenn kimichenn changed the base branch from main to feat/cv-everything May 21, 2025 21:30
@miyatakazuya miyatakazuya changed the title Feat/cv everything mappingbound Implement Refueling + Tick restructuring May 22, 2025
@Fox-King777 Fox-King777 marked this pull request as ready for review May 26, 2025 23:08
@Fox-King777 Fox-King777 force-pushed the feat/cv-everything-mappingbound branch from c9d0ce7 to ab4565f Compare May 26, 2025 23:11
@Fox-King777 Fox-King777 requested a review from AskewParity May 27, 2025 00:17
@Fox-King777 Fox-King777 requested a review from AskewParity May 28, 2025 08:43
const std::chrono::milliseconds MISSION_DONE_TICK_WAIT = std::chrono::milliseconds(100);
const std::chrono::milliseconds ACTIVE_TAKEOFF_TICK_WAIT = std::chrono::milliseconds(100);
const std::chrono::milliseconds WAIT_FOR_TAKEOFF_TICK_WAIT = std::chrono::milliseconds(100);
const std::chrono::milliseconds REFUELING_TICK_WAIT = std::chrono::milliseconds(10000);
Copy link
Contributor

@AskewParity AskewParity May 28, 2025

Choose a reason for hiding this comment

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

Why does this need to be 10 seconds?

edit: This seems to be a workaround for preventing the tick system to short circuit refuel. I still don't think this is necessarily a good option:

  1. Doesn't guarantee that we are safe, which defeats the point of the refuel tick.
  2. Minor, after refueling, we could be waiting 10 seconds until it takes off.
    • More Major - in the GCS, we would need to know when the tick is in waitfortakeoff in order to tell it to takeoff; the alternative is to keep spamming takeoff until it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep I think this should be reverted to 100.

if (imageData.TELEMETRY.has_value()) {
targetPosition = this->gsdLocalizer.localize(imageData.TELEMETRY.value(), box);
std::cout << "pipeline: " << targetPosition.latitude() << " " << targetPosition.longitude();
std::cout << "pipeline: " <<
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to be a debugging statement


MissionPath generateSearchPath(std::shared_ptr<MissionState> state) {
std::vector<GPSCoord> gps_coords;
if (state->config.pathing.coverage.method == AirdropCoverageMethod::Enum::FORWARD) {
Copy link
Contributor

Choose a reason for hiding this comment

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

has this been tested?


Tick* ManualLandingTick::tick() {
return nullptr;
return next_tick;
Copy link
Contributor

@AskewParity AskewParity May 28, 2025

Choose a reason for hiding this comment

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

This is an issue? Take the following:

  1. We intend to refuel --> We set next tick to be the refuel tick.
  2. In manual landing, it immediately transitions to refuel tick.
    • The safety pilot is still landing the aircraft.
    • The plane is armed.
  3. The refuel tick will immediately exit, as the plane is still armed

Therefore, the arm check that refuel is meant to do is contingent on whether or not the safety pilot lands the plane in time for the first execution of the refuel tick.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an oversight on my part...
Should have a event trigger that is David dis-arming the plane, which signals the 'end' of manual_landing.
I'll add that back in for clarity

@miyatakazuya miyatakazuya requested a review from AskewParity May 28, 2025 18:49
@tuas-travis-ci
Copy link
Contributor

lint por favor

Copy link
Contributor

@AskewParity AskewParity left a comment

Choose a reason for hiding this comment

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

Everything looks ok. Forward Coverage pathing is still buggy, but we don't use it at the moment and the alternate works.

@miyatakazuya miyatakazuya merged commit c229ba4 into feat/cv-everything May 29, 2025
1 of 2 checks passed
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.

5 participants