本文整理汇总了C++中PointType::setZ方法的典型用法代码示例。如果您正苦于以下问题:C++ PointType::setZ方法的具体用法?C++ PointType::setZ怎么用?C++ PointType::setZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointType
的用法示例。
在下文中一共展示了PointType::setZ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char **argv) {
try {
// Connect to the server
CRCLSocket s("localhost", 64444);
// Create an instance to wrap all commands.
CRCLCommandInstanceType instance;
// Create and send init command.
InitCanonType initCmd;
initCmd.setCommandID(BigInteger::valueOf(7));
instance.setCRCLCommand(initCmd);
s.writeCommand(instance);
// Create and send MoveTo command.
MoveToType moveTo;
moveTo.setCommandID(BigInteger::valueOf(8));
PoseType pose;
PointType pt;
pt.setX(BigDecimal::valueOf(0.6));
pt.setY(BigDecimal::valueOf(0.1));
pt.setZ(BigDecimal::valueOf(0.1));
PrintObject("pt.getX()=",pt.getX());
PrintObject("BigDecimal::valueOf(0.6)=",BigDecimal::valueOf(0.6));
pose.setPoint(pt);
VectorType xAxis;
xAxis.setI(BigDecimal::getONE());
xAxis.setJ(BigDecimal::getZERO());
xAxis.setK(BigDecimal::getZERO());
pose.setXAxis(xAxis);
VectorType zAxis;
zAxis.setI(BigDecimal::getZERO());
zAxis.setJ(BigDecimal::getZERO());
zAxis.setK(BigDecimal::getONE());
pose.setZAxis(zAxis);
moveTo.setEndPosition(pose);
moveTo.setMoveStraight(false);
instance.setCRCLCommand(moveTo);
s.writeCommand(instance, JNI_TRUE);
BigInteger IDback= BigInteger::getONE();
CommandStatusType cmdStat;
do {
GetStatusType getStat;
getStat.setCommandID(BigInteger::valueOf(9));
instance.setCRCLCommand(getStat);
s.writeCommand(instance);
CRCLStatusType stat = s.readStatus();
cmdStat = stat.getCommandStatus();
IDback = cmdStat.getCommandID();
PrintObject("Command ID=", IDback);
PrintObject("stat=", stat);
PrintObject("cmdStat.getCommandState()=",cmdStat.getCommandState());
pose = stat.getPoseStatus().getPose();
PrintObject("pose=", pose);
pt = pose.getPoint();
PrintObject("X:", pt.getX());
PrintObject("Y:", pt.getY());
PrintObject("Z:", pt.getZ());
JointStatusesType jst = stat.getJointStatuses();
if (jst.jthis != NULL) {
List l = jst.getJointStatus();
for (int i = 0; i < l.size(); i++) {
JointStatusType elem;
elem = JointStatusType::cast(l.get(i));
PrintObject("Joint Number :", elem.getJointNumber());
PrintObject("Joint Position :", elem.getJointPosition());
}
}
} while (!IDback.equals(moveTo.getCommandID()) || cmdStat.getCommandState().equals(CommandStateEnumType::getCRCL_WORKING()));
cout << " End of C++ main() reached. " << endl;
} catch (jthrowable t) {
PrintJThrowable("Exception Thrown : ", t);
exit(1);
}
}