Skip to content
Snippets Groups Projects
ProfileLibrarySegment.cpp 1.83 KiB
Newer Older
#include "ProfileLibrarySegment.h"

#include <SimoxUtility/algorithm/string.h>

#include <ArmarXCore/core/time/ice_conversions.h>

#include <RobotAPI/libraries/armem/server/MemoryToIceAdapter.h>
#include <RobotAPI/libraries/armem_skills/aron_conversions.h>
#include <RobotAPI/libraries/aron/converter/datatype/DatatypeConverterVisitor.h>
#include <RobotAPI/libraries/aron/converter/json/NLohmannJSONConverter.h>
#include <RobotAPI/libraries/skills/core/aron/FluxioProfile.aron.generated.h>

namespace armarx::skills::segment
{
    ProfileLibraryCoreSegment::ProfileLibraryCoreSegment(
        armem::server::MemoryToIceAdapter& iceMemory) :
        Base(iceMemory, CoreSegmentName, skills::manager::arondto::FluxioProfile::ToAronType())
    {
    }

    void
    ProfileLibraryCoreSegment::defineProperties(PropertyDefinitionsPtr defs,
                                                      const std::string& prefix)
    {
        this->setDefaultMaxHistorySize(3);
        Base::defineProperties(defs, prefix);
    }

    void
    ProfileLibraryCoreSegment::init()
    {
        Base::init();
    }

    void
    ProfileLibraryCoreSegment::addProfile(const skills::manager::arondto::FluxioProfile& profile)
    {
        // // add skills
        // auto provId = id().withProviderSegmentName(skill.skillProviderId.id);

        // armem::Commit commit;
        // auto& entityUpdate = commit.add();
        // entityUpdate.confidence = 1.0;
        // entityUpdate.referencedTime = armem::Time::Now();
        // entityUpdate.sentTime = armem::Time::Now();
        // entityUpdate.arrivedTime = armem::Time::Now();
        // entityUpdate.instancesData = {skill.toAron()};
        // entityUpdate.entityID = provId.withEntityName("ArmarBlow");

        // // Commit data to memory and notify
        // iceMemory.commit(commit);
    }
} // namespace armarx::skills::segment