5#include "mechanism/pipe/ec_pipe_pdo.h"
6#include "mechanism/zmq/ec_zmq_pdo.h"
8 static const std::vector<std::string>name = {
"force_x",
"force_y",
"force_z",
"torque_x",
"torque_y",
"torque_z",
"fault",
"rtt"};
9 static const int pdo_size=8;
10 using pdo_t=std::tuple<float, float, float, float, float,float,uint16_t,uint16_t>;
12 inline bool make_vector_from_tuple(
const pdo_t &pdo_tuple,std::vector<T> &pdo_vector){
13 if(pdo_vector.size()!=pdo_size){
16 pdo_vector[0]=
static_cast<T
>(std::get<0>(pdo_tuple));
17 pdo_vector[1]=
static_cast<T
>(std::get<1>(pdo_tuple));
18 pdo_vector[2]=
static_cast<T
>(std::get<2>(pdo_tuple));
19 pdo_vector[3]=
static_cast<T
>(std::get<3>(pdo_tuple));
20 pdo_vector[4]=
static_cast<T
>(std::get<4>(pdo_tuple));
21 pdo_vector[5]=
static_cast<T
>(std::get<5>(pdo_tuple));
22 pdo_vector[6]=
static_cast<T
>(std::get<6>(pdo_tuple));
23 pdo_vector[7]=
static_cast<T
>(std::get<7>(pdo_tuple));
33 FtPdo(
const std::string ,int32_t
id, uint32_t type);
40 FtPdoRx::pdo_t rx_pdo{};
41 bool init_rx_pdo=
false;
45inline FtPdo<T>::FtPdo(
const std::string value,int32_t
id, uint32_t type):
53inline FtPdo<T>::~FtPdo()
59inline void FtPdo<T>::get_from_pb()
61 std::get<0>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->force_x();
62 std::get<1>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->force_y();
63 std::get<2>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->force_z();
64 std::get<3>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->torque_x();
65 std::get<4>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->torque_y();
66 std::get<5>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->torque_z();
67 std::get<6>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->fault();
68 std::get<7>(rx_pdo)= T::pb_rx_pdos.mutable_ft6_rx_pdo()->rtt();
76inline void FtPdo<T>::set_to_pb()