Giter Site home page Giter Site logo

mikekaram / ether_ros Goto Github PK

View Code? Open in Web Editor NEW
34.0 2.0 16.0 167.12 MB

Middle-ware program that interconnects the EtherLab Master Module API for the EtherCAT protocol, with the ROS environment, having real-time capabilities.

Home Page: https://ighmaster-userspace-program-in-ros.readthedocs.io/en/latest/

CMake 2.47% C 21.84% C++ 35.59% Shell 12.09% Python 15.39% Makefile 0.59% MATLAB 12.04%
real-time robotics ethercat preempt-rt ros ros-kinetic middleware etherlab-master igh-ethercat-master etherlab

ether_ros's Introduction

Welcome to the EtherROS program tutorial by Mike Karamousadakis

For any questions, send email to: mkaramousadakis @ zoho.eu

For a full documentation, licence and other information, visit the following ReadTheDocs link.

In the tutorial we assume that an Ubuntu flavor 16.04 is used.

Installation process

SUPER SOS : The following manual will be extremely helpful for understanding the instructions given in this section. You should definitely read it before procceding. Link.

0. Preempt_RT Patch

First step to utilize the repository given, is to install the preempt_rt patch in the kernel. Note that in order to install EtherLab, the kernel should be up to 4.9. A proper guide for the installation procedure can be found in the following link.

Note: If there is a problem in the compilation of the kernel, these extra packages may come in handy: libssl-dev build-essential git flex bison

After you patch the kernel (say 4.9), you will want to use some other configuration parameters in the build of the kernel. Therefore after step 3 and in the line of make menuconfig of the previous link, you will want to specify some extra configuration parameters, derived from the chapter 3 of the manual mentioned in the beginning, namely:

  • CONFIG_PREEMPT_RT_FULL

  • CONFIG_CPU_FREQ=n

  • CONFIG_CPU_IDLE=n

  • CONFIG_NO_HZ_FULL=y

  • CONFIG_RCU_NOCB_CPU=y

The author has used only the first configuration parameter and has seen great boost in the performance of the real-time tasks specified. Future work requires more tweaks to be done, derived from the afore mentioned manual.

Tip: While you are in the menuconfig, type "/" and you can type to find the place of a configuration parameter. Exit with ESC

1. Installation of EtherLab

  1. cd into the etherlab folder
  2. Run the script install_etherlab_patched.sh. Note that root access is needed. If you use another native driver from e1000e, open the Makefile and change the configure option with your driver version. You can find here and here (Chapter 9), the supported hardware and the options the command configure takes, respectively. If your hardware is not supported or if you don't want the native driver support fuzz, then you should change the configure command to enable generic driver support (although I think it defaults to that).

2. Run the scripts

  1. Because we want to have a process in realtime context, we should change it's priority (done in the code -FIFO policy, 80 priority-). Besides that, the interrupt handler which handles the interrupts generated by the network driver, should have higher priority than the process we develop, so that the EtherCAT datagrams are ready to be sent/received before we process them. For that cause I have written a script, as a sample script, to change the priority of the irq process of the network card.This should be used accordingly to change your process's priority. You could check if the priority has changed with the chrt command. How-to can be found here.

  2. Aside from the enhancements proposed by the manual, we should also change the throttling of our network driver to 0. This is done in the script scripts/optimizations/reinstall_e1000e_wo_throttling.sh. It is based on my e1000e driver, so use it as a sample script. Documentation for the insertion of the module of the e1000e network driver can be found here.

  3. Run the script for changing the permissions of ether_ros. We set the suid of ether_ros to be root, so that the ether_ros can be launched without sudo. This will be useful after you catkin_make the project.

Example usage

  1. Before running the program, you could restart the ethercat service (the EtherLab Master). To do that, run the following command:
$ sudo /etc/init.d/ethercat restart

The kernel logs can be very useful, because they show what is happening to EtherLab every time, how many packets he has skipped etc. To see the kernel logs, run the command:

$ tail -f /var/log/kern.log
  1. After you catkin_make the project, in one terminal run:
$ roslaunch ether_ros ether_ros.launch
  1. After that, and while the process is running, you run in another terminal:
$ rosrun ether_ros ethercat_keyboard_controller.py
  1. Now you can give orders to the EtherCAT Communicator via a custom terminal. Have fun!
  • Tip: You could run a bash script in the custom terminal by running:
[ethercat_controller] > !run my_awesome_bash_script.sh

Note that your script must be under the scripts directory. You could also check some example scripts there.

ether_ros's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ether_ros's Issues

Issue running

Hi I'm trying to install etherlab by following your steps:
Run the script install_etherlab_patched.sh.

and I do so by running:
$ sudo ./install_etherlab_patched.sh
from the directory:
~/catkin_ws/src/ether_ros/etherlab

One of the errors that I got was this:
checking for kernel for e1000e driver... configure: error: kernel 4.9 not available for e1000e driver!

That ultimately showed this (or I guess that was the reason):
make[1]: *** No rule to make target 'all'. Stop.
make[1]: Leaving directory '/home/bioroboticslabros/catkin_ws/src/ether_ros/etherlab/ethercat-1.5.2-merc'
Makefile:13: recipe for target 'ethercatMaster' failed
make: *** [ethercatMaster] Error 2

I'm using ubuntu 16.04 with the RT patched 4.9 kernel.

Any advice or help will be greatly appreciated.

Ivan

Failed to register PDO entry: No such file or directory

hello
I have installed igh and everything. When I run roslaunch ether_ ros ether_ Ros. launch, which is an error

[ INFO] [1668064005.140446679]: Got param: slave_root_loc + input_port = 6010
[ INFO] [1668064005.140915152]: Got param: slave_root_loc + output_port = 7000
Failed to register PDO entry: No such file or directory
[FATAL] [1668064005.140979906]: Failed to configure pdo out.
[ether_comm-2] process has died [pid 2643, exit code 1, cmd /home/b/igh/ROS/ether_ros_1109/devel/lib/ether_ros/ether_ros __name:=ether_comm __log:=/home/b/.ros/log/3bc2297c-60c6-11ed-bc35-35dde927bbf0/ether_comm-2.log].
log file: /home/b/.ros/log/3bc2297c-60c6-11ed-bc35-35dde927bbf0/ether_comm-2*.log

I know that the data in the official igh routine is not put into your package, such as the following data.
Because I don't know how to put these PDO code and SDO into your pack?

#define estun 0x000116c7,0x003e0402
ec_pdo_entry_reg_t domainServoOutput_regs[] = {
{estun_Pos0, estun, 0x6040, 0x00, &cntlwd, NULL},
{estun_Pos0, estun, 0x607a, 0x00, &ipData, NULL},
{estun_Pos0, estun, 0x6060, 0x00, &modes_of_operation, NULL},
{}
};
ec_pdo_entry_reg_t domainServoInput_regs[] = {
{estun_Pos0, estun, 0x6064, 0x00, &actpos, NULL},
{estun_Pos0, estun, 0x6041, 0x00, &status, NULL},
{estun_Pos0, estun, 0x6061, 0x00, &modes_of_operation_display, NULL},
{estun_Pos0, estun, 0x603f, 0x00, &error_code, NULL},
{}
};
ec_pdo_entry_info_t estun_pdo_entries[] = {
{0x6040, 0x00, 16}, /* Controlword /
{0x6060, 0x00, 8}, /
Modes of operation /
{0x607a, 0x00, 32}, /
Target position /
{0x60b8, 0x00, 16}, /
Touch probe function /
{0x603f, 0x00, 16}, /
Error code /
{0x6041, 0x00, 16}, /
Statusword /
{0x6061, 0x00, 8}, /
Modes of operation display /
{0x6064, 0x00, 32}, /
Position actual value /
{0x60b9, 0x00, 16}, /
Touch probe status /
{0x60ba, 0x00, 32}, /
Touch probe pos1 pos value /
{0x60f4, 0x00, 32}, /
Following error actual value /
{0x60fd, 0x00, 32}, /
Digital inputs */
};

ec_pdo_info_t estun_pdos[] = {
{0x1600, 4, estun_pdo_entries + 0}, /* Receive PDO mapping 1 /
{0x1a00, 8, estun_pdo_entries + 4}, /
Transmit PDO mapping 1 */
};

ec_sync_info_t estun_syncs[] = {
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
{2, EC_DIR_OUTPUT, 1, estun_pdos + 0, EC_WD_ENABLE},
{3, EC_DIR_INPUT, 1, estun_pdos + 1, EC_WD_DISABLE},
{0xff}
};

Can you tell me where to put it? How?

very thanks

Some doubts?

can run in the kernel 4.15?
can you give same example about control slave such like mapping pdo etc?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.