Skip to content

Commit

Permalink
Replace embObjStrain w/ embObjFTSensor
Browse files Browse the repository at this point in the history
Now embObjFTSensor can handle also strain board, see robotology/icub-main#874
  • Loading branch information
Nicogene committed May 19, 2023
1 parent 2c6dfcc commit f89cd27
Show file tree
Hide file tree
Showing 107 changed files with 329 additions and 329 deletions.
2 changes: 1 addition & 1 deletion R1SN001/hardware/FT/cer_left_shoulder-ems5-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_left_arm-eb5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_left_arm-eb5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml" />
<xi:include href="../electronics/cer_left_shoulder-ems5-eln.xml" />
Expand Down
2 changes: 1 addition & 1 deletion R1SN001/hardware/FT/cer_right_shoulder-ems4-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_right_arm-eb4-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_right_arm-eb4-strain" type="embObjFTsensor">

<xi:include href="../../general.xml" />
<xi:include href="../electronics/cer_right_shoulder-ems4-eln.xml" />
Expand Down
2 changes: 1 addition & 1 deletion R1SN002/hardware/FT/cer_left_shoulder-ems5-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_left_arm-eb5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_left_arm-eb5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml" />
<xi:include href="../electronics/cer_left_shoulder-ems5-eln.xml" />
Expand Down
2 changes: 1 addition & 1 deletion R1SN002/hardware/FT/cer_right_shoulder-ems4-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_right_arm-eb4-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_right_arm-eb4-strain" type="embObjFTsensor">

<xi:include href="../../general.xml" />
<xi:include href="../electronics/cer_right_shoulder-ems4-eln.xml" />
Expand Down
2 changes: 1 addition & 1 deletion R1SN003/hardware/FT/cer_left_shoulder-ems5-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_left_arm-eb5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_left_arm-eb5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml" />
<xi:include href="../electronics/cer_left_shoulder-ems5-eln.xml" />
Expand Down
2 changes: 1 addition & 1 deletion R1SN003/hardware/FT/cer_right_shoulder-ems4-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_right_arm-eb4-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="cer_right_arm-eb4-strain" type="embObjFTsensor">

<xi:include href="../../general.xml" />
<xi:include href="../electronics/cer_right_shoulder-ems4-eln.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb7-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb7-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb8-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb8-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb9-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb9-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,87 @@

<!--
marco.accame: on 31 mar 2016
on 24 mar 2016 i had a chat with silvio.traversaro and other users of the inertial analog sensors and we defined a desired behaviour for the device.
the discussion originated the xml file for embObjInertials but also those (much simpler) for embObjMais and embObjStrain.
the discussion originated the xml file for embObjInertials but also those (much simpler) for embObjMais and embObjFTsensor.
the configuration should be general enough to allow future extensions and at the same time easy enough for managing code in three environment:
1. the C++ code inside the device embObjInertials.cpp ... parsing xml, build relevant data structures, publishing data in streaming, in rpc etc.
2. the code of those using the published data ... reading xyz plus timestamp, to be able to associate them to a given sensor ID which can be directly linked to the CAD.
3. the C code in the ETH board ... we need compact messaging from icub-main to the board, such as a list of can sensors, a list of sensors directly managed by the board
3. the C code in the ETH board ... we need compact messaging from icub-main to the board, such as a list of can sensors, a list of sensors directly managed by the board
plus their properties, etc ...
the description of the resulting tags is in file legenda.xml, which should be read alongside this document.
disclaimer: this is a "direction" not yet a decision. as such, it is subject to requests of changes before start of implementation
disclaimer: this is a "direction" not yet a decision. as such, it is subject to requests of changes before start of implementation
and to modifications during the implementation required to make things easier.
-->

<!--
VARIOUS NOTES:
(01) the place of this xml file could be in ... i would say: iCubGenova02/hardware/inertials
(02) the device is called embObjInertials and manages N xyz sensors all associated to a given ETH board. The name of device can be changed.
(04) The idea is that the device publishes data related to the N sensors in three formats:
a. a vector of N string identifiers for the sensor (id) which are unique in the robot and allow to associate the sensor to the CAD.
a. a vector of N string identifiers for the sensor (id) which are unique in the robot and allow to associate the sensor to the CAD.
the size of the vector gives also the number of sensors.
b. a vector of N timestamps (t), where the timestamp is expressed in micro-sec and is related to the acquisition time of the ETH board of a given triple (x, y, z).
c. a vector of N floating point triples (x, y, z), where a triple contains measures from an inertial sensor. the sensor can be an accel or gyros or
c. a vector of N floating point triples (x, y, z), where a triple contains measures from an inertial sensor. the sensor can be an accel or gyros or
whatever other 3-axis sensor one may want to use.
Data in vector<(id)> are invariant for the lifetime of the wrapper, thus can be read by rcp only once.
Data in vector<(x, y, z)> and vector<(t)> are time-variant and are streamed with the period of the wrapper. Silvio said something about data and metadata
and also that (x, y, z) are data and (t) can be expressed as metadata.
Data that is published is guaranteed to be the most recent. however, dat is refreshed with a rate assigned to the sensor which can be different from that
of the wrapper. For instance, teh period of the wrapper is typically 10 ms, but in SETTINGS/acquisitionRate we may use 50 ms, which is the rate at which each MTB CAN board
sends its readings.
(05) We need to put careful attention to make (x, y, z) consistent with (t).
sends its readings.
(05) We need to put careful attention to make (x, y, z) consistent with (t).
The device receives (x, y, z) and (t) one at a time at reception of a UDP packet, hence the vectors are refreshed by function embObjInertials::update() in a given
position pos. The device publishes the vectors with a different function embObjInertials::read() which is called asynchronously with respect to embObjInertials::update().
In order to maintain consistency, we must use one mutex which gives mutual exclusion to update() and read().
Moreover, the function read() must have two arguments and be embObjInertials::read(vector<t>& v1, vector<xyz>& v2), where vector v1 will be put in metadata, vector v2 in data.
-->

<!-- INSTRUCTIONS
the format of the xml file is common with mais and strain, hence we can use a single object which parses the file and gives back to the device all relevant information.
about the used syntax.
it is designed so that the groups are all in CAPITAL_LETTERS and the params are expressed in camelCaseNotation.
if we need a boolean we use true/false, if we need a number we use it, if we need to chose amongst a limited number of possibilities we use an enumVariableInCamelCase notation.
the strings are left free and are written without the "".
the parsing and the start of INERTIALS service is done as follows:
we read SETTINGS.enabledSensors as a vector<string> IDs of size N. we use these strings for publishing in yarp port as described by (04).a
then we build what is needed by the ETH board to init the sensors.
then we build what is needed by the ETH board to init the sensors.
for each id in vector<string> IDs, we get its (type, location) by searching inside PROPERTIES.SENSORS and we fill what is sent to the ETH board to verify and activate
its service. Then, it is built the vector of (x, y, z) and of (t) and it is asked to the ETH board to start tx of sensors with SETTINGS.acquisitionRate
there are some checks to be done: what in SETTINGS.enabledSensors must be also in PROPERTIES.SENSORS, so fare we cannot manage sensors which are local to the ET board.
with this syntax if for instance jorhabib wants to use a new gyro on the foot which is external what is required to do is:
- add a new column in PROPERTIES.SENSORS with (id = l_foot_2_10B13_extgyro, type = enumSnsrGyrMTBext, location = CAN2-12).
- add a new entry SETTINGS.enabledSensors with l_foot_2_10B13_extgyro.
the parsing and the start of STRAIN service is done as follows:
we read SETTINGS.enabledSensors as a vector<string> IDs of size N. N will be 1! we DONT publish these strings for publishing in yarp port as described by (04).a
then we build what is needed by the ETH board to init the sensor.
then we build what is needed by the ETH board to init the sensor.
for each id in vector<string> IDs, we get its (type = enumSnsrSTRAIN, location) by searching inside PROPERTIES.SENSORS and we fill what is sent to the ETH board to verify and activate
its service. Then, it is built the vector of (a1, a2, a3, a4, a5, a6) which is published in the YARP port.
we ask the fullscales if STRAIN_SETTINGS.useCalibration is true and then we ask to the ETH board to start tx of sensors with SETTINGS.acquisitionRate.
For the MAIS service it is as with STRAIN but without request of fullscales.
-->

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_1-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_1-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb8-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb8-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb10-j0_1-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb10-j0_1-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb12-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb12-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_1-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_1-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb8-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb8-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb10-j0_1-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb10-j0_1-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb12-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb12-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion iCubChemnitz01/hardware/FT/right_arm-eb3-j0_3-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion iCubDarmstadt01/hardware/FT/left_arm-eb1-j0_3-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-eb1-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion iCubDarmstadt01/hardware/FT/left_leg-eb6-j0_3-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb6-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion iCubDarmstadt01/hardware/FT/left_leg-eb7-j4_5-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb7-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_leg-eb7-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion iCubDarmstadt01/hardware/FT/right_arm-eb3-j0_3-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-eb3-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion iCubDarmstadt01/hardware/FT/right_leg-eb8-j0_3-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb8-j0_3-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb8-j0_3-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
2 changes: 1 addition & 1 deletion iCubDarmstadt01/hardware/FT/right_leg-eb9-j4_5-strain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb9-j4_5-strain" type="embObjStrain">
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_leg-eb9-j4_5-strain" type="embObjFTsensor">

<xi:include href="../../general.xml"/>

Expand Down
Loading

0 comments on commit f89cd27

Please sign in to comment.