Skip to content
Snippets Groups Projects
Commit 524679b9 authored by Armar6's avatar Armar6
Browse files

fixed tcp control subunit

parent 4ef57283
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ void TCPControllerSubUnit::setTCPVelocity(const std::string& nodeSetName, const
ARMARX_CHECK_EXPRESSION_W_HINT(coordinateTransformationRobot->hasRobotNode(tcpName), "The robot does not have the node: " + tcpName);
tcp = tcpName;
}
auto controllerName = this->getName() + "_" + tcp + "_" + nodeSetName;
auto activeNJointControllers = robotUnit->getNJointControllersNotNull(robotUnit->getNJointControllerNames());
NJointCartesianVelocityControllerWithRampPtr tcpController;
bool nodeSetAlreadyControlled = false;
......@@ -81,7 +81,7 @@ void TCPControllerSubUnit::setTCPVelocity(const std::string& nodeSetName, const
{
continue;
}
if (tcpController->getNodeSetName() == nodeSetName)
if (tcpController->getNodeSetName() == nodeSetName && tcpController->getInstanceName() == controllerName)
{
nodeSetAlreadyControlled = true;
break;
......@@ -136,10 +136,10 @@ void TCPControllerSubUnit::setTCPVelocity(const std::string& nodeSetName, const
}
ARMARX_DEBUG << "CartesianSelection-Mode: " << (int)mode;
auto controllerName = this->getName() + "_" + tcp + "_" + nodeSetName;
if (!nodeSetAlreadyControlled)
{
NJointCartesianVelocityControllerWithRampConfigPtr config = new NJointCartesianVelocityControllerWithRampConfig(nodeSetName, tcp, mode, 500, 1, 2, 1, 2);
NJointCartesianVelocityControllerWithRampConfigPtr config = new NJointCartesianVelocityControllerWithRampConfig(nodeSetName, tcp, mode, 500, 1, 2, 0.3f, 2);
// NJointCartesianVelocityControllerConfigPtr config = new NJointCartesianVelocityControllerConfig(nodeSetName, tcp, mode);
NJointCartesianVelocityControllerWithRampPtr ctrl = NJointCartesianVelocityControllerWithRampPtr::dynamicCast(
robotUnit->createNJointController(
......@@ -168,7 +168,7 @@ void TCPControllerSubUnit::setTCPVelocity(const std::string& nodeSetName, const
// }
if (!tcpController->isControllerActive())
{
robotUnit->activateNJointController(controllerName);
tcpController->activateController();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment