Example.ros2rag 816 Bytes
Newer Older
René Schöne's avatar
René Schöne committed
1
2
3
4
5
6
7
8
9
/**
 * 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 ;
10
RobotArm._AppropriateSpeed canDependOn RobotArm._AttributeTestSource as dependency2 ;
René Schöne's avatar
René Schöne committed
11
12

// --- mapping definitions ---
13
LinkStateToIntPosition maps protobuf panda.Linkstate.PandaLinkState x to IntPosition y {
René Schöne's avatar
René Schöne committed
14
15
16
17
  panda.Linkstate.PandaLinkState.Position p = x.getPos();
  y = IntPosition.of((int) p.getPositionX(), (int) p.getPositionY(), (int) p.getPositionZ());
}

18
CreateSpeedMessage maps double x to protobuf config.Robotconfig.RobotConfig y {
René Schöne's avatar
René Schöne committed
19
20
21
22
  y = config.Robotconfig.RobotConfig.newBuilder()
    .setSpeed(x)
    .build();
}