├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── jenkins-pipeline
├── soem_interface_examples
├── CMakeLists.txt
├── include
│ └── soem_interface_examples
│ │ └── ExampleSlave.hpp
├── package.xml
└── src
│ ├── example_slave.cpp
│ └── soem_interface_examples
│ └── ExampleSlave.cpp
├── soem_interface_rsl
├── CMakeLists.txt
├── include
│ └── soem_interface_rsl
│ │ ├── EthercatBusBase.hpp
│ │ ├── EthercatBusManagerBase.hpp
│ │ ├── EthercatSlaveBase.hpp
│ │ └── common
│ │ ├── EthercatTypes.hpp
│ │ ├── ExtendedRegisters.hpp
│ │ ├── Macros.hpp
│ │ ├── ObjectDictionaryUtilities.hpp
│ │ ├── ThreadSleep.hpp
│ │ └── soem_rsl_export.h
├── package.xml
└── src
│ └── soem_interface_rsl
│ ├── EthercatBusBase.cpp
│ ├── EthercatBusManagerBase.cpp
│ ├── EthercatSlaveBase.cpp
│ └── common
│ ├── Macros.cpp
│ └── ThreadSleep.cpp
└── soem_rsl
├── CMakeLists.txt
├── package.xml
└── soem_rsl
├── .gitignore
├── .travis.yml
├── ChangeLog
├── Doxyfile
├── LICENSE
├── README.md
├── appveyor.yml
├── cmake
├── Modules
│ └── Platform
│ │ ├── rt-kernel-C.cmake
│ │ ├── rt-kernel-gcc-bfin.cmake
│ │ ├── rt-kernel-gcc-kinetis.cmake
│ │ ├── rt-kernel-gcc.cmake
│ │ ├── rt-kernel.cmake
│ │ └── rtems.cmake
└── Toolchains
│ ├── rt-kernel-bfin.cmake
│ └── rt-kernel-kinetis.cmake
├── doc
├── images
│ ├── legacy_iomap.png
│ ├── memory_layout.png
│ └── overlapping_iomap.png
├── soem_rsl.dox
└── tutorial.txt
├── drvcomment.txt
├── osal
├── erika
│ ├── osal.c
│ └── osal_defs.h
├── intime
│ ├── osal.c
│ └── osal_defs.h
├── linux
│ ├── osal.c
│ └── osal_defs.h
├── macosx
│ ├── osal.c
│ └── osal_defs.h
├── osal.h
├── rtems
│ ├── osal.c
│ └── osal_defs.h
├── rtk
│ ├── osal.c
│ └── osal_defs.h
├── vxworks
│ ├── osal.c
│ └── osal_defs.h
└── win32
│ ├── inttypes.h
│ ├── osal.c
│ ├── osal_defs.h
│ ├── osal_win32.h
│ └── stdint.h
├── oshw
├── erika
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ └── oshw.h
├── intime
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ └── oshw.h
├── linux
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ └── oshw.h
├── macosx
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ └── oshw.h
├── rtems
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ └── oshw.h
├── rtk
│ ├── fec
│ │ ├── fec_ecat.c
│ │ └── fec_ecat.h
│ ├── lw_mac
│ │ ├── lw_emac.c
│ │ └── lw_emac.h
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ └── oshw.h
├── vxworks
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ └── oshw.h
└── win32
│ ├── nicdrv.c
│ ├── nicdrv.h
│ ├── oshw.c
│ ├── oshw.h
│ └── wpcap
│ ├── Include
│ ├── Packet32.h
│ ├── Win32-Extensions.h
│ ├── bittypes.h
│ ├── ip6_misc.h
│ ├── pcap-bpf.h
│ ├── pcap-namedb.h
│ ├── pcap-stdinc.h
│ ├── pcap.h
│ ├── pcap
│ │ ├── bluetooth.h
│ │ ├── bpf.h
│ │ ├── namedb.h
│ │ ├── pcap.h
│ │ ├── sll.h
│ │ ├── usb.h
│ │ └── vlan.h
│ └── remote-ext.h
│ └── Lib
│ ├── Packet.lib
│ ├── libpacket.a
│ ├── libwpcap.a
│ ├── wpcap.lib
│ └── x64
│ ├── Packet.lib
│ └── wpcap.lib
├── soem_rsl
├── ethercat.h
├── ethercatbase.c
├── ethercatbase.h
├── ethercatcoe.c
├── ethercatcoe.h
├── ethercatconfig.c
├── ethercatconfig.h
├── ethercatconfiglist.h
├── ethercatdc.c
├── ethercatdc.h
├── ethercateoe.c
├── ethercateoe.h
├── ethercatfoe.c
├── ethercatfoe.h
├── ethercatmain.c
├── ethercatmain.h
├── ethercatprint.c
├── ethercatprint.h
├── ethercatsoe.c
├── ethercatsoe.h
└── ethercattype.h
└── test
├── intime
└── ec_master
│ └── ec_master.c
├── linux
├── aliastool.c
├── ebox
│ └── ebox.c
├── eepromtool
│ ├── CMakeLists.txt
│ └── eepromtool.c
├── eoe_test
│ └── eoe_test.c
├── firm_update
│ └── firm_update.c
├── red_test
│ └── red_test.c
├── simple_test
│ ├── CMakeLists.txt
│ └── simple_test.c
└── slaveinfo
│ ├── CMakeLists.txt
│ └── slaveinfo.c
├── rtk
├── main.c
└── schedule.tt
└── win32
├── ebox
└── ebox.c
├── eepromtool
└── eepromtool.c
├── firm_update
└── firm_update.c
├── red_test
└── red_test.c
├── simple_test
└── simple_test.c
└── slaveinfo
└── slaveinfo.c
/.gitignore:
--------------------------------------------------------------------------------
1 | .ccls-cache
2 | compile_commands.json
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "soem/soem"]
2 | path = soem/soem
3 | url = https://github.com/OpenEtherCATsociety/SOEM.git
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SOEM Interface
2 |
3 | ## Overview
4 | This software package serves as a C++ interface for one or more EtherCAT devices running on the same bus.
5 | The lower level EtherCAT communication is handled by the [SOEM](https://github.com/OpenEtherCATsociety/soem) library.
6 |
7 | The soem_interface has been developed on Ubuntu 18.04 LTS with ROS Melodic.
8 |
9 | The source code is released under the GPLv3 license.
10 | A copy of the license is available in the *COPYING* file.
11 |
12 | **Author:** Markus Staeuble
13 |
14 | **Affiliation:** Robotic Systems Lab - ETH Zurich
15 |
16 | **Maintainer:** Johannes Pankert, johannes.pankert@mavt.ethz.ch
17 |
18 | **Contributors:** Johannes Pankert, Jonas Junger, Lennart Nachtigall
19 |
20 |
21 | ## Installation
22 |
23 | ### Dependencies
24 | #### Catkin Packages
25 |
26 | | Repo | url | license | content |
27 | |:--------------:|:----------------------------------------------------:|:------------:|:------------------:|
28 | | message_logger | https://github.com/leggedrobotics/message_logger.git | BSD 3-Clause | simple log streams |
29 |
30 | #### System Dependencies (Ubuntu 18.04 LTS)
31 | - [ROS Melodic](https://wiki.ros.org/melodic) (full installation)
32 | - [catkin](https://wiki.ros.org/catkin)
33 |
34 | ### Building from Source
35 |
36 | To build the library from source, clone the latest version from this repository into your catkin workspace and compile the package using
37 |
38 | cd catkin_workspace/src
39 | git clone https://github.com/leggedrobotics/message_logger.git
40 | git clone https://github.com/leggedrobotics/soem_interface.git
41 | cd ../
42 | catkin build soem_interface
43 |
44 | To build the examples, execute the following command inside of your catkin workspace:
45 |
46 | catkin build soem_interface_examples
47 |
48 | ## Classes
49 |
50 | #### EthercatSlaveBase
51 | This is an abstract base class for an ethercat slave. The ethercat slave class holds a non owning reference to the EthercatBusBase it is on (bus_).
52 | EthercatSlaves should stage their tx messages before writing to the ethercat bus in the updateWrite() method using the bus_ writeRxPdo() method.
53 | Similarly, the slaves can retrieve the buffered read messages from the bus with the readTxPdo() method in updateRead().
54 |
55 | #### EthercatBusBase
56 | This class represents a physical ethercat bus containing multiple ethercat slaves.
57 | It manages the slaves on the bus using the methods from soem. With updateRead() and updatewrite() the staged slave messages are written/read to/from all the slaves on the bus simultaneously.
58 | EthercatSlaves can be added with addSlave(). After all the slaves have been added the startup() method to actually start the communication of the bus.
59 |
60 | #### EthercatBusManagerBase
61 | If multiple buses are connected to the same master then the buses are managed by the EthercatBusManagerBase.
62 |
63 | ## Note
64 | Due to the current pandemic we could not test this version of the soem_interface.
65 |
66 | Tests will be conducted as soon as possible.
67 |
68 |
--------------------------------------------------------------------------------
/jenkins-pipeline:
--------------------------------------------------------------------------------
1 | library 'continuous_integration_pipeline'
2 | ciPipeline("")
--------------------------------------------------------------------------------
/soem_interface_examples/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
2 | # Markus Staeuble, Jonas Junger, Johannes Pankert, Philipp Leemann,
3 | # Tom Lankhorst, Samuel Bachmann, Gabriel Hottiger, Lennert Nachtigall,
4 | # Mario Mauerer, Remo Diethelm
5 | #
6 | # This file is part of the soem_interface_rsl.
7 | #
8 | # The soem_interface_rsl is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU General Public License as published by
10 | # the Free Software Foundation, either version 3 of the License, or
11 | # (at your option) any later version.
12 | #
13 | # The seom_interface is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU General Public License
19 | # along with the soem_interface_rsl. If not, see .
20 |
21 | cmake_minimum_required(VERSION 2.8.3)
22 | project(soem_interface_examples)
23 |
24 | add_definitions(-std=c++14 -Wall -Werror)
25 | add_definitions(-DMELO_USE_COUT)
26 |
27 | set(PACKAGE_DEPENDENCIES
28 | message_logger
29 | soem_rsl
30 | soem_interface_rsl
31 | )
32 |
33 | find_package(catkin REQUIRED
34 | COMPONENTS
35 | ${PACKAGE_DEPENDENCIES}
36 | )
37 |
38 | catkin_package(
39 | INCLUDE_DIRS
40 | include
41 | LIBRARIES
42 | ${PROJECT_NAME}
43 | CATKIN_DEPENDS
44 | ${PACKAGE_DEPENDENCIES}
45 | )
46 |
47 | include_directories(
48 | include
49 | ${catkin_INCLUDE_DIRS}
50 | )
51 |
52 | add_library(
53 | ${PROJECT_NAME}
54 | src/${PROJECT_NAME}/ExampleSlave.cpp
55 | )
56 | add_dependencies(
57 | ${PROJECT_NAME}
58 | ${catkin_EXPORTED_TARGETS}
59 | )
60 | target_link_libraries(
61 | ${PROJECT_NAME}
62 | ${catkin_LIBRARIES}
63 | )
64 |
65 | add_executable(
66 | ${PROJECT_NAME}_1
67 | src/example_slave.cpp
68 | )
69 | add_dependencies(
70 | ${PROJECT_NAME}_1
71 | ${PROJECT_NAME}
72 | ${catkin_EXPORTED_TARGETS}
73 | )
74 | target_link_libraries(
75 | ${PROJECT_NAME}_1
76 | ${PROJECT_NAME}
77 | ${catkin_LIBRARIES}
78 | )
79 |
80 | install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_1
81 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
82 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
83 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
84 | )
85 | install(DIRECTORY include/${PROJECT_NAME}/
86 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
87 | )
88 |
--------------------------------------------------------------------------------
/soem_interface_examples/include/soem_interface_examples/ExampleSlave.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
3 | ** Markus Staeuble, Jonas Junger, Johannes Pankert, Philipp Leemann,
4 | ** Tom Lankhorst, Samuel Bachmann, Gabriel Hottiger, Lennert Nachtigall,
5 | ** Mario Mauerer, Remo Diethelm
6 | **
7 | ** This file is part of the soem_interface_rsl.
8 | **
9 | ** The soem_interface_rsl is free software: you can redistribute it and/or modify
10 | ** it under the terms of the GNU General Public License as published by
11 | ** the Free Software Foundation, either version 3 of the License, or
12 | ** (at your option) any later version.
13 | **
14 | ** The seom_interface is distributed in the hope that it will be useful,
15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ** 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 soem_interface_rsl. If not, see .
21 | */
22 |
23 | #pragma once
24 |
25 | #include
26 | #include
27 |
28 | #define RX_PDO_ID 0x6000
29 | #define TX_PDO_ID 0x7000
30 |
31 | namespace soem_interface_examples {
32 |
33 | struct TxPdo {
34 | uint8_t state = 0;
35 | float data1 = 0.0;
36 | float data2 = 0.0;
37 | } __attribute__((packed));
38 |
39 | struct RxPdo {
40 | float command1 = 0.0;
41 | float command2 = 0.0;
42 | } __attribute__((packed));
43 |
44 | class ExampleSlave : public soem_interface_rsl::EthercatSlaveBase {
45 | public:
46 | ExampleSlave(const std::string& name, soem_interface_rsl::EthercatBusBase* bus, const uint32_t address);
47 | ~ExampleSlave() override = default;
48 |
49 | std::string getName() const override { return name_; }
50 |
51 | bool startup() override;
52 | void updateRead() override;
53 | void updateWrite() override;
54 | void shutdown() override;
55 |
56 | PdoInfo getCurrentPdoInfo() const override { return pdoInfo_; }
57 |
58 | private:
59 | const std::string name_;
60 | PdoInfo pdoInfo_;
61 | TxPdo reading_;
62 | RxPdo command_;
63 | };
64 |
65 | } // namespace soem_interface_examples
66 |
--------------------------------------------------------------------------------
/soem_interface_examples/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
4 | Markus Staeuble, Jonas Junger, Johannes Pankert, Philipp Leemann,
5 | Tom Lankhorst, Samuel Bachmann, Gabriel Hottiger, Lennert Nachtigall,
6 | Mario Mauerer, Remo Diethelm
7 |
8 | This file is part of the soem_interface_rsl.
9 |
10 | The soem_interface_rsl is free software: you can redistribute it and/or modify
11 | it under the terms of the GNU General Public License as published by
12 | the Free Software Foundation, either version 3 of the License, or
13 | (at your option) any later version.
14 |
15 | The seom_interface is distributed in the hope that it will be useful,
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 | GNU General Public License for more details.
19 |
20 | You should have received a copy of the GNU General Public License
21 | along with the soem_interface_rsl. If not, see
22 | .
23 | <-->
24 |
25 |
26 | soem_interface_examples
27 | 0.4.0
28 | Examples on how to use the soem_interface_rsl package.
29 |
30 | GPLv3
31 |
32 | Markus Staeuble
33 | Jonas Junger
34 | Johannes Pankert
35 | Lennart Nachtigall
36 |
37 | Johannes Pankert
38 |
39 | catkin
40 | message_logger
41 | soem_rsl
42 | soem_interface_rsl
43 |
44 |
45 |
--------------------------------------------------------------------------------
/soem_interface_examples/src/example_slave.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
3 | ** Markus Staeuble, Jonas Junger, Johannes Pankert, Philipp Leemann,
4 | ** Tom Lankhorst, Samuel Bachmann, Gabriel Hottiger, Lennert Nachtigall,
5 | ** Mario Mauerer, Remo Diethelm
6 | **
7 | ** This file is part of the soem_interface_rsl.
8 | **
9 | ** The soem_interface_rsl is free software: you can redistribute it and/or modify
10 | ** it under the terms of the GNU General Public License as published by
11 | ** the Free Software Foundation, either version 3 of the License, or
12 | ** (at your option) any later version.
13 | **
14 | ** The seom_interface is distributed in the hope that it will be useful,
15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ** 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 soem_interface_rsl. If not, see .
21 | */
22 |
23 | #include
24 | #include
25 |
26 | // This shows a minimal example on how to use the soem_interface_rsl library.
27 | // Keep in mind that this is non-working example code, with only minimal error handling
28 |
29 | int main(int argc, char** argv) {
30 | const std::string busName = "eth1";
31 | const std::string slaveName = "ExampleSlave";
32 | const uint32_t slaveAddress = 0;
33 |
34 | std::unique_ptr bus = std::make_unique(busName);
35 |
36 | std::shared_ptr slave =
37 | std::make_shared(slaveName, bus.get(), slaveAddress);
38 |
39 | bus->addSlave(slave);
40 | bus->startup();
41 | bus->setState(EC_STATE_OPERATIONAL);
42 |
43 | if (!bus->waitForState(EC_STATE_OPERATIONAL, slaveAddress)) {
44 | // Something is wrong
45 | return 1;
46 | }
47 |
48 | while (true) {
49 | bus->updateRead();
50 | bus->updateWrite();
51 | }
52 |
53 | bus->shutdown();
54 | return 0;
55 | }
56 |
--------------------------------------------------------------------------------
/soem_interface_examples/src/soem_interface_examples/ExampleSlave.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
3 | ** Markus Staeuble, Jonas Junger, Johannes Pankert, Philipp Leemann,
4 | ** Tom Lankhorst, Samuel Bachmann, Gabriel Hottiger, Lennert Nachtigall,
5 | ** Mario Mauerer, Remo Diethelm
6 | **
7 | ** This file is part of the soem_interface_rsl.
8 | **
9 | ** The soem_interface_rsl is free software: you can redistribute it and/or modify
10 | ** it under the terms of the GNU General Public License as published by
11 | ** the Free Software Foundation, either version 3 of the License, or
12 | ** (at your option) any later version.
13 | **
14 | ** The seom_interface is distributed in the hope that it will be useful,
15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ** 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 soem_interface_rsl. If not, see .
21 | */
22 |
23 | #include
24 |
25 | namespace soem_interface_examples {
26 |
27 | ExampleSlave::ExampleSlave(const std::string& name, soem_interface_rsl::EthercatBusBase* bus, const uint32_t address)
28 | : soem_interface_rsl::EthercatSlaveBase(bus, address), name_(name) {
29 | pdoInfo_.rxPdoId_ = RX_PDO_ID;
30 | pdoInfo_.txPdoId_ = TX_PDO_ID;
31 | pdoInfo_.rxPdoSize_ = sizeof(command_);
32 | pdoInfo_.txPdoSize_ = sizeof(reading_);
33 | pdoInfo_.moduleId_ = 0x00123456;
34 | }
35 |
36 | bool ExampleSlave::startup() {
37 | // Do nothing else
38 | return true;
39 | }
40 |
41 | void ExampleSlave::updateRead() {
42 | bus_->readTxPdo(address_, reading_);
43 | }
44 |
45 | void ExampleSlave::updateWrite() {
46 | bus_->writeRxPdo(address_, command_);
47 | }
48 |
49 | void ExampleSlave::shutdown() {
50 | // Do nothing
51 | }
52 |
53 | } // namespace soem_interface_examples
54 |
--------------------------------------------------------------------------------
/soem_interface_rsl/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
2 | # Markus Staeuble, Jonas Junger, Johannes Pankert, Philipp Leemann,
3 | # Tom Lankhorst, Samuel Bachmann, Gabriel Hottiger, Lennert Nachtigall,
4 | # Mario Mauerer, Remo Diethelm
5 | #
6 | # This file is part of the soem_interface_rsl.
7 | #
8 | # The soem_interface_rsl is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU General Public License as published by
10 | # the Free Software Foundation, either version 3 of the License, or
11 | # (at your option) any later version.
12 | #
13 | # The seom_interface is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU General Public License
19 | # along with the soem_interface_rsl. If not, see .
20 |
21 | cmake_minimum_required(VERSION 3.15)
22 | project(soem_interface_rsl)
23 |
24 | add_definitions(-std=c++17 -Wall -Werror)
25 | add_definitions(-DMELO_USE_COUT)
26 |
27 |
28 |
29 | set(PACKAGE_DEPENDENCIES
30 | message_logger
31 | soem_rsl
32 | )
33 |
34 | find_package(catkin REQUIRED
35 | COMPONENTS
36 | ${PACKAGE_DEPENDENCIES}
37 | )
38 |
39 | catkin_package(
40 | INCLUDE_DIRS
41 | include
42 | LIBRARIES
43 | ${PROJECT_NAME}
44 | CATKIN_DEPENDS
45 | ${PACKAGE_DEPENDENCIES}
46 | )
47 |
48 | include_directories(
49 | include
50 | ${catkin_INCLUDE_DIRS}
51 | )
52 |
53 | #this has to be a shared lib because we have to avoid symbol clashes with other (older) versions of SOEM which might exists in the workspace.
54 | # e.g. ros-noetic-soem package (used by BOTA, ANYbotics.)
55 | add_library(
56 | ${PROJECT_NAME} SHARED
57 | src/${PROJECT_NAME}/common/ThreadSleep.cpp
58 | src/${PROJECT_NAME}/common/Macros.cpp
59 | src/${PROJECT_NAME}/EthercatSlaveBase.cpp
60 | src/${PROJECT_NAME}/EthercatBusManagerBase.cpp
61 | src/${PROJECT_NAME}/EthercatBusBase.cpp
62 | )
63 |
64 | add_dependencies(
65 | ${PROJECT_NAME}
66 | ${catkin_EXPORTED_TARGETS}
67 | )
68 |
69 | # https://stackoverflow.com/questions/2222162/how-to-apply-fvisibility-option-to-symbols-in-static-libraries
70 | # special link option.
71 | # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL")
72 | # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--exclude-libs,ALL")
73 | target_link_options(${PROJECT_NAME} PRIVATE "-Wl,--exclude-libs,ALL")
74 |
75 | target_link_libraries(
76 | ${PROJECT_NAME}
77 | ${catkin_LIBRARIES}
78 | )
79 |
80 | #hide all symboles except the explicitly marked ones.
81 | set_target_properties(${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)
82 | set_target_properties(${PROJECT_NAME} PROPERTIES C_VISIBILITY_PRESET hidden)
83 |
84 | install(TARGETS ${PROJECT_NAME}
85 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
86 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
87 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
88 | )
89 | install(DIRECTORY include/${PROJECT_NAME}/
90 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
91 | )
92 |
--------------------------------------------------------------------------------
/soem_interface_rsl/include/soem_interface_rsl/EthercatBusManagerBase.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | ** Copyright (2019-2020) Robotics Systems Lab - ETH Zurich:
3 | ** Markus Staeuble, Jonas Junger, Johannes Pankert, Philipp Leemann,
4 | ** Tom Lankhorst, Samuel Bachmann, Gabriel Hottiger, Lennert Nachtigall,
5 | ** Mario Mauerer, Remo Diethelm
6 | **
7 | ** This file is part of the soem_interface_rsl.
8 | **
9 | ** The soem_interface_rsl is free software: you can redistribute it and/or modify
10 | ** it under the terms of the GNU General Public License as published by
11 | ** the Free Software Foundation, either version 3 of the License, or
12 | ** (at your option) any later version.
13 | **
14 | ** The seom_interface is distributed in the hope that it will be useful,
15 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ** 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 soem_interface_rsl. If not, see .
21 | */
22 |
23 | #pragma once
24 |
25 | // std
26 | #include