GithubHelp home page GithubHelp logo

wenchanggaot / armpy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aabl-lab/armpy

0.0 0.0 0.0 129 KB

Python adapter for robot arm control via MoveIt

License: MIT License

Python 96.12% CMake 3.88%

armpy's Introduction

HLPR Manipulation Utilities

This package contains several helpful utilities for moving robots and manipulating objects.

Currently, the best-supported scripts in this package are ArmMoveIt 2, Gripper, and PickPlace.

ArmMoveIt 2

There is more complete documentation on the GitHub Pages Site.

ArmMoveIt 2 is a wrapper around MoveIt specifically for our Kinova arms. Here is a minimal working example of how to use ArmMoveIt 2 with the Kinova 7-DOF arm:

import math
import rospy
from arm_moveit2 import ArmMoveIt
import hlpr_manipulation_utils.transformations as Transform
from geometry_msgs.msg import Pose

arm = ArmMoveIt(planning_frame="j2s7s300_link_base")
target = Pose()
target.position.x = 0.2
target.position.y = 0.2
target.position.z = 0.2
target.orientation.x, target.orientation.y, target.orientation.z, target.orientation.w = \
    Transform.quaternion_from_euler(0.0, math.pi/2, math.pi/2)

arm.move_to_ee_pose(target)

ArmMoveIt 2 has several capabilities, such as producing plans without moving, doing joint motions instead of eef motions, etc. It is well documented, see arm_moveit2.py for more details.

Gripper

Control a Robotiq 85 2-finger gripper. A minimal example is:

import time
from hlpr_manipulation_utils.manipulator import Gripper

gripper = Gripper()

gripper.open()
time.sleep(2.0)

gripper.close()
time.sleep(2.0)

Note that this class does not block. You must add a sleep after each call if you want to wait for the motion to finish. 2 seconds is enough for any motion.

PickPlace

Overview

An easy way to pick and place objects with a robot. This class requires several other things to be running to work correctly. Most notably, it requires frames to be published at the position of any objects that you want to manipulate. These frames are automatically provided if you are using the ORP object detector (contact Adam Allevato for more details).

PickPlace uses ArmMoveIt2 and Gripper to control the robot. The data flow is therefore as follows:

Obj Detector => Vision Frames
                      |
                      v
     Your code => PickPlace => ArmMoveIt 2 => MoveIt => Kinova Driver => Kinova
                      |
                      v
                   Gripper => Robotiq Driver => Robotiq

Video

This video shows this class in action.

Test Via Command Line

You can use the class in an interactive command line (as in the video) by running rosrun hlpr_manipulation_utils pick_place.py. This could be useful for quick-and-dirty demos.

Minimal Example

from hlpr_manipulation_utils.pick_place import PickPlace

pick_place = PickPlace()
pick_place.pick_center("obj_frame")
pick_place.place()

More Complete Example with Notes

from hlpr_manipulation_utils import PickPlace

# PickPlace has several arguments that modify its behavior. See pick_place.py for more details.
pick_place = PickPlace()

# Open the gripper, approach the object, move to it, close the gripper, and move back up. This assumes that obj_frame is the frame locating the object you want to pick.
pick_place.pick_center("obj_frame")

# this will put the object down at the same place from which it was picked.
pick_place.place()

# this command will fail, because you can't pick until you have placed. This behavior can be modified via the require_place argument.
pick_place.place()

# This does the same thing as pick
pick_place.pick_rim("obj_frame")

# You can access the ArmMoveIt instance via pick_place.arm. After moving, place() will
# respect the new XY position of the arm.
pick_place.place()

armpy's People

Contributors

isheidlower avatar isaacsheidlower avatar rmaronson avatar aabl-daemon avatar katallen405 avatar hangyu8123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.