Example.ros2rag 814 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
/* Version 2020-04-17 */
// --- update definitions ---
read Joint.CurrentPosition using LinkStateToIntPosition ;
write RobotArm._AppropriateSpeed using CreateSpeedMessage ;

// --- dependency definitions ---
RobotArm._AppropriateSpeed canDependOn Joint.CurrentPosition as dependency1 ;
RobotArm._AppropriateSpeed canDependOn RobotArm._AttributeTestSource as dependency2 ;

// --- mapping definitions ---
11
LinkStateToIntPosition maps panda.Linkstate.PandaLinkState x to IntPosition y {:
12
  panda.Linkstate.PandaLinkState.Position p = x.getPos();
13
  { int i = 0; }
14
  y = IntPosition.of((int) p.getPositionX(), (int) p.getPositionY(), (int) p.getPositionZ());
15
:}
16

17
CreateSpeedMessage maps double x to config.Robotconfig.RobotConfig y {:
18
19
20
  y = config.Robotconfig.RobotConfig.newBuilder()
    .setSpeed(x)
    .build();
21
:}