Ejemplo n.º 1
0
    def apply_limits(self, robot):
        (lower, upper) = self.get_rad_limits()

        for name in self.limit_table.joints.keys():
            n = mapping.oh_from_ha(name)
            j = robot.GetJoint(n)
            if j is not None:
                j.SetLimits([lower[name]], [upper[name]])
Ejemplo n.º 2
0
    def apply_limits(self,robot):
        (lower,upper)=self.get_rad_limits()

        for name in self.limit_table.joints.keys():
            n=mapping.oh_from_ha(name)
            j=robot.GetJoint(n)
            if j is not None:
                j.SetLimits([lower[name]],[upper[name]])
Ejemplo n.º 3
0
    def apply_limits_to_urdf(self, model):
        (lower, upper) = self.get_rad_limits()
        for name in self.limit_table.joints.keys():
            n = mapping.oh_from_ha(name)
            if n is not None:
                if not model.joints.has_key(name):
                    n = mapping.oh_from_ha(name)
                else:
                    n = name
                if model.joints.has_key(n):
                    j = model.joints[n]
                    if j.limits is not None:
                        model.joints[n].limits.lower = lower[name]
                        model.joints[n].limits.upper = upper[name]
                    else:
                        j.limits = JointLimit(25, 2 * pi, lower[name], upper[name])

            else:
                print "Match not found for name {}".format(name)
                print model.joints[name]
Ejemplo n.º 4
0
    def apply_limits_to_urdf(self,model):
        (lower,upper)=self.get_rad_limits()
        for name in self.limit_table.joints.keys():
            n=mapping.oh_from_ha(name)
            if n is not None:
                if not model.joints.has_key(name):
                    n=mapping.oh_from_ha(name)
                else:
                    n=name
                if model.joints.has_key(n):
                    j=model.joints[n]
                    if j.limits is not None:
                        model.joints[n].limits.lower=lower[name]
                        model.joints[n].limits.upper=upper[name]
                    else:
                        j.limits=JointLimit(25,2*pi,lower[name],upper[name])

            else:
                print "Match not found for name {}".format(name)
                print model.joints[name]