Skip to content
Snippets Groups Projects
Select Git revision
  • 69592f56b24df922869581ef84e792315df1f168
  • main default
  • feature/cleanup-for-registry protected
  • kinetic
  • 0.3.7
  • 0.3.6
  • 0.3.5
  • 0.3.4
  • 0.3.3
  • 0.3.2
  • 0.2.2
  • 0.3.1
  • 0.3.0
  • 0.2.1
  • 0.1.6
  • 0.1.5
  • 0.2.0
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.0.1
  • 0.0.0
23 results

stack.xml

Blame
  • Test.connect 1.24 KiB
    /* Version 2020-07-15  */
    // --- update definitions ---
    receive Link.CurrentPosition using ParseRobotState, RobotStateToIntPosition ;
    send RobotArm.AppropriateSpeed using CreateSpeedMessage, SerializeRobotConfig ;
    
    // --- dependency definitions ---
    RobotArm.AppropriateSpeed canDependOn Link.CurrentPosition as dependency1 ;
    
    // --- mapping definitions ---
    ParseRobotState maps byte[] bytes to robot.RobotStateOuterClass.RobotState {:
      TestCounter.INSTANCE.numberParseLinkState += 1;
      return robot.RobotStateOuterClass.RobotState.parseFrom(bytes);
    :}
    
    SerializeRobotConfig maps config.Config.RobotConfig rc to byte[] {:
      TestCounter.INSTANCE.numberSerializeRobotConfig += 1;
      return rc.toByteArray();
    :}
    
    RobotStateToIntPosition maps robot.RobotStateOuterClass.RobotState rs to IntPosition {:
      TestCounter.INSTANCE.numberLinkStateToIntPosition += 1;
      robot.RobotStateOuterClass.RobotState.Position p = rs.getPosition();
      return IntPosition.of((int) (Math.round(p.getX() * 10)), (int) (Math.round(p.getY() * 10)), (int) (Math.round(p.getZ() * 10)));
    :}
    
    CreateSpeedMessage maps double speed to config.Config.RobotConfig {:
      TestCounter.INSTANCE.numberCreateSpeedMessage += 1;
      return config.Config.RobotConfig.newBuilder()
        .setSpeed(speed)
        .build();
    :}