Program Listing for File FactorConstVelKinematics.h

Return to documentation for file (include/mola_kernel/factors/FactorConstVelKinematics.h)

/* -------------------------------------------------------------------------
 *   A Modular Optimization framework for Localization and mApping  (MOLA)
 * Copyright (C) 2018-2024 Jose Luis Blanco, University of Almeria
 * See LICENSE for license information.
 * ------------------------------------------------------------------------- */
#pragma once

#include <mola_kernel/factors/FactorBase.h>
#include <mrpt/core/exceptions.h>

namespace mola
{
class FactorConstVelKinematics : public FactorBase
{
    DEFINE_SERIALIZABLE(FactorConstVelKinematics, mola)

   public:
    FactorConstVelKinematics() = default;

    FactorConstVelKinematics(id_t kf_from, id_t kf_to, double deltaTime)
        : from_kf_(kf_from), to_kf_(kf_to), deltaTime_(deltaTime)
    {
    }

    id_t from_kf_ = INVALID_ID, to_kf_ = INVALID_ID;

    double deltaTime_ = .0;

    std::size_t edge_count() const override { return 2; }
    mola::id_t  edge_indices(const std::size_t i) const override;
};

}  // namespace mola