Fixed mixed up parameters
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
80642aca05
commit
0694706dc4
@ -50,42 +50,6 @@ class CombinedRobotInterface:
|
|||||||
|
|
||||||
class URRTDEMoveJCommand(AbstractCommand):
|
class URRTDEMoveJCommand(AbstractCommand):
|
||||||
|
|
||||||
def __init__(self,
|
|
||||||
logger: logging.Logger,
|
|
||||||
robot: CombinedRobotInterface,
|
|
||||||
pose: List[float],
|
|
||||||
speed: float,
|
|
||||||
acceleration: float):
|
|
||||||
# TODO: validations
|
|
||||||
|
|
||||||
self._logger = logger
|
|
||||||
self._robot = robot
|
|
||||||
self._pose = pose
|
|
||||||
self._speed = speed
|
|
||||||
self._acceleration = acceleration
|
|
||||||
|
|
||||||
def execute(self):
|
|
||||||
self._logger.debug(f"Moving robot arm: MoveJ to {self._pose} s: {self._speed} a: {self._acceleration}")
|
|
||||||
self._robot.robot_c.moveJ(self._pose, self._speed, self._acceleration)
|
|
||||||
self._logger.debug("Done moving")
|
|
||||||
|
|
||||||
def abort(self):
|
|
||||||
# TODO
|
|
||||||
pass
|
|
||||||
|
|
||||||
def describe(self) -> dict:
|
|
||||||
return {
|
|
||||||
"command": "moveJ",
|
|
||||||
"params": {
|
|
||||||
"pose": self._pose,
|
|
||||||
"speed": self._speed,
|
|
||||||
"acceleration": self._acceleration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class URRTDEMoveLCommand(AbstractCommand):
|
|
||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
logger: logging.Logger,
|
logger: logging.Logger,
|
||||||
robot: CombinedRobotInterface,
|
robot: CombinedRobotInterface,
|
||||||
@ -101,8 +65,44 @@ class URRTDEMoveLCommand(AbstractCommand):
|
|||||||
self._acceleration = acceleration
|
self._acceleration = acceleration
|
||||||
|
|
||||||
def execute(self):
|
def execute(self):
|
||||||
self._logger.debug(f"Moving robot arm: MoveL to {self._q} s: {self._speed} a: {self._acceleration}")
|
self._logger.debug(f"Moving robot arm: MoveJ to {self._q} s: {self._speed} a: {self._acceleration}")
|
||||||
self._robot.robot_c.moveL(self._q, self._speed, self._acceleration)
|
self._robot.robot_c.moveJ(self._q, self._speed, self._acceleration)
|
||||||
|
self._logger.debug("Done moving")
|
||||||
|
|
||||||
|
def abort(self):
|
||||||
|
# TODO
|
||||||
|
pass
|
||||||
|
|
||||||
|
def describe(self) -> dict:
|
||||||
|
return {
|
||||||
|
"command": "moveJ",
|
||||||
|
"params": {
|
||||||
|
"q": self._q,
|
||||||
|
"speed": self._speed,
|
||||||
|
"acceleration": self._acceleration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class URRTDEMoveLCommand(AbstractCommand):
|
||||||
|
|
||||||
|
def __init__(self,
|
||||||
|
logger: logging.Logger,
|
||||||
|
robot: CombinedRobotInterface,
|
||||||
|
pose: List[float],
|
||||||
|
speed: float,
|
||||||
|
acceleration: float):
|
||||||
|
# TODO: validations
|
||||||
|
|
||||||
|
self._logger = logger
|
||||||
|
self._robot = robot
|
||||||
|
self._pose = pose
|
||||||
|
self._speed = speed
|
||||||
|
self._acceleration = acceleration
|
||||||
|
|
||||||
|
def execute(self):
|
||||||
|
self._logger.debug(f"Moving robot arm: MoveL to {self._pose} s: {self._speed} a: {self._acceleration}")
|
||||||
|
self._robot.robot_c.moveL(self._pose, self._speed, self._acceleration)
|
||||||
self._logger.debug("Done moving")
|
self._logger.debug("Done moving")
|
||||||
|
|
||||||
def abort(self):
|
def abort(self):
|
||||||
@ -113,7 +113,7 @@ class URRTDEMoveLCommand(AbstractCommand):
|
|||||||
return {
|
return {
|
||||||
"command": "moveL",
|
"command": "moveL",
|
||||||
"params": {
|
"params": {
|
||||||
"q": self._q,
|
"pose": self._pose,
|
||||||
"speed": self._speed,
|
"speed": self._speed,
|
||||||
"acceleration": self._acceleration
|
"acceleration": self._acceleration
|
||||||
}
|
}
|
||||||
@ -126,8 +126,8 @@ class URRTDEMoveJCompiler(AbstractCommandCompiler):
|
|||||||
self._logger = logger
|
self._logger = logger
|
||||||
self._robot = robot
|
self._robot = robot
|
||||||
|
|
||||||
def compile(self, pose: List[float], speed: float = 1.05, acceleration: float = 1.4) -> AbstractCommand:
|
def compile(self, q: List[float], speed: float = 1.05, acceleration: float = 1.4) -> AbstractCommand:
|
||||||
return URRTDEMoveJCommand(self._logger, self._robot, pose, speed, acceleration)
|
return URRTDEMoveJCommand(self._logger, self._robot, q, speed, acceleration)
|
||||||
|
|
||||||
|
|
||||||
class URRTDEMoveLCompiler(AbstractCommandCompiler):
|
class URRTDEMoveLCompiler(AbstractCommandCompiler):
|
||||||
@ -136,8 +136,8 @@ class URRTDEMoveLCompiler(AbstractCommandCompiler):
|
|||||||
self._logger = logger
|
self._logger = logger
|
||||||
self._robot = robot
|
self._robot = robot
|
||||||
|
|
||||||
def compile(self, q: List[float], speed: float = 0.25, acceleration: float = 1.2) -> AbstractCommand:
|
def compile(self, pose: List[float], speed: float = 0.25, acceleration: float = 1.2) -> AbstractCommand:
|
||||||
return URRTDEMoveLCommand(self._logger, self._robot, q, speed, acceleration)
|
return URRTDEMoveLCommand(self._logger, self._robot, pose, speed, acceleration)
|
||||||
|
|
||||||
|
|
||||||
class URRTDEPlugin(AbstractPlugin):
|
class URRTDEPlugin(AbstractPlugin):
|
||||||
@ -147,7 +147,7 @@ class URRTDEPlugin(AbstractPlugin):
|
|||||||
self._logger = logging.getLogger("plugin").getChild("ur_rtde")
|
self._logger = logging.getLogger("plugin").getChild("ur_rtde")
|
||||||
|
|
||||||
self._robot = CombinedRobotInterface(Config.ROBOT_ADDRESS)
|
self._robot = CombinedRobotInterface(Config.ROBOT_ADDRESS)
|
||||||
logging.info(f"Connected to robot at {Config.ROBOT_ADDRESS}")
|
self._logger.info(f"Connected to robot at {Config.ROBOT_ADDRESS}")
|
||||||
|
|
||||||
def load_compilers(self) -> Dict[str, AbstractCommandCompiler]:
|
def load_compilers(self) -> Dict[str, AbstractCommandCompiler]:
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user