Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update template v6 with battery info #580

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions iCubTemplates/iCubTemplateV6_0/hardware/battery/battery_part.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE device PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">

<!-- value for name should be the same as the one defined in the wrapper file. Type is embObjBattery-->
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="battery_device_name_as_in_wrapper" type="embObjBattery">

<xi:include href="../../general.xml" />
<!-- Here you should include the body part, which the battery electronic device (bat or bms) is attached to. It should be the body part represented by the ems board connected to bat or bms-->
<xi:include href="../electronics/body_part-ebX-jA_B-eln.xml" />

<group name="SERVICE">

<param name="type"> eomn_serv_AS_battery </param>

<group name="PROPERTIES">

<group name="CANBOARDS">
<!-- Type is bat for the BAT board and bms for the BMS board-->
<param name="type"> bat </param>

<group name="PROTOCOL">
<param name="major"> 0 </param>
<param name="minor"> 0 </param>
</group>
<!-- versions as defined in the FW of BAT - for BMS you should use 1.2.0 or leave all zeros if have any problems in matching the versions -->
<group name="FIRMWARE">
<param name="major"> 1 </param>
<param name="minor"> 3 </param>
<param name="build"> 0 </param>
</group>
</group>

<group name="SENSORS">
<param name="id"> battery1 </param>
<!-- same as the type above-->
<param name="board"> bat </param>
<param name="location"> CAN2:1 </param> <!-- this is the CAN location. It should be on CAN2 since on CAN1 we have the FT sensors-->
</group>

</group>


<group name="SETTINGS">
<param name="enabledSensors"> battery1 </param>
<param name="acquisitionRate"> 1000 </param> <!-- msec -->
</group>


</group>

</device>
8 changes: 8 additions & 0 deletions iCubTemplates/iCubTemplateV6_0/icub_all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@
<!-- CARTESIANS -->
<xi:include href="cartesian/left_arm-cartesian.xml" />
<xi:include href="cartesian/right_arm-cartesian.xml" />

<!-- battery BAT -->
<xi:include href="wrappers/battery/battery_bat.xml" />
<xi:include href="hardware/battery/battery_bat.xml" />

<!-- battery BMS -->
<xi:include href="wrappers/battery/battery_bms.xml" />
<xi:include href="hardware/battery/battery_bms.xml" />

</devices>
</robot>
15 changes: 15 additions & 0 deletions iCubTemplates/iCubTemplateV6_0/wrappers/battery/battery_part.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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="battery_wrapper" type="battery_nws_yarp">
<param name="period"> 1.0 </param>
<param name="name"> /ergocub/battery/bat </param> <!-- name of the port on which you wish to see the values managed by this device-->

<action phase="startup" level="5" type="attach">
<paramlist name="networks">
<!-- The param value must match the device name in the corresponding body_part-ebX-jA_B-hw.xml file -->
<elem name="battery"> battery_bat </elem> <!-- same name as in hardware/battery/battery_part.xml-->
</paramlist>
</action>

<action phase="shutdown" level="5" type="detach" />
</device>