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 planar arm safety factor #267

Merged
merged 34 commits into from
Oct 22, 2023
Merged

Add planar arm safety factor #267

merged 34 commits into from
Oct 22, 2023

Conversation

DrDab
Copy link
Contributor

@DrDab DrDab commented Sep 29, 2023

Add overall length percentage bound to planar arm joints to prevent singularity lockup.

Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

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

Mostly looks good, but one thing I think we missed in our discussion. The set point should always be within the allowed region, so we should perform the same check (check if outside the allowed radius and if so then correct it) in set_setpoint() as well. Since we'll be doing the same check twice we should factor out that logic into a method called adjust_setpoint() or something. Lmk if you have any questions!

tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
src/control/PlanarArmController.h Outdated Show resolved Hide resolved
@DrDab DrDab requested a review from abhaybd October 3, 2023 01:02
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

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

Mostly good, just a few more edits needed

src/control/PlanarArmController.h Outdated Show resolved Hide resolved
src/control/PlanarArmController.h Outdated Show resolved Hide resolved
tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
@DrDab DrDab requested a review from abhaybd October 3, 2023 01:42
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

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

Looks good, just one last thing

src/control/PlanarArmController.h Outdated Show resolved Hide resolved
@DrDab DrDab requested a review from abhaybd October 9, 2023 22:12
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

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

Ok this should be the last thing! After fixing this let's get this tested and then merged

tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

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

Good comments and documentation! Realized we missed a minor logic bug in the constructor, and then some minor notes in the testcase

tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
tests/control/PlanarArmControllerTest.cpp Outdated Show resolved Hide resolved
src/control/PlanarArmController.h Outdated Show resolved Hide resolved
Copy link
Member

@abhaybd abhaybd left a comment

Choose a reason for hiding this comment

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

Looks good! Nice job on this

@abhaybd abhaybd merged commit f56ee61 into master Oct 22, 2023
3 checks passed
@abhaybd abhaybd deleted the addPlanarArmSafetyFactor branch October 22, 2023 05:52
AyushKulk pushed a commit that referenced this pull request Oct 31, 2023
* Added safetyFactor check

* Move safety factor constant into Constants

* Add safetyFactor range limit assertion

* Update planar arm tests to use safety factor

* Set setpoint in safety factor test

* Test overreaching arm is normalized

* Bound resolved joint pos within safety factor

* Added within factor test

* Try shorter extension

* Improved formatting

* Remove now-obsolete todo

* More formatting fixes

* Use std abs over fabs in test

* Move vector normalization code to own func

* Add more logic to normalizeVectorWithinRadius

* Fix return type

* Add normalize functionality to set_setpoint

* Actually compute unnormalized setpoint instead of magic num

* Make normalizeVector private

* Rename input vector to better reflect end effector

* Make normalize func name more descriptive

* Add actual vector comparison

* Refactored redundant code

* Remove unnecessary checks

* Minor cleanup

* Fixed tests

* More cleanup

* Improve formatting

* More formatting improvements

* Rm unnecessary INFO wrapping

* Remove unused constant

* Improve REQUIRE logging

* Add safety factor logic in PlanarArmController constructor
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.

2 participants