Giter Site home page Giter Site logo

ros_ethercat's Introduction

ros_ethercat

CI Statuses

Check Status
Build
Style
Code Coverage

Overview

This is a reimplementation of the main loop of pr2_ethercat without dependencies on PR2 software. It was mainly developed to be used by Shadow Robot Company. It may be useful to anyone people that has developed ROS software for their own robot and used etherCAT for communication. Most likely such software would be based on the software for Willow Garage's PR2. ros_ethercat reuses existing etherCAT drivers (eml package) and instantiates a ros_control controller manager. Part of the software in this repository comes from repositories pr2_mechanism, pr2_robot, pr2_ethercat_drivers. The parts specific to the pr2 robot only have been removed. Therefore, the same license (BSD) has been used.

pr2 packages no longer required

  1. ethercat_hardware
  2. pr2_bringup
  3. pr2_ethercat
  4. pr2_mechanism
  5. pr2_controller_interface
  6. pr2_controller_manager
  7. pr2_hardware_interface
  8. pr2_mechanism_diagnostics
  9. pr2_mechanism_model

You can find the architecture diagram below for a closer look at how this works.

Architecture Diagram

Compatibility

In software with previous pr2 dependencies that is switched to this package, the following modifications are required.

Controllers

  1. #include <controller_interface/controller.h>
    instead of
    #include <pr2_controller_interface/controller.h>
  2. class MyController : public controller_interface::Controller<ros_ethercat_mechanism_model::RobotState>
    instead of
    class MyController : public pr2_controller_interface::Controller
  3. Controller's update function should be declared as
    virtual void update(const ros::Time&, const ros::Duration&)
    and starting function as
    virtual void starting(const ros::Time& time),br.
  4. controller_manager and controller_interface should be used as dependencies in CMakeLists.txt and package.xml files instead of pr2_controller_manager and pr2_controller_interface respectively.
  5. In package.xml file in export tag use <controller_interface plugin="${prefix}/controller_plugins.xml"/>
  6. In controller_plugins.xml file use base_class_type="controller_interface::ControllerBase" />

launch files

  1. Replace pr2_ethercat with ros_ethercat_loop in launch files
  2. Since pr2_controller_manager is no longer used, joint_states or mechanism_statistics are no longer published by it. Joint states are now published with the join_state_controller from ros_controllers. To start this controller this line need to be added in the main launch file
    <include file="$(find ros_ethercat_model)/launch/joint_state_publisher.launch"/>
  3. calibrate.py file from pr2_bringup is now included in ros_ethercat_model package and renamed to just calibrate according to ROS convention. Launch files that execute calibrate.py should be modified to find it there.

transmissions

Transmissions are still defined in urdf in the pr2 style and inherit from ros_ethercat_model::Transmission. This class will initialize the actuators associated with this transmission.

New features

  1. ros_ethercat accepts a new argument --period which is the period of main ethercat loop in msec. If not given the default value is 1ms.
  2. There is a helper bash script called ethercat_grant. This will grant to the ros_ethercat_loop executable the ability to be ran from a normal user without root privileges. E.g. of use
    rosrun ros_ethercat_loop ethercat_grant

ros_ethercat's People

Contributors

andriypt avatar bdenoun avatar carebare47 avatar dg-shadow avatar ethanfowler avatar giusebar avatar guihomework avatar maxzieba avatar mikramarc avatar mykolasjuraitis avatar rhaschke avatar rnzenha-s avatar toivos avatar toliver avatar ugocupcic avatar v4hn avatar

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ros_ethercat's Issues

multiple ethercat ports per loop

modify the loop in main.cpp in ros_ethercat_loop to initialize and communicate with multiple Ethernet ports on the same PC with EtherCAT devices connected to them. The expected behaviour should be similar to previously tested systems with EtherCAT switches but now a switch wouldn't be needed. Argument that specifies the port may have space separated values e.g. "eth0 eth3". Thus it will be backwards compatible with existing configuration files with only one port e.g. "eth0"

communicate servo with Ros through EtherCAT

I am student and i want to build my own robot arm. I have finished my robot urdf file and MoveIt! setup. Now I have bought Panasonic Servo and motor(MINAS A5B EtherCAT servo drives). But i can't communicate servo with Ros and don't know which package i can use. Should i use ros_control package? Can anyone guide me?

Any hints would be appreciated!

Implement and test JointCommandInterfaces

Add variables command_position_ command_velocity_ in ros_ethercat_model/joint.hpp alongside command_effort_. Properly register them with appropriate interfaces. Link these variables with command variable in sr_mechanism_controllers.

[ros_ethercat_loop] RPATH issues when using ethercat_grant on bionic

the bug is related to shadow-robot/ethercat_grant#4 when one starts the driver on bionic, some libs are not found through the RUNPATH.

process[sr_hand_robot-3]: started with pid [256937]
catkin_ws_shadow/devel/lib/ros_ethercat_loop/ros_ethercat_loop: error while loading shared libraries: librosconsole_bridge.so: cannot open shared object file: No such file or directory
[sr_hand_robot-3] process has died [pid 256937, exit code 127, cmd ethercat_grant catkin_ws_shadow/devel/lib/ros_ethercat_loop/ros_ethercat_loop -i ethercat2 -r robot_description __name:=sr_hand_robot 

to fix this issue one can add the linker flag --disable-new-dtags to use the old RPATH but the problem is explicitly a dependency of dependency (rosconsole_bridge is a dependency of liburdfdom which itself does not have use RPATH)

LD_DEBUG=files ldd catkin_ws_shadow/devel/lib/ros_ethercat_loop/ros_ethercat_loop 
 266364:	file=librosconsole_bridge.so [0];  needed by /opt/ros/melodic/lib/liburdf.so [0]

so the trick is to explicitly request ros_ethercat_loop to use librosconsole_bridge itself and then find it via its own RPATH

a PR with these two patches will be provided

Fix crash when error scanning ethercat slaves

If the function exits here:

https://github.com/shadow-robot/ros_ethercat/blob/indigo-devel/ros_ethercat_eml/src/ethercat_AL.cxx#L116

then m_slave_handler pointed object is not instantiated here:

https://github.com/shadow-robot/ros_ethercat/blob/indigo-devel/ros_ethercat_eml/src/ethercat_AL.cxx#L121

And generates a segfault with malloc.c: No such file or directory when the destructor tries to delete it here:

https://github.com/shadow-robot/ros_ethercat/blob/indigo-devel/ros_ethercat_eml/src/ethercat_AL.cxx#L72

Probably we should check if (m_slave_handler) before deleting?

missing install directives from CMakeLists.txt

in ros_ethercat/ros_ethercat_model/CMakeLists.txt only the files in the include folder are installed.
Add directives to also install the contents of launch and src folders.
The other 3 packages seem to install correctly.

kinetic release?

can you release this into kinetic? we're planning to release pr2 package into kinetic and some of our package depends on ros_ethercat_emi

Thanks.

Add functionality to CustomHW

In ros_ethercat_model/hardware_interface.hpp modify CustomHW class with empty read and write functions with time stamp e.g.

void read(const ros::Time& time) {}

update doxygen comments

separate hardware read and write

There is a function void EthercatHardware::update(bool reset, bool halt) that does both read and write in Ethercat. The real-time loop should be:

while(true) {
read from sensors
update controllers
write to actuators
wait until 1 msec has passed
}

But what happens instead is

while(true) {
read from sensors
write to actuators
update controllers
wait until 1 msec has passed
}

That means when a discrete-time PID controller is tuned it must assume a sample-period of 1msec and a latency of 1msec. That's because the controller action calculated for current sensor readings will actually be applied in the next iteration. That means the tuning has to be less aggressive (less responsive control) compared to almost zero latency. Split the EthercatHardware::update to read and write function.

'Motor halted' ERROR in the Diagnostic Viewer

Hello,

I've seen that the Diagnostic viewer is complaining about one error in the motors.

By now I don't detect nothing wrong in the funcionality of the hand but this error shouldn't be there.

For this reason there are two possible solutions in my opinion:

Detect where the error is coming from and try to fix it.

Remove this line from the Diagnostic Viewer in order to avoid any fear or confusion with the client.

Regards,

different rates per device

modify the loop in main.cpp in ros_ethercat_loop so that each Ethercat Device may have different sampling rates. Integer multiples should be adequate to keep things simple. A yaml file can define rates for the Devices that don't use the standard rate.

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.