35 lines
866 B
Plaintext
35 lines
866 B
Plaintext
|
|
// servo_service.erpc
|
|||
|
|
// Generator examples:
|
|||
|
|
// .\erpcgen.exe -o .\generated\ -g c .\servo_service.erpc
|
|||
|
|
// .\erpcgen.exe -g py .\servo_service.erpc
|
|||
|
|
// 注意:interface 客户端和服务端erpc里面的函数顺序一定要一样
|
|||
|
|
|
|||
|
|
program servo_service
|
|||
|
|
|
|||
|
|
enum RpcMotionMode {
|
|||
|
|
RpcMotionModeImmediate = 0,
|
|||
|
|
RpcMotionModeSCurve = 1,
|
|||
|
|
RpcMotionModeFollow = 2
|
|||
|
|
}
|
|||
|
|
struct ServoCmd {
|
|||
|
|
string id
|
|||
|
|
float angle_rad
|
|||
|
|
}
|
|||
|
|
interface servo_service
|
|||
|
|
{
|
|||
|
|
setConstraints(string id,
|
|||
|
|
float max_velocity_rad,
|
|||
|
|
float max_acceleration_rad,
|
|||
|
|
float max_jerk_rad) -> bool
|
|||
|
|
setPositionGain(string id,
|
|||
|
|
float position_gain) -> bool
|
|||
|
|
|
|||
|
|
setMode(RpcMotionMode mode)->bool
|
|||
|
|
setUpdatePeriodMs(uint32 ms) -> bool
|
|||
|
|
move(list<ServoCmd> cmds) -> int32
|
|||
|
|
|
|||
|
|
moveJ(list<float> angles_rad) -> int32
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|