25 #include <RobotSkillTemplates/statecharts/ForceControlGroup/ForceControlGroupStatechartContext.generated.h>
29 #include <VirtualRobot/Robot.h>
30 #include <VirtualRobot/RobotNodeSet.h>
33 using namespace ForceControlGroup;
47 ForceControlGroupStatechartContext*
c = getContext<ForceControlGroupStatechartContext>();
48 c->getTCPControlUnit()->request();
53 if (in.istcpNameSet())
55 tcpName = in.gettcpName();
59 tcpName =
c->getRobot()->getRobotNodeSet(in.getrobotNodeSetName())->getTCP()->getName();
62 DatafieldRefPtr forceRef = DatafieldRefPtr::dynamicCast(
c->getForceTorqueObserver()->getForceDatafield(tcpName));
63 DatafieldRefPtr torqueRef = DatafieldRefPtr::dynamicCast(
c->getForceTorqueObserver()->getTorqueDatafield(tcpName));
64 local.setforceRef(DatafieldRefPtr::dynamicCast(
c->getForceTorqueObserver()->createNulledDatafield(forceRef)));
65 local.settorqueRef(DatafieldRefPtr::dynamicCast(
c->getForceTorqueObserver()->createNulledDatafield(torqueRef)));
66 local.setstartVelocity(
new FramedDirection(Eigen::Vector3f::Zero(), tcpName,
c->getRobot()->getName()));
74 ForceControlGroupStatechartContext*
c = getContext<ForceControlGroupStatechartContext>();
75 c->getTCPControlUnit()->release();
76 c->getForceTorqueObserver()->removeFilteredDatafield(local.getforceRef());