Yann-<br><br>First of all, the code API for pr2_ethercat_drivers and pr2_etherCAT is not supported. We have documentation on the wiki and in the code FYI only. I strongly recommend that you don't make any changes to the code in that stack, since it may cause damage to your robot. <br>
<br>At startup, pr2_etherCAT detects all the slave devices, like WG005 and WG021 boards on the etherCAT chain. Then it loads an EthercatDevice plugin to communicate with each device. The plugin type is determine by the type that the device reports. "6805005" is a WG designation for a WG005 motor controller board, which controls most of the motors in a PR2. <br>
<br>You can look in the code of pr2_ethercat_drivers for more details.<br><br>Kevin<br><br><div class="gmail_quote">On Mon, Feb 7, 2011 at 6:17 AM, Yann Sionneau <span dir="ltr"><<a href="mailto:yann.sionneau@telecom-sudparis.eu">yann.sionneau@telecom-sudparis.eu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello,<br>
<br>
I wonder how the binding is done between the different EtherCAT devices<br>
and the actual C++ class of the device.<br>
<br>
I've found it's been implemented as plugins, but I don't understand how<br>
it works though.<br>
<br>
For example in<br>
ros/cturtle/stacks/pr2_ethercat_drivers/ethercat_hardware/src/wg0x.cpp<br>
there is :<br>
<br>
PLUGINLIB_REGISTER_CLASS(6805005, WG05, EthercatDevice);<br>
<br>
Here the WG05 is a C++ class that extends the EthercatDevice class.<br>
<br>
And in<br>
ros/cturtle/stacks/pr2_ethercat_drivers/ethercat_hardware/ethercat_device_plugin.xml<br>
there is :<br>
<br>
<class name="6805005" type="WG05" base_class_type="EthercatDevice"><br>
<br>
So there seem to be a link between the number 6805005 (btw what is this<br>
number ?) and the class WG05 but I don't understand exactly how all of<br>
this work.<br>
<br>
Regarding the documentation I found there<br>
(<a href="http://www.ros.org/wiki/pluginlib" target="_blank">http://www.ros.org/wiki/pluginlib</a>) the first argument of<br>
PLUGINLIB_REGISTER_CLASS should be the name of the class ? or just some<br>
kind of a key ?<br>
<br>
Another question I have is : how does the discovery of all the devices<br>
in the Ethercat bus work ?<br>
<br>
How does ROS become aware of the fact that there are two devices of<br>
class WG05 and three of class WG021 for example ?<br>
<br>
I don't know if I am clear enough in my questions.<br>
<br>
Regards,<br>
<font color="#888888"><br>
--<br>
Yann Sionneau<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</font></blockquote></div><br>