9 #include <xarm_msgs/CIOState.h> 26 for (
int i = 0; i < 8; ++i) { printf(
"CI%d=%d, ", i, (cio_msg.input_digitals[1] >> i) & 0x0001); }
31 printf(
" [AI] AI0=%f, AI1=%f\n", cio_msg.input_analogs[0], cio_msg.input_analogs[1]);
35 for (
int i = 0; i < 8; ++i) { printf(
"CO%d=%d, ", i, (cio_msg.output_digitals[1] >> i) & 0x0001); }
40 printf(
" [AO] AO0=%f, AO1=%f\n", cio_msg.output_analogs[0], cio_msg.output_analogs[1]);
45 for (
int i = 0; i < 8; ++i) { printf(
"CI%d=%d, ", i, cio_msg.input_conf[i]); }
51 for (
int i = 0; i < 8; ++i) { printf(
"CO%d=%d, ", i, cio_msg.output_conf[i]); }
57 printf(
"======================================\n");
60 int main(
int argc,
char **argv)
62 ros::init(argc, argv,
"xarm_cgpio_states");
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
void chatterCallback(xarm_msgs::CIOState cio_msg)