orocos / soem

ROS package wrapping the Simple Open EtherCAT Master (SOEM) from https://github.com/OpenEtherCATsociety/SOEM

Home Page:http://wiki.ros.org/soem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue when soem run with rospackage

junhyeokahn opened this issue · comments

Hi,
I am currently using ros kinetic with ubuntu 16.04.
Thanks to your open source policy, I could download and run your example code slaveinfo.c.
When I testing with 7 slaves, it works well.
However, when I copy the code and generate a ros package, it behaves differently.
The different part happens in the following part of the code.

ec_statecheck(0, EC_STATE_SAFE_OP, EC_TIMEOUTSTATE * 3);
if (ec_slave[0].state != EC_STATE_SAFE_OP )                                                                                                                                                        
{
      printf("Not all slaves reached safe operational state.\n");                                                                                                                                     
      ec_readstate();                                                                                                                                                                                 
      for(i = 1; i<=ec_slavecount ; i++)                                                                                                                                                              
      {                                                                                                                                                                                               
           if(ec_slave[i].state != EC_STATE_SAFE_OP)                                                                                                                                                    
           {                                                                                                                                                                                            
               printf("Slave %d State=%2x StatusCode=%4x : %s\n",                                                                                                                                        
                         i, ec_slave[i].state, ec_slave[i].ALstatuscode, 
                         ec_ALstatuscode2string(ec_slave[i].ALstatuscode));                                                                                     
            }                                                                                                                                                                                            
      }                                                                                                                                                                                               
}

When I run the code with ros, ec_slave[0].state is not equals to EC_STATE_SAFE_OP, so it goes into if statement. The print out message looks like

Slave 1 State= 12 StatusCode = 1e : Invalid input configuration

or

Slave 1 State= 12 StatusCode = 1d : Invalid output configuration

One more thing I notice is that when I use small number of slaves (e.g. 3 instead of 7), ec_slave[0].state equals to EC_STATE_SAFE_OP.

However, without using ros package, ec_slave[0].state is always equals to EC_STATE_SAFE_OP.
Is there any problem when I try to bind soem to ros package?

this might be related to #14

Without showing your ROS source code part, there is no way to tell if there is something wrong. Obviously, there could be problems :-). But where, I'm not sure. I only have two slaves that I can use, so I won't be able to help debugging. But if you want some help, please share the minimal working and not working examples so that someone else might be able to tap in...

Also, please state which HW you are using...

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

This issue has been automatically closed because no further activity occured. If you feel this is still relevant, please feel free to reopen.