-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
AP_Scripting: applet for Plane follow on a switch #27137
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scripting checks are also reporting:
libraries/AP_Scripting/applets/plane_follow.lua:20:7: unused variable ALT_FRAME_ABSOLUTE
libraries/AP_Scripting/applets/plane_follow.lua:75:7: unused variable have_target
libraries/AP_Scripting/applets/plane_follow.lua:118:7: empty if branch
libraries/AP_Scripting/applets/plane_follow.lua:132:10: unused variable target_sysid
libraries/AP_Scripting/applets/plane_follow.lua:145:10: unused variable vehicle_location
libraries/AP_Scripting/applets/plane_follow.lua:152:21: value assigned to variable target_offsets is overwritten on line 153 before use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a GCS text announcing that its been loaded, like we do in other applets
This is a draft for comm
Done |
I have to call two methods on AP_Follow to get all the values I need and both of them return target_offsets. Do you think I should refactor the code in AP_Follow so I can call a single method? |
How can I run these checks myself? |
This should work:
You can also run the new checks with:
|
e60baf8
to
68ebae7
Compare
ac0e125
to
a157494
Compare
3391393
to
dd4d090
Compare
dd4d090
to
19d1b7c
Compare
19d1b7c
to
9302e5d
Compare
5cc7e77
to
eefd885
Compare
eefd885
to
81ff044
Compare
56d6f53
to
108ec85
Compare
108ec85
to
050d2ce
Compare
050d2ce
to
eac617b
Compare
DRAFT for comment.
This builds on the existing plane_guided_follow.lua example. It adds speedup/slowdown so the following vehicle can "catch up" with the target and prevents guided mode from attempting to loiter around the target vehicle when it gets close. Also adds FOLL_ACT_FN so that an RC switch can be used to trigger/exit the follow.
Note the change to GCS_Mavlink.cpp, without this one line in handle_command_int_do_reposition to set
plane.guided_state.target_heading_type = GUIDED_HEADING_NONE
, nothing works. With this line, like magic - follow!Updated, but still draft. Re-written to use the new MAVLink/Lua interface in #27365
Includes a Lua module for a "PI" controller. This is basically just extracted as is from the plane_aerobatics.lua and generalized so it can be used without copying. Ideally "D" would be added.