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

AP_Gripper: Servo Gipper enhancments #21130

Merged

Conversation

lthall
Copy link
Contributor

@lthall lthall commented Jul 6, 2022

This PR improves the functionality of the servo gripper.

  1. uses the servo trim to define the initial conditions during startup
  2. applies the "regrab" variable to provide an automatic closing after a set time
  3. shortens the delay
  4. uses the update gripper code to be consistent with EPM

libraries/AP_Gripper/AP_Gripper.h Outdated Show resolved Hide resolved
libraries/AP_Gripper/AP_Gripper_Servo.cpp Outdated Show resolved Hide resolved
@lthall
Copy link
Contributor Author

lthall commented Jul 18, 2022

AutoClose

@rmackay9
Copy link
Contributor

as discussed on the call we should add an AUTOCLOSE parameter instead of overloading. The name is just a suggestion.

@lthall lthall force-pushed the 20220706_ServoGripperEnhancements branch 3 times, most recently from f72944d to d5b5dfb Compare July 26, 2022 23:33
@lthall lthall requested review from IamPete1 and tridge July 28, 2022 01:38
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

Looks like the state tracking is not updated, did this work?

@lthall lthall force-pushed the 20220706_ServoGripperEnhancements branch from d5b5dfb to 4752679 Compare August 1, 2022 01:48
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Aug 1, 2022
@tridge tridge requested a review from IamPete1 August 1, 2022 23:58
@lthall lthall force-pushed the 20220706_ServoGripperEnhancements branch from 0d252ee to 960a8ef Compare August 2, 2022 13:01
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

Sorry to be annoying. I think the re-grab function should be moved up to the front end. Currently it only works for the servo backend.

The re-grab also gives the wrong messages in some cases because the state has already changed out sync with a switch. For example if I have released using a switch is see "Gripper load releasing" then after the regrab timeout I see "Gripper load grabbing". Then I want to open the gripper again, so I move the switch and see "Gripper load grabbing" again even though the gripper is already grabbed.

Happy to help on the re-work. I also think we can save some flash by removing code duplicated in both backends.

@lthall lthall force-pushed the 20220706_ServoGripperEnhancements branch from 93f2c2b to 25eab11 Compare August 5, 2022 09:34
@lthall
Copy link
Contributor Author

lthall commented Aug 5, 2022

I have added functionality to deal with the messages but I think the rework is beyond the scope of this PR. I would suggest we get this in and then rework it in a separate PR. I don't immediately see how to do regrab in the front end or if it is even appropriate for the other type of gripper.

@rmackay9
Copy link
Contributor

rmackay9 commented Aug 8, 2022

I'm happy if @peterbarker and @IamPete1 are happy..

@lthall lthall force-pushed the 20220706_ServoGripperEnhancements branch from 67ce6ba to ed38b94 Compare August 8, 2022 23:39
@peterbarker peterbarker merged commit 2d06261 into ArduPilot:master Aug 9, 2022
@andrefreitas97
Copy link

Hi @lthall! Shouldn't the gripper come back to neutral position if i move the RC channel to the middle position? This is not happening at the moment i am testing my gripper servo :(

@lthall
Copy link
Contributor Author

lthall commented Oct 8, 2022

Hi @andrefreitas97. The gripper is open or closed. The only time it looks at the neutral PWM setting is when it first starts up.

@andrefreitas97
Copy link

@lthall oh I understand! The reason i asked that question is that i am developing a gripper that deploys two objects with one servo. If the servo is in the middle position it grabs both objects. If the servo is moved to one side object 1 is released and object 2 is still grabbed. If the servo is moved to the other side it releases object 2 and grabs object 1. Thus I would need the servo to stay in the neutral position while my rc switch is in the middle and to move to the sides when I select high or low position in the rc switch.

Can you give me some directions to which files in the code should I work in order to make this happen? Thanks

@lthall
Copy link
Contributor Author

lthall commented Oct 8, 2022

This is ideal case for LUA scripts.

@andrefreitas97
Copy link

Oh ok I will investigate that. Thank you for your help!

@lthall lthall deleted the 20220706_ServoGripperEnhancements branch August 9, 2023 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Copter WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants