EtherCAT Control Framework v0.9
Implementation of EtherCAT protocol using IgH EtherCAT library for robot controller.
ecat_slave.hpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * $Id$
4 *
5 * Copyright (C) 2021 Veysi ADIN, UST KIST
6 *
7 * This file is part of the IgH EtherCAT master userspace program in the ROS2 environment.
8 *
9 * The IgH EtherCAT master userspace program in the ROS2 environment is free software; you can
10 * redistribute it and/or modify it under the terms of the GNU General
11 * Public License as published by the Free Software Foundation; version 2
12 * of the License.
13 *
14 * The IgH EtherCAT master userspace program in the ROS2 environment is distributed in the hope that
15 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with the IgH EtherCAT master userspace program in the ROS environment. If not, see
21 * <http://www.gnu.org/licenses/>.
22 *
23 * ---
24 *
25 * The license mentioned above concerns the source code only. Using the
26 * EtherCAT technology and brand is only permitted in compliance with the
27 * industrial property and similar rights of Beckhoff Automation GmbH.
28 *
29 * Contact information: veysi.adin@kist.re.kr
30 *****************************************************************************/
31/******************************************************************************
32 * \file ecat_slave.hpp
33 * \brief Ethercat slave class implementation header file.
34 *
35 * This header file contains blueprint of EtherCAT slave's which will be
36 * used to communicate with EtherCAT master.
37 * @todo After implementation explain functionality of this class and methods.
38 *******************************************************************************/
39#pragma once
40
41#include "ecat_globals.hpp"
42
43
44/******************************************************************************
45 * \class EthercatSlave
46 * \brief Contains EtherCAT slave parameters for configuration.
47 * .
48 *******************************************************************************/
50{
51 public:
62
63
65 const static uint32_t kSync0_shift_ = 0;
66
68 ec_slave_config_t * slave_config_ ;
69
71 ec_slave_config_state_t slave_config_state_ ;
72
74 ec_pdo_info_t * slave_pdo_info_ ;
76 ec_pdo_entry_info_t * slave_pdo_entry_info_;
78 ec_sync_info_t * slave_sync_info_;
80 ec_pdo_entry_reg_t * slave_pdo_entry_reg_ ;
83
85 int32_t motor_state_ ;
91 ec_slave_info_t slave_info_;
100 // Slave homing parameters.
102
103};// EthercatSlave class
Definition: ecat_slave.hpp:50
HomingParam homing_param_
Definition: ecat_slave.hpp:101
OffsetPDO offset_
Offset for PDO entries to assign pdo registers.
Definition: ecat_slave.hpp:93
int CheckSlaveConfigState()
This function will check slave's application layer states. (INIT/PREOP/SAFEOP/OP)
Definition: ecat_slave.cpp:13
ProfileVelocityParam velocity_param_
Slave velocity parameters.
Definition: ecat_slave.hpp:97
ec_pdo_entry_info_t * slave_pdo_entry_info_
Definition: ecat_slave.hpp:76
ProfilePosParam position_param_
Slave position parameters.
Definition: ecat_slave.hpp:99
ec_slave_info_t slave_info_
Slave information data structure. This structure contains all information related to slave....
Definition: ecat_slave.hpp:91
~EthercatSlave()
Definition: ecat_slave.cpp:8
ec_slave_config_t * slave_config_
Slave configuration parameters, assinged to each slave.
Definition: ecat_slave.hpp:68
static const uint32_t kSync0_shift_
DC sync shift setting, zero will give best synchronization.
Definition: ecat_slave.hpp:65
ReceivedData data_
Received data from servo drivers.
Definition: ecat_slave.hpp:95
ec_pdo_entry_reg_t * slave_pdo_entry_reg_
Definition: ecat_slave.hpp:80
ec_pdo_info_t * slave_pdo_info_
Definition: ecat_slave.hpp:74
ec_slave_config_state_t slave_config_state_
Slave state handle to check if slave is online and slaves state machine status(INIT/PREOP/SAFEOP/0P)
Definition: ecat_slave.hpp:71
int32_t motor_state_
Variable for checking motor state.
Definition: ecat_slave.hpp:85
uint8_t * slave_pdo_domain_
PDO domain for data exchange.
Definition: ecat_slave.hpp:82
ec_sync_info_t * slave_sync_info_
Definition: ecat_slave.hpp:78
EthercatSlave()
Definition: ecat_slave.cpp:3
Parameters that should be specified in homing mode.
Definition: ecat_definitions.hpp:402
offset for PDO entries to register PDOs.
Definition: ecat_definitions.hpp:232
Parameters that should be specified in position mode.
Definition: ecat_definitions.hpp:322
Parameters that should be specified in velocity mode.
Definition: ecat_definitions.hpp:418
Received feedback data from slaves.
Definition: ecat_definitions.hpp:264