Select Git revision
Example.ros2rag

René Schöne authored
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();
:}