Skip to content

Commit

Permalink
Add configuration files for using the sw layer that handles the coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogene committed Mar 18, 2024
1 parent 335ed25 commit e6368a1
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 6 deletions.
47 changes: 47 additions & 0 deletions urdf/ergoCub/conf/ergocub_coupling_ros2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE robot PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">

<robot name="ergocubGazebo" build="1" portprefix="/ergocubSim" xmlns:xi="http://www.w3.org/2001/XInclude">

<devices>

<!-- MOTOR CONTROLLERS -->
<xi:include href="wrappers/motorControl/left_arm-mc_wrapper.xml" />
<xi:include href="wrappers/motorControl/right_arm-mc_wrapper.xml" />
<xi:include href="wrappers/motorControl/left_leg-mc_wrapper.xml" />
<xi:include href="wrappers/motorControl/right_leg-mc_wrapper.xml" />
<xi:include href="wrappers/motorControl/head-mc_wrapper.xml" />
<xi:include href="wrappers/motorControl/torso-mc_wrapper.xml" />

<xi:include href="wrappers/motorControl/left_hand-coupling_handler.xml" />
<xi:include href="wrappers/motorControl/right_hand-coupling_handler.xml" />
<xi:include href="wrappers/motorControl/left_arm-mc_remapper-coupling.xml" />
<xi:include href="wrappers/motorControl/right_arm-mc_remapper-coupling.xml" />
<xi:include href="wrappers/motorControl/left_arm-mc_remapper.xml" />
<xi:include href="wrappers/motorControl/right_arm-mc_remapper.xml" />
<xi:include href="wrappers/motorControl/left_leg-mc_remapper.xml" />
<xi:include href="wrappers/motorControl/right_leg-mc_remapper.xml" />
<xi:include href="wrappers/motorControl/head-mc_remapper.xml" />
<xi:include href="wrappers/motorControl/torso-mc_remapper.xml" />

<xi:include href="wrappers/motorControl/all-mc_remapper-coupling.xml" />
<xi:include href="wrappers/motorControl/all-mc_remapper_ros2-coupling.xml" />
<!-- ANALOG SENSORS FT -->
<xi:include href="wrappers/FT/left_leg-FT_remapper.xml" />
<xi:include href="wrappers/FT/right_leg-FT_remapper.xml" />
<xi:include href="wrappers/FT/left_leg-FT_wrapper.xml" />
<xi:include href="wrappers/FT/right_leg-FT_wrapper.xml" />
<xi:include href="wrappers/FT/left_arm-FT_wrapper.xml" />
<xi:include href="wrappers/FT/right_arm-FT_wrapper.xml" />

<!-- INERTIAL SENSOR-->
<xi:include href="wrappers/inertials/head-inertials_wrapper.xml" />

<!-- HEAD SENSORS -->
<xi:include href="sensors/rgbd_camera_wrapper.xml" />
<xi:include href="sensors/rgbd_camera_wrapper_ros2.xml" />
<xi:include href="sensors/lidar_wrapper.xml" />
<xi:include href="sensors/lidar_wrapper_ros2.xml" />

</devices>
</robot>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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="alljoints_mc-coupling" type="controlboardremapper">
<!-- These are the parameters with torso_pitch removed -->
<param name="axesNames">(neck_pitch,neck_roll,neck_yaw,camera_tilt,l_shoulder_pitch,l_shoulder_roll,l_shoulder_yaw,l_elbow,l_wrist_yaw,l_wrist_roll,l_wrist_pitch,l_thumb_add,l_thumb_prox,l_thumb_dist,l_index_add,l_index_prox,l_index_dist,l_middle_prox,l_middle_dist,l_ring_prox,l_ring_dist,l_pinkie_prox,l_pinkie_dist,r_shoulder_pitch,r_shoulder_roll,r_shoulder_yaw,r_elbow,r_wrist_yaw,r_wrist_roll,r_wrist_pitch,r_thumb_add,r_thumb_prox,r_thumb_dist,r_index_add,r_index_prox,r_index_dist,r_middle_prox,r_middle_dist,r_ring_prox,r_ring_dist,r_pinkie_prox,r_pinkie_dist,torso_roll,torso_pitch,torso_yaw,l_hip_pitch,l_hip_roll,l_hip_yaw,l_knee,l_ankle_pitch,l_ankle_roll,r_hip_pitch,r_hip_roll,r_hip_yaw,r_knee,r_ankle_pitch,r_ankle_roll)</param>
<param name="period"> 0.010 </param>
<param name="joints"> 57 </param>
<action phase="startup" level="6" type="attach">
<paramlist name="networks">
<elem name="head_joints"> head-mc_remapper </elem>
<elem name="left_arm_joints"> left_arm-mc_remapper-coupling </elem>
<elem name="right_arm_joints"> right_arm-mc_remapper-coupling </elem>
<elem name="torso_joints"> torso-mc_remapper </elem>
<elem name="left_leg_joints"> left_leg-mc_remapper </elem>
<elem name="right_leg_joints"> right_leg-mc_remapper </elem>
</paramlist>
</action>
<action phase="shutdown" level="20" type="detach" />
</device>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE robot 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="cbw_ros2" type="controlBoard_nws_ros2">
<param name="node_name"> ros2_cb_node </param>
<param name="topic_name"> /joint_states </param>
<param name="period"> 0.010 </param>
<action phase="startup" level="7" type="attach">
<param name="device"> alljoints_mc-coupling </param>
</action>
<action phase="shutdown" level="3" type="detach" />
</device>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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-mc_remapper-coupling" type="controlboardremapper">
<param name="axesNames">(l_shoulder_pitch,l_shoulder_roll,l_shoulder_yaw,l_elbow,l_wrist_yaw,l_wrist_roll,l_wrist_pitch,l_thumb_add,l_thumb_prox,l_thumb_dist,l_index_add,l_index_prox,l_index_dist,l_middle_prox,l_middle_dist,l_ring_prox,l_ring_dist,l_pinkie_prox,l_pinkie_dist)</param>
<param name="joints"> 19 </param>
<action phase="startup" level="6" type="attach">
<paramlist name="networks">
<elem name="left_arm_joints1"> left_arm_hardware_device </elem>
<elem name="left_arm_joints2"> left_hand-coupling_handler </elem>
</paramlist>
</action>
<action phase="shutdown" level="20" type="detach" />
</device>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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_hand-coupling_handler" type="controlBoardCouplingHandler">
<param name="coupling_device"> couplingXCubHandMk5 </param>
<param name="jointNames"> l_thumb_add l_thumb_prox l_thumb_dist l_index_add l_index_prox l_index_dist l_middle_prox l_middle_dist l_ring_prox l_ring_dist l_pinkie_prox l_pinkie_dist </param>
<group name="LIMITS">
<param name="jntVelMax"> 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 </param>
<param name="jntPosMax"> 100.0 90.0 101.4 15.0 90.0 103.1 90.0 103.1 90.0 103.1 90.0 98.7 </param>
<param name="jntPosMin"> -100.0 -90.0 -101.4 -15.0 -90.0 -103.1 -90.0 -103.1 -90.0 -103.1 -90.0 -98.7 </param>
</group>
<group name="COUPLING">
<param name="actuatedAxesNames"> l_thumb_add l_thumb_oc l_index_add l_index_oc l_middle_oc l_ring_pinky_oc </param>
<param name="actuatedAxesPosMin"> 0.0 0.0 0.0 0.0 0.0 0.0 </param>
<param name="actuatedAxesPosMax"> 100.0 90.0 15.0 90.0 90.0 90.0 </param>
</group>
<group name="COUPLING_PARAMS">
<param name="L0x"> -0.0050 -0.0050 -0.0050 -0.0050 -0.0050 </param>
<param name="L0y"> 0.0040 0.0040 0.0040 0.0040 0.0040 </param>
<param name="q2bias"> -173.35 -173.35 -173.35 -173.35 -170.53 </param>
<param name="q1off"> 2.45 2.15 2.15 2.15 2.46 </param>
<param name="k"> 0.03415 0.03913 0.03913 0.03913 0.03418 </param>
<param name="d"> 0.03503 0.04003 0.04003 0.04003 0.03503 </param>
<param name="l"> 0.00604 0.00604 0.00604 0.00604 0.00608 </param>
<param name="b"> 0.00640 0.00640 0.00640 0.00640 0.00640 </param>
</group>
<action phase="startup" level="5" type="attach">
<param name="device"> left_hand_hardware_device </param>
</action>
<action phase="shutdown" level="15" type="detach" />
</device>
11 changes: 11 additions & 0 deletions urdf/ergoCub/conf/wrappers/motorControl/left_hand-mc_wrapper.xml
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_hand-mc_nws_yarp" type="controlBoard_nws_yarp">
<param name="name"> ${portprefix}/left_hand </param>
<param name="period">0.01</param>
<action phase="startup" level="10" type="attach">
<param name="device"> left_hand-coupling_handler </param>
</action>
<action phase="shutdown" level="15" type="detach" />
</device>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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-mc_remapper-coupling" type="controlboardremapper">
<param name="axesNames">(r_shoulder_pitch,r_shoulder_roll,r_shoulder_yaw,r_elbow,r_wrist_yaw,r_wrist_roll,r_wrist_pitch,r_thumb_add,r_thumb_prox,r_thumb_dist,r_index_add,r_index_prox,r_index_dist,r_middle_prox,r_middle_dist,r_ring_prox,r_ring_dist,r_pinkie_prox,r_pinkie_dist)</param>
<param name="joints"> 19 </param>
<action phase="startup" level="6" type="attach">
<paramlist name="networks">
<elem name="right_arm_joints1"> right_arm_hardware_device </elem>
<elem name="right_arm_joints2"> right_hand-coupling_handler </elem>
</paramlist>
</action>
<action phase="shutdown" level="20" type="detach" />
</device>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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_hand-coupling_handler" type="controlBoardCouplingHandler">
<param name="coupling_device"> couplingXCubHandMk5 </param>
<param name="jointNames"> r_thumb_add r_thumb_prox r_thumb_dist r_index_add r_index_prox r_index_dist r_middle_prox r_middle_dist r_ring_prox r_ring_dist r_pinkie_prox r_pinkie_dist </param>
<group name="LIMITS">
<param name="jntVelMax"> 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 </param>
<param name="jntPosMax"> 100.0 90.0 101.4 15.0 90.0 103.1 90.0 103.1 90.0 103.1 90.0 98.7 </param>
<param name="jntPosMin"> -100.0 -90.0 -101.4 -15.0 -90.0 -103.1 -90.0 -103.1 -90.0 -103.1 -90.0 -98.7 </param>
</group>
<group name="COUPLING">
<param name="actuatedAxesNames"> r_thumb_add r_thumb_oc r_index_add r_index_oc r_middle_oc r_ring_pinky_oc </param>
<param name="actuatedAxesPosMin"> 0.0 0.0 0.0 0.0 0.0 0.0 </param>
<param name="actuatedAxesPosMax"> 100.0 90.0 15.0 90.0 90.0 90.0 </param>
</group>
<group name="COUPLING_PARAMS">
<param name="L0x"> -0.0050 -0.0050 -0.0050 -0.0050 -0.0050 </param>
<param name="L0y"> 0.0040 0.0040 0.0040 0.0040 0.0040 </param>
<param name="q2bias"> -173.35 -173.35 -173.35 -173.35 -170.53 </param>
<param name="q1off"> 2.45 2.15 2.15 2.15 2.46 </param>
<param name="k"> 0.03415 0.03913 0.03913 0.03913 0.03418 </param>
<param name="d"> 0.03503 0.04003 0.04003 0.04003 0.03503 </param>
<param name="l"> 0.00604 0.00604 0.00604 0.00604 0.00608 </param>
<param name="b"> 0.00640 0.00640 0.00640 0.00640 0.00640 </param>
</group>
<action phase="startup" level="5" type="attach">
<param name="device"> right_hand_hardware_device </param>
</action>
<action phase="shutdown" level="15" type="detach" />
</device>
12 changes: 6 additions & 6 deletions urdf/ergoCub/robots/ergoCubSN001/model.urdf
Original file line number Diff line number Diff line change
Expand Up @@ -1241,8 +1241,8 @@
</collision>
</link>
<joint name="l_index_add" type="revolute">
<origin xyz="0.022500000000000034 -0.0015000000000006397 -0.06859999999999966" rpy="-8.126657451512497e-16 -0.2967059722446555 1.7414265967526777e-16"/>
<axis xyz="1.3005559878087045e-15 1.0000000000000002 -1.953448495705706e-15"/>
<origin xyz="0.022500000000000023 -0.0015000000000006952 -0.0685999999999996" rpy="-8.416895217637947e-16 -0.29670597224465534 5.804755322508926e-17"/>
<axis xyz="1.1895336853461886e-15 0.9999999999999999 -1.9812040713213337e-15"/>
<parent link="l_hand_palm"/>
<child link="l_hand_index_1"/>
<limit lower="0" upper="0.2617993877991494" effort="1e+9" velocity="1e+9"/>
Expand Down Expand Up @@ -1571,8 +1571,8 @@
</collision>
</link>
<joint name="l_index_prox" type="revolute">
<origin xyz="0.009192533346793416 -2.7755575615628914e-17 -0.030713451309624162" rpy="-2.7755575615628914e-16 -7.023611553469422e-10 -7.771561172376094e-16"/>
<axis xyz="-1.0000000000000002 2.7755575615627613e-17 7.023654366444809e-10"/>
<origin xyz="0.00919253334679343 0 -0.030713451309624218" rpy="-3.0531133177191815e-16 -7.023611484080483e-10 -7.771561172376096e-16"/>
<axis xyz="-1 8.326672684688522e-17 7.023654435833748e-10"/>
<parent link="l_hand_index_1"/>
<child link="l_hand_index_2"/>
<limit lower="0" upper="1.5707963267948966" effort="1e+9" velocity="1e+9"/>
Expand Down Expand Up @@ -1604,8 +1604,8 @@
</collision>
</link>
<joint name="l_index_dist" type="revolute">
<origin xyz="-2.7755575615628914e-17 -0.0014999999999999736 -0.039999999999999925" rpy="-7.482326169760975e-8 1.734723475976807e-16 -6.106226635438361e-16"/>
<axis xyz="-1 -1.804112664227406e-16 9.020562801946248e-17"/>
<origin xyz="-1.3877787807814457e-17 -0.001500000000000029 -0.03999999999999987" rpy="-7.482326172536535e-8 1.8041124150158794e-16 -6.106226635438361e-16"/>
<axis xyz="-1 -2.359224176539984e-16 4.163337069211178e-17"/>
<parent link="l_hand_index_2"/>
<child link="l_hand_index_3"/>
<limit lower="0" upper="1.7994344588061537" effort="1e+9" velocity="1e+9"/>
Expand Down

0 comments on commit e6368a1

Please sign in to comment.