4#include "mechanism/zmq/ec_zmq_context.h"
6enum EC_REPL_CMD_STATUS :
int {
17inline const char* get_cmd_type(iit::advr::CmdType type)
21 case iit::advr::CmdType::TRJ_CMD:
return "TRJ_CMD";
22 case iit::advr::CmdType::CTRL_CMD:
return "CTRL_CMD";
23 case iit::advr::CmdType::FLASH_CMD:
return "FLASH_CMD";
24 case iit::advr::CmdType::ECAT_MASTER_CMD:
return "ECAT_MASTER_CMD";
25 case iit::advr::CmdType::FOE_MASTER:
return "FOE_MASTER";
26 case iit::advr::CmdType::TRJ_QUEUE_CMD:
return "TRJ_QUEUE_CMD";
27 case iit::advr::CmdType::SLAVE_SDO_CMD:
return "SLAVE_SDO_CMD";
28 case iit::advr::CmdType::SLAVE_SDO_INFO:
return "SLAVE_SDO_INFO";
29 case iit::advr::CmdType::MOTOR_PDO_CMD:
return "MOTOR_PDO_CMD";
30 case iit::advr::CmdType::PDO_AUX_CMD:
return "PDO_AUX_CMD";
31 default:
return(
"UNKNOWN COMMAND");
93 _recovery_info=recovery_info;
133 return _recovery_info;
139 std::string _recovery_info;
140 std::string _zmq_cmd;
148 typedef std::shared_ptr<EcReplCmd> Ptr;
152 std::vector<float> x;
167 std::vector<float> x;
168 std::vector<float> y;
174 iit::advr::PDOs_aux_cmd_Aux_cmd_Type type;
179 using m_ref_t = std::tuple<int32_t,
181 float, float, float, float, float,
182 uint32_t, uint32_t,
float>;
184 using motors_ref_map = std::map<int32_t,m_ref_t>;
213 std::map<std::string,std::string> args,
229 unsigned long int password,
230 std::string mcu_type,
260 std::vector<std::string> rd_sdo,
261 std::map<std::string ,std::string> wr_sdo,
290 std::vector<float> gains,
322 std::vector<std::string> trj_names,
365 void set_motor_type_map(std::map<int32_t,std::string> motor_type_map);
369 std::string _zmq_uri;
371 std::map<int32_t,std::string> _advrf_motor_map;
372 void check_advrf_motor_gains(iit::advr::Gains_Type ctrl_type,std::vector<float> &gains);
389 void zmq_cmd_recv(std::string& msg,
390 iit::advr::CmdType cmd_sent,
391 zmq::socket_t& socket,
396 bool zmq_cmd_send(iit::advr::Repl_cmd pb_cmd,
397 zmq::socket_t& socket,
EcReplFault FOE_Master(std::string filename, unsigned long int password, std::string mcu_type, long int slave_pos, long int board_id, std::string &msg)
FOE Master command for flash a new firmare for a specific slave.
EcReplFault Ctrl_cmd(iit::advr::Ctrl_cmd_Type type, long int board_id, float value, std::vector< float > gains, std::string &msg)
Control command is used to control the motors or start the auto-calibration mechanisms.
EcReplFault Ecat_Master_cmd(iit::advr::Ecat_Master_cmd_Type type, std::map< std::string, std::string > args, std::string &msg)
EtherCAT Master command for stopping, starting the EtherCAT Master Server and GET EtherCAT informatio...
void set_zmq_timeout(int timeout)
set timeout of ZMQ communication.
EcReplCmd(std::string zmq_uri, int timeout)
Constructor of EcReplCmd Class. It needs of zmq uri (TCP/UDP) and of a timeout.
EcReplFault Slave_SDO_cmd(long int board_id, std::vector< std::string > rd_sdo, std::map< std::string, std::string > wr_sdo, std::string &msg)
The slave SDO command is typical used to read the values of SDO of specific slave in pre-operational ...
EcReplFault Trajectory_Cmd(iit::advr::Trajectory_cmd_Type type, std::string name, long int board_id, homing_par_t homing_par, period_par_t period_par, smooth_par_t smooth_par, std::string &msg)
Command to send a trajectory to the slave.
std::string get_zmq_uri()
Return ZMQ URI for the ZMQ communication.
EcReplFault Flash_cmd(iit::advr::Flash_cmd_Type type, long int board_id, std::string &msg)
Flash command for save, load and load default sdo of the FLASH.
EcReplFault PDOs_aux_cmd(std::vector< aux_cmd_message_t > aux_cmds, std::string &msg)
Command to release or engage motors brake.
void zmq_do_cmd(iit::advr::Repl_cmd pb_cmd, std::string &msg, int timeout, EcReplFault &fault)
This method is responsible to perform the ZMQ commad to EtherCAT Server.
EcReplFault Motors_PDO_cmd(motors_ref_map motors_references)
Command to send references.
int get_zmq_timeout()
Return timeout of ZMQ communication.
EcReplFault Slave_SDO_info(iit::advr::Slave_SDO_info_Type type, long int board_id, std::string &msg)
Slave SDO Information is a command to get the SDO datas of a specific slave.
EcReplFault Trj_queue_cmd(iit::advr::Trj_queue_cmd_Type type, std::vector< std::string > trj_names, std::string &msg)
Command to start or clear a trajectoy using its name.
~EcReplCmd()
Destructor of EcReplCmd Class-.
Definition ec_repl_cmd.h:37
std::string get_recovery_info()
method to set the information related on ZMQ Command fault.
Definition ec_repl_cmd.h:132
std::string get_zmq_cmd()
method to get the ZMQ Command type
Definition ec_repl_cmd.h:102
~EcReplFault()
Destructor of EcReplCmd Fault Class.
Definition ec_repl_cmd.h:53
void set_type(int type)
method to set the type of ZMQ Command fault.
Definition ec_repl_cmd.h:72
std::string get_info()
method to get the recovery for the ZMQ Command.
Definition ec_repl_cmd.h:122
EcReplFault()
Constructor of EcReplCmd Fault Class. This class is responsible to manage the fault coming from ZMQ c...
Definition ec_repl_cmd.h:45
int get_type()
method to get the type of ZMQ Command fault.
Definition ec_repl_cmd.h:112
void set_info(std::string info)
method to set the information related on ZMQ Command fault.
Definition ec_repl_cmd.h:82
void set_recovery_info(std::string recovery_info)
method to se the recovery for the ZMQ Command.
Definition ec_repl_cmd.h:92
void set_zmq_cmd(std::string zmq_cmd)
method to set the ZMQ Command type.
Definition ec_repl_cmd.h:62
Definition ec_repl_cmd.h:172
Definition ec_repl_cmd.h:150
Definition ec_repl_cmd.h:156
Definition ec_repl_cmd.h:165