[Bug 683] New: revision ethercat-demo

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=683

Summary: revision ethercat-demo
Product: OCL
Version: 1.8.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: Hardware
AssignedTo: orocos-dev [..] ...
ReportedBy: steven [dot] kauffmann [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Created an attachment (id=465)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=465)
Ethercat-demo patch

Hi,

I have updated the configuration database of the ethercat devices. Files that
are not used anymore are deleted. The EthercatIO component is updated with
extra documentation in the code.

It requires the IOcomponent::addDigitalInInterface function see this bug:
https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=679

The test application is working under gnulinux and xenomai, but under xenomai
I'm getting a segfault when closing the application.

Here is a bt of the program:

#0 0xb706613d in pthread_cancel () from /lib/i686/cmov/libpthread.so.0
#1 0xb70912d8 in rt_task_delete (task=0x949b24c) at
../../../../src/skins/native/task.c:215
#2 0xb7962d0c in RTT::OS::detail::rtos_task_delete_main (main_task=0x949b248)
at /root/SVN/rtt-1.8/src/os/xenomai/fosi_internal.cpp:147
#3 0xb7957a96 in ~MainThread (this=0x949b240) at
/root/SVN/rtt-1.8/src/os/MainThread.cpp:57
#4 0xb7957ebe in boost::checked_delete<RTT::OS::MainThread> (x=0x949b240) at
/usr/include/boost/checked_delete.hpp:34
#5 0xb7957ee0 in
boost::detail::sp_counted_impl_p<RTT::OS::MainThread>::dispose (this=0x949d830)
at /usr/include/boost/detail/sp_counted_impl.hpp:79
#6 0xb7eee508 in boost::detail::sp_counted_base::release (this=0x949d830) at
/usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:145
#7 0xb7eee542 in ~shared_count (this=0xbfa27170) at
/usr/include/boost/detail/shared_count.hpp:205
#8 0xb7957dfc in ~shared_ptr (this=0xbfa2716c) at
/usr/include/boost/shared_ptr.hpp:131
#9 0xb7957f2a in boost::shared_ptr<RTT::OS::ThreadInterface>::reset
(this=0xb7bb15e4) at /usr/include/boost/shared_ptr.hpp:288
#10 0xb7957a60 in RTT::OS::MainThread::Release () at
/root/SVN/rtt-1.8/src/os/MainThread.cpp:70
#11 0xb795ae7b in __os_exit () at /root/SVN/rtt-1.8/src/os/startstop.cpp:162
#12 0x0804912c in main (argc=1, argv=0xbfa272a4) at
/root/SVN/ocl-1.8/hardware/ethercat-demo/tests/main.cpp:11

Because orocos uses the native xenomai calls and eml the posix ones, the
ethercat-demo application links with both xenomai libs.

I tried to reproduce this error:
xenomai app that links with native and posix xenomai lib => no seg fault

xenomai app (native) + linking with eml => no seg fault

empty orocos main + linking with eml => seg fault

but the segfault only occurs if I use Orocos.

[Bug 683] revision ethercat-demo

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=683

--- Comment #4 from Steven Kauffmann <steven [dot] kauffmann [..] ...> 2009-11-10 10:47:12 ---
Created an attachment (id=552)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=552)
New ethercat patch

[Bug 683] revision ethercat-demo

https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=683

--- Comment #3 from Steven Kauffmann <steven [dot] kauffmann [..] ...> 2009-11-05 16:40:06 ---
(In reply to comment #2)
> (In reply to comment #0)
> > Created an attachment (id=465)
--> (https://www.fmtc.be/bugzilla/orocos/attachment.cgi?id=465) [details]
> > Ethercat-demo patch
> >
> > Hi,
> >
> > I have updated the configuration database of the ethercat devices. Files that
> > are not used anymore are deleted. The EthercatIO component is updated with extra
> > documentation in the code.
> >
> > It requires the IOcomponent::addDigitalInInterface function see this bug:
> > https://www.fmtc.be/bugzilla/orocos/show_bug.cgi?id=679
> >
> > The test application is working under gnulinux and xenomai, but under xenomai
>
> It's a huge patch. Could you clarify a bit (bullet list) what it
> changes/improves. Do you think that the ethercat-demo still belongs in a
> component repository (ie is it general enough) or should it belong in an
> application directory (ie is specific for a certain setup). Or is it half/half
> ?

* Added some new configurations in the slave database
* Deleted unused files
* modified CMakeFiles in order to build the demo correctly
* Added a config/findEML.cmake because the path to the EML installation
directory was hardcoded in a CMakeFile
* Other modifications needed because of interface changes or faults in the demo
example code

Looks like some extra modifications (nothing to do with ethercat) are slipped
into this patch. I will fix this and provide a new patch.

The demo is specific for a certain setup (depends on some ethercat modules).
The slave data base and EthercatDevice (digital in-out and analog in-out) files
are general.

Steven