Skip to content

Commit

Permalink
Merge pull request #82 from personalrobotics/feature/skeletupdate
Browse files Browse the repository at this point in the history
Added HRC task support with skeleton tracking integration
  • Loading branch information
mkoval committed Jul 29, 2016
2 parents 187b732 + fa1f82e commit de4dce2
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.pyc
cmovetraj.txt
*.sublime-workspace
2 changes: 1 addition & 1 deletion src/herbpy/action/grasping.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def HerbGrasp(robot, obj, push_distance=None, manip=None,
with prpy.rave.Disabled(obj):
manip.PlanToEndEffectorOffset(direction = push_direction,
distance = push_distance,
execute=True,
execute = True,
**kw_args)
except PlanningError, e:
if push_required:
Expand Down
3 changes: 1 addition & 2 deletions src/herbpy/herbrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ def __init__(self, left_arm_sim, right_arm_sim, right_ft_sim,
# Trajectory optimizer.
try:
from or_trajopt import TrajoptPlanner

self.trajopt_planner = TrajoptPlanner()
self.trajopt_planner = TrajoptPlanner()
except ImportError:
self.trajopt_planner = None
logger.warning('Failed creating TrajoptPlanner. Is the or_trajopt'
Expand Down
1 change: 1 addition & 0 deletions src/herbpy/tsr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from pop_tarts import *
from generic import *
from pill_bottle import *
from box import *
45 changes: 45 additions & 0 deletions src/herbpy/tsr/box.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import numpy
import prpy.tsr

@prpy.tsr.tsrlibrary.TSRFactory('herb', 'box', 'stamp')
def box_stamp(robot, box, manip=None):

'''
This creates a TSR for stamping a box.
It is assumed that when called, the robot is grasping a stamp
@param robot The robot to perform the stamp
@param box The box to stamp
@param manip The manipulator to stamp
'''

with robot.CreateRobotStateSaver(robot.GetActiveManipulatorIndex() | robot.ActiveDOF()):
if manip is None:
manip_idx = robot.GetActiveManipulatorIndex()
manip = robot.GetActiveManipulator()
else:
manip.SetActive()
manip_idx = manip.GetRobot().GetActiveManipulatorIndex()

T0_w = box.GetTransform()

ee_to_palm = 0.18
palm_to_box_center = .045
adjustment = -0.09
total_offset = ee_to_palm + palm_to_box_center + adjustment
Tw_e = numpy.array([[ 0., 0., 1., -total_offset],
[1., 0., 0., 0.],
[0., 1., 0., 0.38], # box height 0.2 0.35
[0., 0., 0., 1.]])

Bw = numpy.zeros((6,2))
Bw[5,:] = [-numpy.pi, numpy.pi] # Allow any orientation

grasp_tsr = prpy.tsr.TSR(T0_w = T0_w, Tw_e = Tw_e, Bw = Bw, manip = manip_idx)
grasp_chain = prpy.tsr.TSRChain(sample_start=False, sample_goal = True,
constrain=False, TSR = grasp_tsr)

return [grasp_chain]



0 comments on commit de4dce2

Please sign in to comment.