public static int getNumberOfVariables(JointType type) { return createJointState(null, type).getNumberOfStateVariables(); }
jointStates.get(i).update(logLongArray);
public YoVariableExtracter(File logFile) throws IOException { LogPropertiesReader logProperties = new LogPropertiesReader(new File(logFile, YoVariableLoggerListener.propertyFile)); File handshake = new File(logFile, logProperties.getHandshakeFile()); if (!handshake.exists()) { throw new RuntimeException("Cannot find " + logProperties.getHandshakeFile()); } DataInputStream handshakeStream = new DataInputStream(new FileInputStream(handshake)); byte[] handshakeData = new byte[(int) handshake.length()]; handshakeStream.readFully(handshakeData); handshakeStream.close(); YoVariableHandshakeParser parser = new YoVariableHandshakeParser("logged"); parser.parseFrom(handshakeData); YoVariableRegistry registry = parser.getRootRegistry(); File logdata = new File(logFile, logProperties.getVariableDataFile()); if(!logdata.exists()) { throw new RuntimeException("Cannot find " + logProperties.getVariableDataFile()); } @SuppressWarnings("resource") final FileChannel logChannel = new FileInputStream(logdata).getChannel(); List<YoVariable<?>> variables = parser.getYoVariablesList(); int jointStateOffset = variables.size(); int numberOfJointStates = JointState.getNumberOfJointStates(parser.getJointStates()); int bufferSize = (1 + jointStateOffset + numberOfJointStates) * 8; new YoVariableDialog(bufferSize, logChannel, variables, registry); }
private int getNumberOfJointStateVariables(YoProtoHandshake yoProtoHandshake) { int numberOfJointStates = 0; for (int i = 0; i < yoProtoHandshake.getJointCount(); i++) { JointDefinition joint = yoProtoHandshake.getJoint(i); numberOfJointStates += JointState.getNumberOfVariables(joint.getType()); } return numberOfJointStates; }
private void addJointStates(YoProtoHandshake yoProtoHandshake) { for (int i = 0; i < yoProtoHandshake.getJointCount(); i++) { JointDefinition joint = yoProtoHandshake.getJoint(i); jointStates.add(JointState.createJointState(joint.getName(), joint.getType())); } }
public static int getNumberOfJointStates(List<JointState> jointStates) { int numberOfJointStates = 0; for(int i = 0; i < jointStates.size(); i++) { numberOfJointStates += jointStates.get(i).getNumberOfStateVariables(); } return numberOfJointStates; } }
jointStates.get(i).update(logLongArray);
public YoVariableExtracter(File logFile) throws IOException { LogPropertiesReader logProperties = new LogPropertiesReader(new File(logFile, YoVariableLoggerListener.propertyFile)); File handshake = new File(logFile, logProperties.getVariables().getHandshakeAsString()); if (!handshake.exists()) { throw new RuntimeException("Cannot find " + logProperties.getVariables().getHandshakeAsString()); } DataInputStream handshakeStream = new DataInputStream(new FileInputStream(handshake)); byte[] handshakeData = new byte[(int) handshake.length()]; handshakeStream.readFully(handshakeData); handshakeStream.close(); YoVariableHandshakeParser parser = YoVariableHandshakeParser.create(logProperties.getVariables().getHandshakeFileType()); parser.parseFrom(handshakeData); YoVariableRegistry registry = parser.getRootRegistry(); File logdata = new File(logFile, logProperties.getVariables().getDataAsString()); if(!logdata.exists()) { throw new RuntimeException("Cannot find " + logProperties.getVariables().getDataAsString()); } @SuppressWarnings("resource") final FileChannel logChannel = new FileInputStream(logdata).getChannel(); List<YoVariable<?>> variables = parser.getYoVariablesList(); int jointStateOffset = variables.size(); int numberOfJointStates = JointState.getNumberOfJointStates(parser.getJointStates()); int bufferSize = (1 + jointStateOffset + numberOfJointStates) * 8; new YoVariableDialog(bufferSize, logChannel, variables, registry); }
public static int getNumberOfVariables(byte[] handShake) { YoProtoHandshake yoProtoHandshake = parseYoProtoHandshake(handShake); int jointStateVariables = 0; for (int i = 0; i < yoProtoHandshake.getJointCount(); i++) { jointStateVariables += JointState.getNumberOfVariables(yoProtoHandshake.getJoint(i).getType()); } return 1 + yoProtoHandshake.getVariableList().size() + jointStateVariables; }
private void addJointStates(YoProtoHandshake yoProtoHandshake) { for (int i = 0; i < yoProtoHandshake.getJointCount(); i++) { JointDefinition joint = yoProtoHandshake.getJoint(i); jointStates.add(JointState.createJointState(joint.getName(), convertJointType(joint.getType()))); } }
public static int getNumberOfJointStates(List<JointState> jointStates) { int numberOfJointStates = 0; for(int i = 0; i < jointStates.size(); i++) { numberOfJointStates += jointStates.get(i).getNumberOfStateVariables(); } return numberOfJointStates; } }
jointStates.get(i).update(data);
int numberOfJointStates = JointState.getNumberOfJointStates(jointStates); int bufferSize = (1 + jointStateOffset + numberOfJointStates) * 8;
private int getNumberOfJointStateVariables(YoProtoHandshake yoProtoHandshake) { int numberOfJointStates = 0; for (int i = 0; i < yoProtoHandshake.getJointCount(); i++) { JointDefinition joint = yoProtoHandshake.getJoint(i); numberOfJointStates += JointState.getNumberOfVariables(convertJointType(joint.getType())); } return numberOfJointStates; }
private void addJointStates(Handshake handshake) { for (int i = 0; i < handshake.getJoints().size(); i++) { JointDefinition joint = handshake.getJoints().get(i); jointStates.add(JointState.createJointState(joint.getNameAsString(), joint.getType())); } }
for(int i = 0; i < jointStates.size(); i++) jointStates.get(i).update(jointStateBuffer);
int numberOfJointStates = JointState.getNumberOfJointStates(jointStates); int bufferSize = (1 + jointStateOffset + numberOfJointStates) * 8;
private int getNumberOfJointStateVariables(Handshake handshake) { int numberOfJointStates = 0; for (int i = 0; i < handshake.getJoints().size(); i++) { JointDefinition joint = handshake.getJoints().get(i); numberOfJointStates += JointState.getNumberOfVariables(joint.getType()); } return numberOfJointStates; }