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

Can battery #793

Merged
merged 26 commits into from
Jul 29, 2022
Merged

Can battery #793

merged 26 commits into from
Jul 29, 2022

Conversation

triccyx
Copy link
Member

@triccyx triccyx commented May 18, 2022

Can battery new device

  • Parser
  • Device
  • Test

@pattacini pattacini self-requested a review May 18, 2022 07:22
@randaz81
Copy link
Member

  • I can see changes to internal lib, but what is the name of the device?
  • Does the device derives from the yarp::dev::IBattery public interface? (Please remember: yarp::dev::IAnalogSensor is going to be deprecated.)
  • Can be used to read the charge/voltage/current from the battery on R1?

@triccyx
Copy link
Member Author

triccyx commented May 18, 2022

@randaz81 I'll start developing the device in the next few days, for now, just the parser (ServiceParserCanBattery) class is ready. I'm writing the unit tests now.

  • It will be CanBattery or something like this
  • yarp::dev::IBattery, ok I will use it
  • R1, it depends on the board battery you will use (@marcoaccame )

@triccyx
Copy link
Member Author

triccyx commented May 18, 2022

@randaz81
The xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE device 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" type="embObjBattery">

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

    <xi:include href="../../hardware/electronics/face-eb22-j0_1-eln.xml" />

    <group name="SERVICE">

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

        <group name="PROPERTIES">

            <!-- we can have as many boards as we want, 
                 but now the only good ones are strain and strain2. 
                 use eoas_ft_isboardvalid() to verify -->
            <group name="CANBOARDS">
                <param name="type">                 bat      </param>

                <group name="PROTOCOL">
                    <param name="major">            0                   </param>
                    <param name="minor">            0                      </param>
                </group>
                <group name="FIRMWARE">
                    <param name="major">            0                   </param>
                    <param name="minor">            0                   </param>
                    <param name="build">            0                   </param>
                </group>
            </group>

            <group name="SENSORS">
                <param name="id">                   battery1        </param>
                <param name="board">                bat             </param>
                <param name="location">             CAN2:13         </param>
            </group>

        </group>

        <!-- we can pick up at max 4 sensors from the above list. 
             we can specify parameters which are different for each sensor 
             ft rate is in ms in range [1, 250]
             temperature rate is in ms but must be transformed in seconds.
             use calibration is boolean
             -->
        <group name="SETTINGS">
            <param name="enabledSensors">            battery1        </param>
            <param name="acquisitionRate">           1000            </param>   <!-- msec -->
        </group>


    </group>

</device>

@pattacini
Copy link
Member

Hi @triccyx

Remember that we need to make sure to compile against the new version of icub-firmware-shared as per robotology/icub-firmware-shared#63.

@triccyx
Copy link
Member Author

triccyx commented May 23, 2022

Yes, I'm keeping the two repos aligned

@pattacini

This comment was marked as duplicate.

@pattacini
Copy link
Member

Yes, I'm keeping the two repos aligned

The alignment needs to be enforced via cmake as per:

if(icub_firmware_shared_FOUND AND ICUB_USE_icub_firmware_shared)
# icub-firmware-shared 4.0.7 was actually a wrong version exported by icub-firmware-shared <= 1.15
if(icub_firmware_shared_VERSION VERSION_GREATER 4 OR icub_firmware_shared_VERSION VERSION_LESS 1.22.2)
message(FATAL_ERROR "An old version of icub-firmware-shared has been detected, but at least 1.22.2 is required")
endif()
endif()

Hi @triccyx
Remember to address this version constraint.

@pattacini
Copy link
Member

Also, there are conflicts that need to be fixed, in particular, on this file:
src/unittest/testServiceParserForMultipleFT.cpp.

@triccyx triccyx marked this pull request as ready for review July 27, 2022 09:09
Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

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

I'll keep this PR in draft until the sister PR in icub-firmware-shared will be merged.

@pattacini pattacini marked this pull request as draft July 27, 2022 12:44
@pattacini pattacini marked this pull request as ready for review July 29, 2022 12:12
Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

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

Waiting for CI and then I'll be happy to merge it.

@pattacini pattacini merged commit c32e12d into robotology:devel Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants