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 Path Constraints #42

Merged
merged 11 commits into from
Jan 5, 2024
Merged

Conversation

amalnanavati
Copy link
Contributor

@amalnanavati amalnanavati commented Jan 2, 2024

Description

MoveIt2 allows planning with path constraints (e.g., see here) but pymoveit2 does not currently support it. This PR does the following:

  1. Separates the logic to create constraints from the logic to set goal constraints, so that the constraint creation functions can be reused.
  2. Extends the API to allow for setting orientation, position, and joint constraints as path constraints (in addition to the existing option of setting them as goal constraints).
  3. Adds an example showcasing the orientation path constraint capability.

Note that this PR is joint with panda_ign_moveit2#29, which enables OMPL Constrained Planning for efficient planning with orientation path constraints.

Testing

Config:

  • Pull the panda config with orientation path constraints enabled: panda_ign_moveit2#29
  • Pull this branch
  • Re-build your workspace
  • Launch the simulated panda arm: ros2 launch panda_moveit_config ex_fake_control.launch.py

Testing:

  • Check the motion without orientation constraints: ros2 run pymoveit2 ex_orientation_path_constraint.py --ros-args -p use_orientation_constraint:=False
  • Check the motion with orientation constraints, and verify that the end-effector stays flatter than it did without the constraints: ros2 run pymoveit2 ex_orientation_path_constraint.py --ros-args -p use_orientation_constraint:=True
  • Verify that planning to a goal pose still works: ros2 run pymoveit2 ex_pose_goal.py. (Note that planning to a joint goal was already tested in the above examples)

Future Work

  1. Limiting position constraints to a sphere made sense for goal constraints, but no longer makes sense for path constraints (e.g., look at the tutorial, that uses a box as opposed to a sphere). Thus, future work should generalize position constraints to allow for any Solid Primitive.
  2. We currently don't have examples showcasing the use of position and joint path constraints. They should work in theory, given that they reuse the same code used for position/joint goal constraints and orientation path constraints, but that has not been tested. Future work includes adding examples for position and joint path constraints.

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 work! I think it looks good! 😄

@AndrejOrsula AndrejOrsula merged commit cff6677 into AndrejOrsula:devel Jan 5, 2024
1 check passed
@AndrejOrsula AndrejOrsula mentioned this pull request Jan 5, 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/path 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