Skip to content
Snippets Groups Projects
Select Git revision
  • 04dedac7f661e1c0da48daab0eb1f55d9e7754b6
  • noetic/main default protected
  • noetic/orientation_fix
  • noetic/demo/ga-2023-1-motion-grammars
  • noetic/feature/robotics-festival
  • ga-demo
  • noetic/feature/tags
  • noetic/feature/collab
  • ccnc-demo
9 results

robot_setup.launch

Blame
  • Test.ros2rag 1.21 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 ;
    
    // --- mapping definitions ---
    ParseLinkState maps byte[] bytes to panda.Linkstate.PandaLinkState {:
      TestCounter.INSTANCE.numberParseLinkState += 1;
      return panda.Linkstate.PandaLinkState.parseFrom(bytes);
    :}
    
    SerializeRobotConfig maps config.Robotconfig.RobotConfig rc to byte[] {:
      TestCounter.INSTANCE.numberSerializeRobotConfig += 1;
      return rc.toByteArray();
    :}
    
    LinkStateToIntPosition maps panda.Linkstate.PandaLinkState pls to IntPosition {:
      TestCounter.INSTANCE.numberLinkStateToIntPosition += 1;
      panda.Linkstate.PandaLinkState.Position p = pls.getPos();
      return IntPosition.of((int) (10 * p.getPositionX()), (int) (10 * p.getPositionY()), (int) (10 * p.getPositionZ()));
    :}
    
    CreateSpeedMessage maps double speed to config.Robotconfig.RobotConfig {:
      TestCounter.INSTANCE.numberCreateSpeedMessage += 1;
      return config.Robotconfig.RobotConfig.newBuilder()
        .setSpeed(speed)
        .build();
    :}