예제 #1
0
def testPlanConstraints():

    # this is required for now, makes it avoid communication with matlab
    # inside the call to ikPlanner.addPose
    ikPlanner.pushToMatlab = False

    constraints = buildConstraints()
    poses = ce.getPlanPoses(constraints, ikPlanner)

    poseJsonStr = json.dumps(poses, indent=4)
    constraintsJsonStr = ce.encodeConstraints(constraints, indent=4)

    print poseJsonStr
    print constraintsJsonStr

    constraints = ce.decodeConstraints(constraintsJsonStr)
    pprint.pprint(constraints)
예제 #2
0
 def setupMessage(self, constraints, endPoseName="", nominalPoseName="", seedPoseName="", additionalTimeSamples=None):
   poses = ikconstraintencoder.getPlanPoses(constraints, self.ikPlanner)
   poses.update(self.poses)
   msg = ipab.exotica_planner_request_t()
   msg.utime = getUtime()
   msg.poses = json.dumps(poses)
   msg.constraints = ikconstraintencoder.encodeConstraints(constraints)
   msg.seed_pose = seedPoseName
   msg.nominal_pose = nominalPoseName
   msg.end_pose = endPoseName
   msg.joint_names = json.dumps(list(self.ikPlanner.jointController.jointNames))
   msg.affordances = self.processAffordances()
   opt=ikplanner.getIkOptions()._properties
   if additionalTimeSamples:
     opt.update({'timeSamples':additionalTimeSamples})
   msg.options = json.dumps(opt)
   return msg
예제 #3
0
def testPlanConstraints():

    # this is required for now, makes it avoid communication with matlab
    # inside the call to ikPlanner.addPose
    ikPlanner.pushToMatlab = False

    constraints = buildConstraints()
    poses = ce.getPlanPoses(constraints, ikPlanner)

    poseJsonStr = json.dumps(poses, indent=4)
    constraintsJsonStr = ce.encodeConstraints(constraints, indent=4)

    print poseJsonStr
    print constraintsJsonStr

    constraints = ce.decodeConstraints(constraintsJsonStr)
    pprint.pprint(constraints)
예제 #4
0
 def setupMessage(self,
                  constraints,
                  endPoseName="",
                  nominalPoseName="",
                  seedPoseName="",
                  additionalTimeSamples=None):
     poses = ikconstraintencoder.getPlanPoses(constraints, self.ikPlanner)
     poses.update(self.poses)
     msg = ipab.exotica_planner_request_t()
     msg.utime = getUtime()
     msg.poses = json.dumps(poses)
     msg.constraints = ikconstraintencoder.encodeConstraints(constraints)
     msg.seed_pose = seedPoseName
     msg.nominal_pose = nominalPoseName
     msg.end_pose = endPoseName
     msg.joint_names = json.dumps(
         list(self.ikPlanner.jointController.jointNames))
     msg.affordances = self.processAffordances()
     opt = ikplanner.getIkOptions()._properties
     if additionalTimeSamples:
         opt.update({'timeSamples': additionalTimeSamples})
     msg.options = json.dumps(opt)
     return msg