Skip to content
3 changes: 2 additions & 1 deletion iCubGenova11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ yarp_install(DIRECTORY cartesian DESTINATION ${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/$
yarp_install(DIRECTORY wrappers DESTINATION ${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${appname})
yarp_install(DIRECTORY hardware DESTINATION ${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${appname})
yarp_install(DIRECTORY camera DESTINATION ${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${appname})
yarp_install(DIRECTORY estimators DESTINATION ${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${appname})
yarp_install(DIRECTORY estimators DESTINATION ${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${appname})
yarp_install(DIRECTORY checker DESTINATION ${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${appname})
2 changes: 1 addition & 1 deletion iCubGenova11/calibrators/left_arm-calib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<param name="startupPosThreshold"> 2 2 2 2 90 90 90 90 90 90 90 90 90 90 90 90 </param>
</group>

<param name="CALIB_ORDER">(0 1 2 3) (4) (5 6 7) (8 9 11 13) (10 12 14 15)</param>
<param name="CALIB_ORDER">(0 1 2 3) (4) (5 6 7) (8 9 11 13) (10 12 14)</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MSECode, was this change intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First commit I did was from the robot. Thus it might be due to changes left there that I took when checking out. I know that lately there were some problems with the finger. Thus I'm not sure if it was due to that to remove the last joint. Anyway I can remove that change from this PR and we can double check that directly on the robot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway I can remove that change from this PR and we can double check that directly on the robot.

Yep, thanks! I'd go with this solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@pattacini pattacini Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that they're disabled locally to the robot doesn't imply that they should be upstream in the repo. Something to consider with care, I'd say.

I would still keep 15 upstream.
iCubGenova11 follows a different workflow/pace wrt ergCubs.

<!-- <param name="CALIB_ORDER">(0 1 2 3) (4) (5 6 7) (8 9 11 13) (10 12 14 15)</param> -->
<action phase="startup" level="10" type="calibrate">
<param name="target">left_arm-mc_remapper</param>
Expand Down
3 changes: 1 addition & 2 deletions iCubGenova11/calibrators/right_arm-calib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</group>


<param name="CALIB_ORDER">(0 1 2 3) (4) (5 6) (8 9 11 13) (10 12 14 15)</param>
<param name="CALIB_ORDER">(0 1 2 3) (4) (5 6) (8 9 11 13) (10 12 14)</param>
<!-- <param name="CALIB_ORDER">(0 1 2 3) (4) (5 6 7) (8 9 11 13) (10 12 14 15)</param> -->

<action phase="startup" level="10" type="calibrate">
Expand All @@ -47,4 +47,3 @@
<action phase="interrupt3" level="1" type="abort" />

</device>

27 changes: 27 additions & 0 deletions iCubGenova11/checker/fineCalibrationCheckerConfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">


<device xmlns:xi="http://www.w3.org/2001/XInclude" name="fineCalibrationChecker" type="fineCalibrationChecker">
<param name="devicename">fineCalibrationChecker</param>
<param name="robotname">iCubGenova11</param>
<param name="remoteRawValuesPort">/left_arm/raw_data</param> <!--right_arm/raw_data if needed other control board-->
<!-- <param name="axesNamesList">(r_shoulder_pitch, r_shoulder_roll, r_shoulder_yaw, r_elbow)</param> -->
<param name="axesNamesList">(l_shoulder_pitch, l_shoulder_roll, l_shoulder_yaw, l_elbow)</param>
<!-- <param name="goldPositions">(35535, 33135, 24960, 25983)</param> --> <!--right_arm-->
<param name="goldPositions">(58559, 22639, 48830, 51983)</param> <!--left_arm-->
<!--<param name="calibrationDeltas">(1.0, -9.2, -14.2, 0 )</param> --> <!--right_arm-->
<param name="calibrationDeltas">(0, -9.2, -17.1, -2.7 )</param> <!--left_arm-->
<param name="encoderResolutions">(262144, 262144, 262144, 262144)</param> <!--2^18 raw encoder resolution-->


<action phase="startup" level="15" type="attach">
<paramlist name="networks">
<elem name="setup_joint_0">left_arm-eb1-j0_3-mc</elem>
<!-- <elem name="setup_joint_0">right_arm-eb3-j0_3-mc</elem> --> <!--right_arm -->
</paramlist>
</action>

<action phase="shutdown" level="2" type="detach" />

</device>
4 changes: 4 additions & 0 deletions iCubGenova11/icub_all_no_legs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,9 @@
<xi:include href="calibrators/head-calib.xml" />
<xi:include href="calibrators/face-calib.xml" />

<!-- FINE CALIBRATOR CHECKER DEMO and TEST -->
<xi:include href="wrappers/motorControl/left_arm-mc-rawval-nws_wrapper.xml" />
<!-- <xi:include href="wrappers/motorControl/right_arm-mc-rawval-nws_wrapper.xml" /> -->
<xi:include href="checker/fineCalibrationCheckerConfig.xml" />
</devices>
</robot>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="left_arm-rawval_nws_yarp" type="rawValuesPublisherServer">
<param name="name"> /left_arm/raw_data </param>
<param name="period"> 2 </param>
<action phase="startup" level="10" type="attach">
<param name="device"> left_arm-eb1-j0_3-mc </param>
</action>
<action phase="shutdown" level="15" type="detach" />
</device>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">

<device xmlns:xi="http://www.w3.org/2001/XInclude" name="right_arm-rawval_nws_yarp" type="rawValuesPublisherServer">
<param name="name"> /right_arm/raw_data </param>
<param name="period"> 2 </param>
<action phase="startup" level="10" type="attach">
<param name="device"> right_arm-eb3-j0_3-mc </param>
</action>
<action phase="shutdown" level="15" type="detach" />
</device>
1 change: 1 addition & 0 deletions tests/dry-run/check-xml/schemas/wrapper.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<xs:enumeration value="controlBoard_nws_yarp" />
<xs:enumeration value="controlBoard_nws_ros" />
<xs:enumeration value="controlBoard_nws_ros2" />
<xs:enumeration value="rawValuesPublisherServer"/>
</xs:restriction>
</xs:simpleType>

Expand Down
63 changes: 60 additions & 3 deletions tests/dry-run/check-xml/src/check-xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,51 @@ bool loadXmlFile(const std::string& robot_dir, const std::string& filename, pugi
}
}

bool checkWrappersRemappers(const std::string& robot_dir, std::vector<std::string>& vectorAllFiles,
/**
check wrappers that are independent from calibrators and remappers
1- find devices that are inside hardware/motorControl whose file ends with -mc.xml
2- for each file found, look for the device name and save in a list
3- compare this list of targets with the devices inside *-rawval-nws_wrapper.xml
*/
bool checkMotorControlWrappers(const std::string& robot_dir, std::vector<std::string>& vectorAllFiles, std::vector<std::string>& vectorUnremapped, bool& pass){
std::vector<std::string> list_of_targets;
pugi::xml_document doc_mc;
std::string device, target;

for (auto ele : vectorAllFiles)
{
if(ele.find("hardware/motorControl") != std::string::npos && ele.find("-mc.xml") != std::string::npos) {
if(!loadXmlFile(robot_dir, ele, doc_mc)) return false;
pugi::xpath_node device_name = doc_mc.select_node("device");
device = trim(device_name.node().attribute("name").value());
std::cout << "Adding device: " << device << " to the list of targets to be checked" << std::endl;
list_of_targets.push_back(device);
doc_mc.reset();
}
}

for (auto ele : vectorAllFiles)
{
if(ele.find("wrappers/motorControl") != std::string::npos && ele.find("rawval-nws_wrapper.xml") != std::string::npos) {
if(!loadXmlFile(robot_dir, ele, doc_mc)) return false;
pugi::xpath_node action_startup = doc_mc.select_node("//action[@phase='startup']/param[@name='device']/text()");
target = trim(action_startup.node().value());
if(std::find(list_of_targets.begin(), list_of_targets.end(), target) != list_of_targets.end()){
vectorUnremapped.push_back(ele);
std::cout << target << " - MOTOR CONTROL WRAPPER CHECK PASSED!" << std::endl;
}
else{
std::cerr << target << " - MOTOR CONTROL WRAPPER CHECK FAILED!" << std::endl;
pass = false;
}
doc_mc.reset();
}
}

return true;
}

bool checkWrappersRemappers(const std::string& robot_dir, std::vector<std::string>& vectorAllFiles, std::vector<std::string>& vectorUnremapped,
const std::string& part, const std::string& target, bool& pass){
bool found = false;
pugi::xml_document doc_wrapper, doc_remapper;
Expand All @@ -133,6 +177,12 @@ bool checkWrappersRemappers(const std::string& robot_dir, std::vector<std::strin
if(ele.find("wrappers/motorControl") != std::string::npos){
if(ele.find("wrapper.xml") != std::string::npos) {
if(!loadXmlFile(robot_dir, ele, doc_wrapper)) return false;
if (std::find(vectorUnremapped.begin(), vectorUnremapped.end(), ele) != vectorUnremapped.end())
{
std::cout << part << " - SKIPPED SINCE UNREMAPPED!" << std::endl;
found = true;
continue;
}
pugi::xpath_node action_startup = doc_wrapper.select_node("//action[@phase='startup']/param[@name='device']/text()");
device = trim(action_startup.node().value());
if(device == target) std::cout << part <<" - WRAPPER CHECK PASSED!" << std::endl;
Expand Down Expand Up @@ -183,6 +233,13 @@ bool checkCartesian(const std::string& robot_dir, std::vector<std::string>& vect
}

bool checkCalibratorsWrappersRemappers(const std::string& robot_dir, std::vector<std::string>& vectorAllFiles, bool& pass){
// save first list of unremapped devices to skip the check for wrappers/remappers
// we cannot check the single element inside the for loop by passing ele to method
// since we first need to fill the list of targets by looking in hardware/motorControl directory
// while the unramapped devices are inside wrappers/motorControl directory
std::vector<std::string> vectorUnremapped;
checkMotorControlWrappers(robot_dir, vectorAllFiles, vectorUnremapped, pass);

for (auto ele : vectorAllFiles)
{
std::string part, target1, target2;
Expand All @@ -209,7 +266,7 @@ bool checkCalibratorsWrappersRemappers(const std::string& robot_dir, std::vector
pass = false;
}

checkWrappersRemappers(robot_dir, vectorAllFiles, part, target1, pass);
checkWrappersRemappers(robot_dir, vectorAllFiles, vectorUnremapped, part, target1, pass);
if(ele.find("arm") != std::string::npos){
checkCartesian(robot_dir, vectorAllFiles, part, target1, pass);
}
Expand Down Expand Up @@ -248,7 +305,7 @@ int main(int argc, char *argv[]) {
std::cout << std::endl << "2 - test included xml files presence **************" << std::endl << std::endl;

if(!checkIncludedFiles(robot_dir, vectorAllFiles, filename, doc)) return EXIT_FAILURE;

// checks calibrators/wrappers/remappers/cartesian xml files consistency
std::cout << std::endl << "3 - test calibrators/wrappers/remappers/cartesian xml files consistency **************" << std::endl << std::endl;

Expand Down