Skip to content
Snippets Groups Projects
Select Git revision
  • a882cdc3b3c22a89ea9ab9da483ea6d325e9746e
  • master default protected
  • 20-poc-use-tinytemplate-as-template-engine
  • dev/rene
  • feature/submodule
  • feature/relast
6 results

Example.ros2rag

Blame
  • Example.ros2rag 1.07 KiB
    /* Version 2020-04-17 */
    // --- update definitions ---
    read Joint.CurrentPosition using ParseLinkState, LinkStateToIntPosition ;
    write RobotArm.AppropriateSpeed using CreateSpeedMessage, SerializeRobotConfig ;
    
    // --- dependency definitions ---
    RobotArm.AppropriateSpeed canDependOn Joint.CurrentPosition as dependency1 ;
    RobotArm.AppropriateSpeed canDependOn RobotArm.AttributeTestSource as dependency2 ;
    
    // --- mapping definitions ---
    ParseLinkState maps byte[] bytes to panda.Linkstate.PandaLinkState {:
      return panda.Linkstate.PandaLinkState.parseFrom(bytes);
    :}
    
    SerializeRobotConfig maps config.Robotconfig.RobotConfig rc to byte[] {:
      return rc.toByteArray();
    :}
    
    LinkStateToIntPosition maps panda.Linkstate.PandaLinkState pls to IntPosition {:
      panda.Linkstate.PandaLinkState.Position p = pls.getPos();
      { int i = 0; }
      return IntPosition.of((int) p.getPositionX(), (int) p.getPositionY(), (int) p.getPositionZ());
    :}
    
    CreateSpeedMessage maps double speed to config.Robotconfig.RobotConfig {:
      return config.Robotconfig.RobotConfig.newBuilder()
        .setSpeed(speed)
        .build();
    :}