Running the driver
Contents
Before running the driver for the first time
Follow the ROS and ronex code installation instructions.
- Add the definition of the environment variable ETHERCAT_PORT to your .bashrc file. Its value must be the name of the ethernet interface where the etherCAT hardware will be connected. If the variable is not defined, eth0 will be used by default.
1 > echo "export ETHERCAT_PORT=eth1" >> ~/.bashrc
Connection of the hardware devices
Follow the instructions in the "RoNeX User Manual" about the interconnection of the HW elements.
Starting the driver
Roscore
Before you do anything in ROS, you must run roscore.
1 > roscore
wait until it says:
1 started core service [/rosout]
Driver
Once roscore is running, you can start the Shadow EtherCAT I/O driver. There is no need to run different drivers for each of the modules. The driver will automatically detect the modules connected to the bridge.
The driver must be run with superuser privileges, as it needs to have full access to the ethernet port. Initially we will use a launchfile that doesn't start any controller, only the driver.
You should see two devices detected (if you have one I/O module connected) e.g.:
The first device is the bridge, and the second is the module.
Checking that the driver is running
To check that the driver is running correctly and getting information from the I/O module we can list the topics being published that belong to one of these modules.
1 > rostopic list | grep device_0x
We can take one of the input topics to make sure that it is publishing the values from the device. The first number in the name of the topic is the etherCAT Product Code and the second one is the Serial Number of the device. Adapt the following command to fit the name of the existing topic.
1 > rostopic echo /device_0x05300424_0x00000016_analog_inputs_state
We should now be able to see the values which means that the communication with the device is correct.