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

Added Async Forward/Inverse Kinematics #43

Merged
merged 9 commits into from
Feb 20, 2024

Conversation

amalnanavati
Copy link
Contributor

Description

Similar to #40 , this PR adds the ability to asynchronously call forward or inverse kinematics, along with corresponding examples.

Testing

  • Launch the simulated panda arm: ros2 launch panda_moveit_config ex_fake_control.launch.py
  • Test FK:
    • Verify synchronous execution still works: ros2 run pymoveit2 ex_fk.py --ros-args -p joint_positions:="[1.57, -1.57, 0.0, -1.57, 0.0, 1.57, 0.7854]"
    • Verify asynchronous execution works: ros2 run pymoveit2 ex_fk.py --ros-args -p joint_positions:="[1.57, -1.57, 0.0, -1.57, 0.0, 1.57, 0.7854]" -p synchronous:=False
  • Test IK:
    • Verify synchronous execution still works: ros2 run pymoveit2 ex_ik.py --ros-args -p position:="[0.25, 0.0, 1.0]" -p quat_xyzw:="[0.0, 0.0, 0.0, 1.0]"
    • Verify asynchronous execution works: ros2 run pymoveit2 ex_ik.py --ros-args -p position:="[0.25, 0.0, 1.0]" -p quat_xyzw:="[0.0, 0.0, 0.0, 1.0]" -p synchronous:=False

Copy link
Owner

@AndrejOrsula AndrejOrsula left a comment

Choose a reason for hiding this comment

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

Thank you very much for this contribution!
I think it looks good but I have not tested it yet. 🙂

I will test it once addressing #41 if that's okay.

examples/ex_fk.py Outdated Show resolved Hide resolved
examples/ex_ik.py Outdated Show resolved Hide resolved
pymoveit2/moveit2.py Outdated Show resolved Hide resolved
pymoveit2/moveit2.py Show resolved Hide resolved
@amalnanavati
Copy link
Contributor Author

Apologies for the very long delay. Just addressed the comments.

@AndrejOrsula
Copy link
Owner

Thank you very much!

@AndrejOrsula AndrejOrsula merged commit 09ce8d8 into AndrejOrsula:devel Feb 20, 2024
1 check passed
@AndrejOrsula AndrejOrsula mentioned this pull request Feb 20, 2024
AndrejOrsula added a commit that referenced this pull request Mar 6, 2024
* Add asynchronous planning and execution (#40)

* Add joint goal example for Kinova JACO2

* [WIP] Added execution cancellation and polling

* Switch to ExecuteTrajectory action

* [WIP] Goal cancellation is broken

* Added cancellation via topic publication

* Full cancellation example

* Need option for both move action and direct planning

* Created get_trajectory, so users of plan_async can easily get the result

* Reset last error code before action execution

Consider two cases, one where action server (either for execute or MoveGroup) is not available, and another where the action succeeds very fast. Both cases are currently indistinguishable from the client perspective, because they will request a goal, and then when they query the state it will be IDLE. This commit resolves that, because if the error code is set that means the action completed very fast, whereas if it is None that means the action did not complete.

* Reverted to original example

* Small fixes from rebase

* Update examples

* Update docstrings

* Update docstrings

* Addressed PR comments

* Ran pre-commit hook

* Addressed PR comments

* Fixed gripper interface

---------

Co-authored-by: Ethan K. Gordon <[email protected]>

* Add Path Constraints (#42)

* [WIP] Add ability to do path constraints

* [WIP] Change API to be more intelligible

* Allowed different orientation tolerances per axes

* Make change not breaking by adding float option

* Added parameterization option

* Updated set_pose_goal

* Rearranged parameterization to not be a breaking change

* Formatting changes form pre-commit

* Add orientation path constraint example

* Reused constraint creation code from goal constraints

* Pre-commit formatting fix

---------

Co-authored-by: Ethan Gordon <[email protected]>

* Added Async Forward/Inverse Kinematics (#43)

* [WIP] Add async service call for FK/IK analogous to planning

* Compute FK returns a list of post_stampeds

* Pre-commit formatting

* Added FK example

* Comment changes to orientation path constraint examples

* Added IK example

* Update examples/ex_fk.py

Co-authored-by: Andrej Orsula <[email protected]>

* Update examples/ex_ik.py

Co-authored-by: Andrej Orsula <[email protected]>

* Update moveit2.py

---------

Co-authored-by: Ethan Gordon <[email protected]>
Co-authored-by: Andrej Orsula <[email protected]>

* Allow users to set `planner_id` and `pipeline_id` (#48)

* Added set_planner_id

* Make planner_id and pipeline_id properties

* Add planner_id param to example files

* Formatting

---------

Co-authored-by: Amal Nanavati <[email protected]>
Co-authored-by: Ethan K. Gordon <[email protected]>
@amalnanavati amalnanavati deleted the egordon/fkik_async branch April 23, 2024 17:13
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.

3 participants