コード例 #1
0
 def SetJointVel(self, p):
     """
     Call the SetJointVel Motion Command
     this methods does not check the response
     """
     if not (p >= 0 and p <= 100):
         raise ValueError(
             "RobotController::SetJointVel invalid value p={}".format(p))
     self.send_string_command(build_command("SetJointVel", [p]))
     self.update_log_for_motion_commands()
コード例 #2
0
 def SetCartLinVel(self, v):
     """
     Call the SetCartLinVel Motion Command [mm/s]
     this methods does not check the response
     """
     if not (v >= 0.001 and v <= 500):
         raise ValueError(
             "RobotController::SetCartLinVel invalid value v={}".format(v))
     self.send_string_command(build_command("SetCartLinVel", [v]))
     self.update_log_for_motion_commands()
コード例 #3
0
 def SetAutoConf(self, e):
     """
     Call the SetAutoConf Motion Command
     this methods does not check the response
     """
     if e is not 0 and e is not 1:
         raise ValueError(
             "RobotController::SetAutoConf invalid value e={}".format(e))
     self.send_string_command(build_command("SetAutoConf", [e]))
     self.update_log_for_motion_commands()
コード例 #4
0
 def SetCartAngVel(self, omega):
     """
     Call the SetCartAngVel Motion Command
     this methods does not check the response
     """
     if not (omega >= 0.001 and omega <= 180):
         raise ValueError(
             "RobotController::SetCartAngVel invalid value omega={}".format(
                 omega))
     self.send_string_command(build_command("SetCartAngVel", [omega]))
     self.update_log_for_motion_commands()
コード例 #5
0
 def MoveJoints(self, joints):
     """
     Call the MoveJoints Motion Command
     joints: joints list [A1,A2,...,A6] in [deg]
     this methods does not check the response
     """
     if not len(joints) == 6:
         raise ValueError(
             "RobotController::MoveJoints Meca500 has 6 joints {} provided".
             format(len(joints)))
     self.send_string_command(build_command("MoveJoints", joints))
     self.update_log_for_motion_commands()
コード例 #6
0
 def SetConf(self, c1, c3, c5):
     """
     Call the SetConf Motion Command
     this methods does not check the response
     """
     if c1 is not -1 and c1 is not 1:
         raise ValueError(
             "RobotController::SetConf invalid value c1={}".format(c1))
     if c3 is not -1 and c3 is not 1:
         raise ValueError(
             "RobotController::SetConf invalid value c3={}".format(c3))
     if c5 is not -1 and c5 is not 1:
         raise ValueError(
             "RobotController::SetConf invalid value c5={}".format(c5))
     self.send_string_command(build_command("SetConf", [c1, c3, c5]))
     self.update_log_for_motion_commands()
コード例 #7
0
    def SetEOM(self, e):
        """
        Call the SetEOM request command
        """
        responses_code = []
        if e == 0:
            responses_code = ["2053"]
        elif e == 1:
            responses_code = ["2052"]
        else:
            raise ValueError(
                "RobotController::SetEOM invalid argument e={}".format(e))

        cmd = build_command("SetEOM", [e])
        self.send_command_handled(cmd,
                                  method_str="cmd",
                                  errors_code=[],
                                  responses_code=responses_code)
コード例 #8
0
    def SetWRF(self, origin, orientation):
        """
        Call the SetWRF Motion Command
        origin: desired frame origin [x,y,z] in [mm]
        orientation: desired frame orientation - euler angle XYZ [alpha,beta,gamma] in [deg]
        this methods does not check the response
        """
        if not len(origin) == 3:
            raise ValueError(
                "RobotController::SetWRF origin must have len=3, {} provided".
                format(len(origin)))
        if not len(orientation) == 3:
            raise ValueError(
                "RobotController::SetWRF orientation must have len=3, {} provided"
                .format(len(orientation)))

        args = list(origin)
        args.extend(orientation)
        self.send_string_command(build_command("SetWRF", args))
        self.update_log_for_motion_commands()
コード例 #9
0
    def MovePose(self, position, orientation):
        """
        Call the MovePose Motion Command
        position: desired position [x,y,z] in [mm]
        orientation: desired euler angle XYZ [alpha,beta,gamma] in [deg]
        this methods does not check the response
        """
        if not len(position) == 3:
            raise ValueError(
                "RobotController::MovePose position must have len=3, {} provided"
                .format(len(position)))
        if not len(orientation) == 3:
            raise ValueError(
                "RobotController::MovePose orientation must have len=3, {} provided"
                .format(len(orientation)))

        args = list(position)
        args.extend(orientation)
        self.send_string_command(build_command("MovePose", args))
        self.update_log_for_motion_commands()