-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to add custom end-effector attachments for Panda, UR5, an…
…d Fetch (#18) * Added Panda Attachments initial implementation * Adding attachment to cmake * hax for running attachment fk * Regenerate for correct Panda * Regenerate attached to panda_hand link * Experiment: see if using raw pointers for attachments decreases overhead * Experiment: std::optional instead of std::unique_ptr for attachments * Experiment: remove useless conditional around attachment posing * attachment test code * attachment python interface * Experiment: eefk function for attachment debugging * working! * UR5 attachment FK (tool0 frame) * Fetch attachment FK (gripper_link) * fusing attachment code * remove hack * API QoL changes for attachments * made default params a bit bigger * started readme docs * small docs * Regenerate UR5 attachment with robotiq_85_base_link EE frame * Regenerate all attached FK with new function call style * Fixed FK functions * fix: formatting * Update scripts/README.md Co-authored-by: Wil Thomason <[email protected]> * Update scripts/README.md Co-authored-by: Wil Thomason <[email protected]> * Update src/vamp/pybullet_interface.py Co-authored-by: Wil Thomason <[email protected]> * Update src/vamp/__init__.py Co-authored-by: Wil Thomason <[email protected]> * Update scripts/attachments.py Co-authored-by: Wil Thomason <[email protected]> * Update scripts/attachments.py Co-authored-by: Wil Thomason <[email protected]> * Update src/impl/vamp/bindings/common.hh Co-authored-by: Wil Thomason <[email protected]> * Update src/impl/vamp/robots/baxter.hh Co-authored-by: Wil Thomason <[email protected]> * fix: nits from PR * Adding documentation, detach method * EE frames in docs * updates to docker * added default constructor in to_array * chore: run clang-format on environment.cc * fix: Make attachments compile with old GCC I had no idea noexcept could make an explicitly defaulted function become implicitly deleted... * fix: format * Update scripts/README.md Co-authored-by: Wil Thomason <[email protected]> * Update scripts/README.md Co-authored-by: Wil Thomason <[email protected]> * Array should be default initialized * list of robots --------- Co-authored-by: Wil Thomason <[email protected]> Co-authored-by: Wil Thomason <[email protected]> Co-authored-by: Zachary Kingston <[email protected]>
- Loading branch information
1 parent
96eb4d6
commit df6120a
Showing
27 changed files
with
24,153 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
from pathlib import Path | ||
|
||
import vamp | ||
from vamp import pybullet_interface as vpb | ||
|
||
from fire import Fire | ||
|
||
# Starting configuration | ||
a = [0., -0.785, 0., -2.356, 0., 1.571, 0.785] | ||
|
||
# Goal configuration | ||
b = [2.35, 1., 0., -0.8, 0, 2.5, 0.785] | ||
|
||
# Problem specification: a list of sphere centers | ||
problem = [ | ||
[0.55, 0, 0.25], | ||
[0.35, 0.35, 0.25], | ||
[0, 0.55, 0.25], | ||
[-0.55, 0, 0.25], | ||
[-0.35, -0.35, 0.25], | ||
[0, -0.55, 0.25], | ||
[0.35, -0.35, 0.25], | ||
[0.35, 0.35, 0.8], | ||
[0, 0.55, 0.8], | ||
[-0.35, 0.35, 0.8], | ||
[-0.55, 0, 0.8], | ||
[-0.35, -0.35, 0.8], | ||
[0, -0.55, 0.8], | ||
[0.35, -0.35, 0.8], | ||
] | ||
|
||
|
||
def main( | ||
obstacle_radius: float = 0.2, | ||
attachment_radius: float = 0.07, | ||
attachment_offset: float = 0.14, | ||
planner: str = "rrtc", | ||
**kwargs, | ||
): | ||
|
||
(vamp_module, planner_func, plan_settings, | ||
simp_settings) = vamp.configure_robot_and_planner_with_kwargs("panda", planner, **kwargs) | ||
|
||
# Create an attachment offset on the Z-axis from the end-effector frame | ||
attachment = vamp.Attachment([0, 0, attachment_offset], [0, 0, 0, 1]) | ||
|
||
# Add a single sphere to the attachment - spheres are added in the attachment's local frame | ||
attachment.add_spheres([vamp.Sphere([0, 0, 0], attachment_radius)]) | ||
|
||
robot_dir = Path(__file__).parents[1] / 'resources' / 'panda' | ||
sim = vpb.PyBulletSimulator(str(robot_dir / "panda_spherized.urdf"), vamp.ROBOT_JOINTS['panda'], True) | ||
|
||
e = vamp.Environment() | ||
for sphere in problem: | ||
e.add_sphere(vamp.Sphere(sphere, obstacle_radius)) | ||
sim.add_sphere(obstacle_radius, sphere) | ||
|
||
# Add the attchment to the VAMP environment | ||
e.attach(attachment) | ||
|
||
# Add attachment sphere to visualization | ||
attachment_sphere = sim.add_sphere(attachment_radius, [0, 0, 0]) | ||
|
||
# Callback to update sphere's location in PyBullet visualization | ||
def callback(configuration): | ||
position, orientation_xyzw = vamp_module.eefk(configuration) | ||
attachment.set_ee_pose(position, orientation_xyzw) | ||
sphere = attachment.posed_spheres[0] | ||
|
||
sim.update_object_position(attachment_sphere, sphere.position) | ||
|
||
# Plan and display | ||
result = planner_func(a, b, e, plan_settings) | ||
simple = vamp_module.simplify(result.path, e, simp_settings) | ||
simple.path.interpolate(vamp.panda.resolution()) | ||
|
||
sim.animate(simple.path, callback) | ||
|
||
|
||
if __name__ == "__main__": | ||
Fire(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.