-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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
Copter/AC_PosControl/Scripting: slung payload oscillation suppression #27783
base: master
Are you sure you want to change the base?
Conversation
5462840
to
15823bd
Compare
367f908
to
64fb919
Compare
64fb919
to
2e1d24b
Compare
2e1d24b
to
aecab54
Compare
957b1fc
to
c48de9d
Compare
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.
I have done my first pass and my initial focus is on just the position controller work. I think I have two general concerns:
- We don't handle xy and z in the same way. I think this can be handled with a small change.
- We have limited the input to just position or velocity when both these can be provided with higher order inputs ie. We can specify a moving position offset by specifying position, velocity and acceleration to achieve a more responsive offset target movement.
@@ -406,13 +409,14 @@ void AC_PosControl::input_pos_xyz(const Vector3p& pos, float pos_offset_z, float | |||
-constrain_float(accel_max_z_cmss, 0.0f, 750.0f), accel_max_z_cmss, | |||
jerk_max_z_cmsss, _dt, false); | |||
|
|||
// update the vertical position, velocity and acceleration offsets | |||
// update the position, velocity and acceleration offsets | |||
update_xy_offsets(); | |||
update_pos_offset_z(pos_offset_z); |
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.
I am thinking we should not pass pos_offset_z into update_pos_offset_z and instead just use _pos_offset_target.z in that function like we do update_pos_offset_xy.
We would then set _pos_offset_target.z at the top of this function.
This would be more consistent between xy and z.
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.
ok thanks. My concern about changing those lines is it would mean I would need to re-test surface tracking and/or terrain following
62758af
to
cae3a7d
Compare
Do we want to log the offsets all the time? For the PD scale stuff we added a new message that was only logged if they were set (not one in that case, not zero in your case). |
This was discussed on the dev call and I'll make the following changes:
|
7b16217
to
d971584
Compare
Here is the flash cost of this feature
|
a98b3ba
to
c6ed2ae
Compare
Co-authored-by: Leonard Hall <[email protected]>
Co-authored-by: Leonard Hall <[email protected]>
Co-authored-by: Leonard Hall <[email protected]>
Co-authored-by: Leonard Hall <[email protected]>
0405b76
to
077fd82
Compare
This adds slung payload oscillation suppression using a Lua script together with a new AC_PosControl feature that allows external callers (e.g. scripts) to add horizontal position or velocity offsets to the vehicle while flying in Auto mode.
The payload oscillation suppression only operates while the vehicle is in Auto mode executing a SCRIPT_TIME or PAYLOAD_PLACE command. E.g. it does not trying to reduce oscillation while the vehicle if flying towards a waypoint nor in any other flight mode. A blog post including video is here.
Changes include:
This has been well tested in SITL and moderately well tested on a real vehicle:
Video of SITL test: https://www.youtube.com/watch?v=jL2YUByYv2Y
Known issues we should fix before merging: