ICube-Robotics / ethercat_driver_ros2

Hardware Interface for EtherCAT module integration with ros2_control
https://icube-robotics.github.io/ethercat_driver_ros2/
Apache License 2.0
125 stars 32 forks source link

Update Docker file/README #104

Open bhaktasn opened 5 months ago

bhaktasn commented 5 months ago

Docker container doesn't allow user access to /etc/init.d/ethercat so there is no clear way to test.

Either README should include additional commands on how to test, or dockerfile/docker run command needs to be updated.

Messing with it on my own right now but would be great to hear if anyone has had any luck with this. Cheers!

PieterjanCottignies commented 5 months ago

I mounted the /usr/local/etherlab dir from the host os into the container through the compose file:

volumes:
 - /usr/local/etherlab:/usr/local/etherlab
 - ... other volumes

After this I ran the linking commands from the install page:

sudo ln -s /usr/local/etherlab/bin/ethercat /usr/bin/
sudo ln -s /usr/local/etherlab/etc/init.d/ethercat /etc/init.d/ethercat
sudo mkdir -p /etc/sysconfig
sudo cp /usr/local/etherlab/etc/sysconfig/ethercat /etc/sysconfig/ethercat

Then i was able to use the ethercat commands such as ethercat slaves inside the docker container.

Hope this helps