Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add payload release mode in plane #1

Closed
shovan777 opened this issue May 11, 2020 · 8 comments
Closed

Add payload release mode in plane #1

shovan777 opened this issue May 11, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@shovan777
Copy link
Collaborator

shovan777 commented May 11, 2020

Feature request

Is your feature request related to a problem? Please describe.
_A Payload dropped with do_set_servo() simply opens the servo at the given location so, we have no control over where the payload drops. The problem is much more grave in fixed wing UAVs as payload is dropped from a moving aircraft making it accelerate and drop in uncontrolled manner.

Describe the solution you'd like
_A Make a mode called payload_release which will plan the location to release the payload and move the aircraft in such a way that payload is dropped to the targeted location precisely.
Describe alternatives you've considered
_A Other solution may involve beacon system or the whole flight planning and release point selection may be done at a higher level of abstraction in the ground control station.
Platform
[ ] All
[ ] AntennaTracker
[ ] Copter
[ x ] Plane
[ ] Rover
[ ] Submarine

Additional context
Add any other context or screenshots about the feature request here.

@aabs7 aabs7 added the enhancement New feature or request label May 11, 2020
@aabs7
Copy link
Collaborator

aabs7 commented May 11, 2020

The code should be written in a standard way and in the right place for adding features in ArduPlane.

@shovan777
Copy link
Collaborator Author

The mode add feature diverges in Plane compared to copter in following ways:

  1. land, loiter, like mini modes are completely separate from auto mode in plane
  2. there are only start and verify commands and no run command
  3. the start and verify command live in command_logic.cpp instead of mode_auto.cpp

@aabs7
Copy link
Collaborator

aabs7 commented May 11, 2020

Although the method of adding flight mode varies in ArduPlane compared to ArduCopter, a standard way must be researched and followed in the entire process of adding features. I will work on that and follow up.

aabs7 added a commit that referenced this issue May 12, 2020
@aabs7
Copy link
Collaborator

aabs7 commented May 12, 2020

Commit of a1324af above addresses following changes:

  • Commented //added & end with //add finish above and below lines of code that are added
  • In parameters.cpp, 24:PAYLOADRELEASE added under FLTMODE(1~6). This is the best practice.
  • In plane.h mode_payloadrelease object is returned instead of mode_auto object

@aabs7
Copy link
Collaborator

aabs7 commented May 13, 2020

Commit of cb8275e above addresses the following changes:

  • The bool is_payload_released is removed from plane.h auto_state structure, because this boolean is not auto mode mission state, and is added to ModePayloadRelease flight mode state inside mode.h.
  • Special condition checking of MAV_CMD_NAV_PAYLOAD_RELEASE inside mode_auto.cpp is removed because this command can be called and implemented in start_command and verify_command functions inside command_logic.cpp.

Further addition of features:

Addition of features should be done in the update function inside mode_payloadrelease.cpp and verify_payload_release & do_payload_release functions inside command_logic.cpp.

@aabs7 aabs7 removed their assignment May 13, 2020
@shovan777
Copy link
Collaborator Author

#2 while implementing the wind based payload drop calculations the faulty wind estimate was observed.

shovan777 added a commit that referenced this issue Jun 4, 2020
…pter.

Add initialise_initial_condition.
Add calculate displacement.
Add llh_to_local.
Add local_to_llh.
Use gps heading as the bearing for the calculation.
shovan777 added a commit that referenced this issue Jun 4, 2020
Set state variable at different stages of payload release.
Maintain state change outside the mode_payload release.
aabs7 added a commit that referenced this issue Jun 7, 2020
@aabs7 aabs7 assigned aabs7 and unassigned aabs7 Jun 7, 2020
aabs7 added a commit that referenced this issue Jun 12, 2020
@aabs7
Copy link
Collaborator

aabs7 commented Jun 17, 2020

Up to now

  • The plane calculates the release point taking into account wind velocity for the payload to reach target drop point. The calculation of the release point can be found here.
  • Intermediate point is calculated from release point parallel to direction plane is flying.
  • The plane loiters around center perpendicular from the line of intermediate point and the release point with distance R from the intermediate point and radius R.
  • The plane leaves from loitering making tangent towards release point.
    this
    In the figure above, waypoint 9 is the target drop point.

To do

  • Add servo functionality when reached release point.
  • code refactoring.

aabs7 added a commit that referenced this issue Jun 17, 2020
aabs7 added a commit that referenced this issue Jun 21, 2020
@aabs7
Copy link
Collaborator

aabs7 commented Jun 21, 2020

The current version supports a single release point calculation. For continuous release point updates, the code has to be extended for the plane to reach changing waypoint.

@aabs7 aabs7 closed this as completed Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants