【发布时间】:2021-04-15 23:26:09
【问题描述】:
我正在使用 DDS,并且需要能够发送从各种设备接收到的数据。我有使用 RTI DDS 的 IDL 文件中的文件。但是,这些 IDL 似乎与使用 C++11 IDL 映射的 OpenDDS 不同。结构体
struct ddsServicerDynamicsData {
ddsVector3_dbl rpos_eci; //position relative to Earth in ECI coordinates (x, y, z) [m]
ddsVector3_dbl rvel_eci; //velocity relative to Earth in ECI coordinates (x_dot, y_dot, z_dot) [m/s]
ddsVector3_dbl vrot_eci; //rotation velocity around pricipal axes in ECI frame (phi_dot, theta_dot, psi_dot); TODO: units [rad/s] or [deg/s]
ddsVector3_dbl arot_eci; //angular orientation in ECI frame (phi, theta, psi); TODO: units [rad] or [deg]
ddsVector3_dbl cgshift; //vector from arbitrary reference point to S/C center of gravity (example: vector from base of robot arm to CG) in S/C coordinates
float antennastate0[3]; //antenna position vector (azimuth, elevation, polarization); TODO: units [rad] or [deg]
float antennastate1[3];
float armstate0[7]; //7DOF robotic arm joint angles (epsilon 0 to 6); TODO: units [rad] or [deg]
float armstate1[7];
float armstate2[7];
float armstate3[7];
};
抛出消息
Error - opendds_idl: "DataTypes.idl", line 53: field has an anonymous type.
我阅读了匿名类型,发现问题在于未声明数组值,但不知道如何使其不匿名,因为此数据类型将从设备接收三个值。在 IDL 到 C++ 语言映射的开发人员指南中,关于匿名类型的唯一信息是
"匿名 IDL 类型已被 IDL 规范弃用,并且在 IDL 到 C++11 语言中不受支持 映射规范。实现此映射的 IDL 编译器在检测到 匿名类型。”(https://www.omg.org/spec/CPP11/1.1/PDF)第 6.2 节
我不确定如何绕过此错误消息或如何修复它。
【问题讨论】: