cmvr-es/protos/cmvr/config/robot_config/robot_config.proto
2026-06-17 13:52:49 +08:00

88 lines
3.2 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
package cmvr.config;
// 电机配置
message MotorConfig {
int32 id = 1; // 电机ID
string jointName = 2; // 关节名称
float limitQLb = 3; // 位置下限
float limitQUb = 4; // 位置上限
float limitQd = 5; // 速度限制
}
// 通用的CAN设备配置手臂、头部、腰部都可以复用
message CanDeviceConfig {
string id = 1; // CAN ID
string devId = 2; // 设备ID
int32 channelId = 3; // 通道ID
bool enable = 4; // 是否启用
string toolFrame = 5; // 工具坐标系(手臂需要,头/腰可选)
repeated MotorConfig motors = 6; // 电机列表
}
// CAN管理器配置
message CanManagerConfig {
string id = 1; // CAN管理器ID
string devId = 2; // 设备ID
CanDeviceConfig left_arm = 3; // 左臂CAN
CanDeviceConfig right_arm = 4; // 右臂CAN
CanDeviceConfig head = 5; // 头部CAN
CanDeviceConfig waist = 6; // 腰部CAN
}
// 人形机器人配置
message HumanRobotConfig {
string id = 1; // 机器人ID如 "hc01"
int32 dof = 2; // 自由度,如 14
string urdf = 3; // URDF文件路径
string baseLink = 4; // 基座link名称如 "PELVIS_S"
string jointNames = 5; // 关节名称列表,逗号分隔
string linkNames = 6; // link名称列表逗号分隔
int32 bufferSize = 7; // 缓冲区大小,如 50
bool verbose = 8; // 是否详细输出
int32 updFreq = 9; // 更新频率,如 500
CanManagerConfig can_manager = 10; // CAN管理器配置
bool enable = 11; // 是否启用
}
// EtherCAT主站配置
message EthercatMasterConfig {
string interface = 1; // 网络接口,如 "eth0"
int32 cycle_time_us = 2; // 周期时间微秒默认1000
bool enable = 3; // 是否启用
}
// EtherCAT电机驱动配置
message EthercatMotorConfig {
int32 slave = 1; // 从站ID
string jointName = 2; // 关节名称
float limitQLb = 3; // 位置下限
float limitQUb = 4; // 位置上限
float limitQd = 5; // 速度限制
}
// EtherCAT机器人配置
message EthercatRobotConfig {
string id = 1; // 机器人ID
int32 dof = 2; // 自由度
string urdf = 3; // URDF文件路径
string baseLink = 4; // 基座link名称
string jointNames = 5; // 关节名称列表,逗号分隔
string linkNames = 6; // link名称列表逗号分隔
int32 bufferSize = 7; // 缓冲区大小
bool verbose = 8; // 是否详细输出
int32 updFreq = 9; // 更新频率Hz
bool enable = 10; // 是否启用
EthercatMasterConfig master = 11; // EtherCAT主站配置
repeated EthercatMotorConfig motors = 12; // 电机配置列表
}
// 主配置
message RobotConfig {
repeated HumanRobotConfig humanrobots = 1;
repeated EthercatRobotConfig ethercat_robots = 2; // 新增的EtherCAT机器人
}